diff examples/sound/sampled/stacker2.scm @ 0:bf79fb79ee13

Initial Mercurial check in.
author samer
date Tue, 17 Jan 2012 17:50:20 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/sound/sampled/stacker2.scm	Tue Jan 17 17:50:20 2012 +0000
@@ -0,0 +1,26 @@
+;;; Example of how to use Stacker2, which buffers several
+;;; vectors into one big vector.
+
+(load "audio.scm")
+(load "functions.scm")
+(load "models.scm")
+
+
+;;; Buffers the last n vectors from x. Adds the appropriate
+;;; task and returns the big composite vector.
+(define (stack n x)
+	(define stacker (node (.getNode x) (Stacker2. x n)))
+	(addtasks stacker)
+	(.output stacker))
+
+
+(stack 16 
+	(diffscale 
+		(ft-mag (ft-vec (norm (linein (linesrc (mono 11025)) 512 256))))
+		cauchy-spec))
+
+(expose)
+
+(put "image.width" 256)
+(put "image.height" 16)
+(put "image.map.log" true)