annotate examples/sound/sampled/stacker2.scm @ 8:5e3cbbf173aa tip

Reorganise some more
author samer
date Fri, 05 Apr 2019 22:41:58 +0100
parents bf79fb79ee13
children
rev   line source
samer@0 1 ;;; Example of how to use Stacker2, which buffers several
samer@0 2 ;;; vectors into one big vector.
samer@0 3
samer@0 4 (load "audio.scm")
samer@0 5 (load "functions.scm")
samer@0 6 (load "models.scm")
samer@0 7
samer@0 8
samer@0 9 ;;; Buffers the last n vectors from x. Adds the appropriate
samer@0 10 ;;; task and returns the big composite vector.
samer@0 11 (define (stack n x)
samer@0 12 (define stacker (node (.getNode x) (Stacker2. x n)))
samer@0 13 (addtasks stacker)
samer@0 14 (.output stacker))
samer@0 15
samer@0 16
samer@0 17 (stack 16
samer@0 18 (diffscale
samer@0 19 (ft-mag (ft-vec (norm (linein (linesrc (mono 11025)) 512 256))))
samer@0 20 cauchy-spec))
samer@0 21
samer@0 22 (expose)
samer@0 23
samer@0 24 (put "image.width" 256)
samer@0 25 (put "image.height" 16)
samer@0 26 (put "image.map.log" true)