[PlanetCCRMA] cm rts problem

Fernando Lopez-Lezcano nando@ccrma.Stanford.EDU
Sun Apr 22 17:26:01 2007

On Sun, 2007-04-22 at 15:20 -0700, Anthony Green wrote:
> Fernando Lopez-Lezcano wrote:
> > [BTW, I had tested this, I even sent a scheduling latency graph to Rick]
> > 
> > I just tried one of the examples in the rts Common Music dictionary
> > entry (surf locally to:
> > "file:///usr/share/common-lisp/source/cm/doc/dict/index.html" and search
> > for "rts") and it seems to work fine (ie: events were scheduled
> > correctly). 
> Thanks for testing this.  That works for me as well.  But this doesn't....
> (in-package :cm)
> (defparameter *pm-zyn* (portmidi-open :output "ZynAddSubFX" :latency 0))
> (rts *pm-zyn* :time-format :sec)
> (define (chordy)
>    (let ((pat (new cycle :of (list
> 			     (new chord :of '(c4 e4 g4))
>   			     (new chord
>   			       :of (new heap
>   				     :of '(df4 ef4 gf4 af4 bf4 df5 ef5)
>   				     :for 3))
>   			     (new chord :of '(e4 a4 cs5))
> 			     (new weighting
> 			       :of '(bf3 (ef1 :weight .5 :max 2))
> 			       :for 1)))))
>      (process repeat 240
>               do (doeach (k (next pat))
>                    (output (new midi :keynum k :amplitude 120 :time (now))))
> 	     wait .25)))
> (events (chordy) *pm-zyn*)
> If you evaluate this, ZynAddSubFX will play many many chords all at once.
> But if you change that last line to
> (events (chordy) "foo.mid")
> You get a properly sequenced series of chords in foo.mid.

But if you do:
(sprout (chordy))
after starting rts it seems to work just fine...

I imagine that in this new version of Common Music events does not know
how to handle rts streams properly. None of the examples in the rts page
use events. This version of rts is new so most probably syntax/semantics
may have changed without warning - if you are using old examples that
used to work all bets may be off, I suggest to try code snippets from
the new version. 

-- Fernando