[CM] scheme, snd, cm_patterns.scm

James Hearon j_hearon at hotmail.com
Sun Jul 12 12:16:18 PDT 2015


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.vinjar at bek.no
> To: cmdist at ccrma.Stanford.EDU
> Subject: Re: [CM] scheme, snd, cm_patterns.scm
> Message-ID: <87io9rf1fz.fsf at 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 at ccrma.stanford.edu
> https://cm-mail.stanford.edu/mailman/listinfo/cmdist
> 
> 
> End of Cmdist Digest, Vol 87, Issue 7
> *************************************
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20150712/33a1f3f3/attachment.html>


More information about the Cmdist mailing list