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