[CM] with-threaded-sound?

Bill Schottstaedt bil at ccrma.Stanford.EDU
Fri Jun 6 07:19:39 PDT 2008

I just realized it's almost trivial to define a with-sound that
puts each note in a separate thread:

(defmacro with-threaded-sound (args . body)
  `(with-sound-helper (lambda ()
			 (lambda (expr)
			    (lambda ()
			      (eval expr (current-module)))))
			(let ((us (current-thread)))
			   (lambda (expr) 
			     (if (and (not (thread-exited? expr))
				      (not (eq? expr us)))
				 (join-thread expr)))
		      , at args))

(with-threaded-sound ()
  (fm-violin 0 1 440 .1)
  (fm-violin 0 1 660 .1))

Now to get rid of that "eval"...

More information about the Cmdist mailing list