Hi,Yes. This is helpful, insightful. I'm still trying to get used to scheme in snd.Thanks,Jim
> > Message: 1 > Date: Sat, 11 Jul 2015 12:12:00 +0200 > From: anders.vin...@bek.no > To: cmdist@ccrma.Stanford.EDU > Subject: Re: [CM] scheme, snd, cm_patterns.scm > Message-ID: <87io9rf1fz....@bek.no> > Content-Type: text/plain > > Hi James. > > The beauty of the pattern-streams is they are 'streams', embodying a > pattern (eg. a 'heap' in the above example) together with a promise to > deliver the next item whenever you need it. > > Typically you set up a generator and store a pointer to that, just like > you've done: > > (define aaa (make-heap '(160 600.345 1000 400))) > > After that, > > (next aaa) > > will return the next item from aaa anytime you want one. > > Using a slightly modified version of your example, you could do > something like: > > (let ((aaa (make-heap '(160 600.345 1000 400)))) ;set up a stream > (with-sound (:output "MyTest.wav" :srate 48000 :channels 2 > :header-type mus-riff :statistics #t) > (do ((st 0 (+ st 0.25))) > ((>= st 2)) > (examp1 st 0.25 > (next aaa) ; next item from aaa > 0.5 48000)))) > > You'll find a general doc about Ricks patterns here: > > http://commonmusic.sourceforge.net/cm/res/doc/cm.html#patterns > > Many files included with CMs docs, esp. "doc/patterns1.scm" and > "doc/patterns2.scm" - provide examples of setting up patterns and > using these. > > -anders > > > > ------------------------------ > > _______________________________________________ > Cmdist mailing list > Cmdist@ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > > > End of Cmdist Digest, Vol 87, Issue 7 > ************************************* >
_______________________________________________ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist