You could create multiple functions that call each other, all based on the same metre :<div><br></div><div><span class="Apple-style-span" style="font-size: small;"><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">(define mel1a</font></span></div>
<div><span class="Apple-style-span" style="font-size: small;"><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">   (lambda (beat)</font></span></div><div><span class="Apple-style-span" style="font-size: small;"><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">      (play some music)</font></span></div>
<div><span class="Apple-style-span" style="font-size: small;"><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">      (if (metre beat 4)</font></span></div><div><span class="Apple-style-span" style="font-size: small;"><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">          (callback </font></span><span class="Apple-style-span" style="border-collapse: collapse; "><span class="Apple-style-span" style="font-size: small;"><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">(*metro* (+ beat .4)) &#39;mel1b (+ beat .5))</font></span></span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; "><span class="Apple-style-span" style="font-size: small;"><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">          (callback (*metro* (+ beat .4)) &#39;mel1a (+ beat .5)))))</font></span></span></div>
<div><font class="Apple-style-span" face="&#39;courier new&#39;" size="2"><span class="Apple-style-span" style="border-collapse: collapse; font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;"><span class="Apple-style-span" style="border-collapse: collapse; "><span class="Apple-style-span" style="font-size: small;"><br>
</span></span></font></div><div><font class="Apple-style-span" face="&#39;courier new&#39;" size="2"><span class="Apple-style-span" style="border-collapse: collapse; font-size: 10px;"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><span class="Apple-style-span" style="font-size: small;">And so on with mel1b, c ...</span></font><br clear="all">
</span></font>_______________________<br>Pierre-Yves Gérardy, MD<br>Headache Research Unit<br>University of Liege<br>Citadelle Hospital (University dept. of Neurology),<br>Boulevard du XIIe de Ligne, 1<br>B4000 Liège, Belgium<br>
Phone : +32 (0) 4 225 71 41<br>Mobile : +32 (0) 472 543 727<br>Fax : +32 (0) 4 223 88 07<br>Department Secretary : Ms Groven : +32 (0) 4 225 63 91<br>
<br><br><div class="gmail_quote">On Wed, Mar 11, 2009 at 12:06, Michele Pasin <span dir="ltr">&lt;<a href="mailto:michele.pasin@kcl.ac.uk">michele.pasin@kcl.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Hi dear Impromptu-fellows,<br>
<br>
would you have a go with the code below?<br>
On my machine the audio constantly disappears after exactly 1 minute<br>
and 33 seconds (I know, the melody sounds awful, it&#39;s because I<br>
stripped it down to the bare basics for making my point).<br>
<br>
If you&#39;re wondering what kind of thing I was trying to do... well<br>
basically I wanted to make a piece by organizing it into various<br>
&#39;patches&#39; of 4/4, and call them from a &#39;master&#39; patch of 8/4 (or 16/4<br>
or more..).<br>
It was just an idea, maybe this approach is totally wrong since<br>
conception! In such case, how would you approach it instead?<br>
<br>
<br>
tx a lot!<br>
<br>
mik<br>
<br>
<br>
<br>
<br>
<br>
===================================================<br>
<br>
(au:clear-graph)<br>
<br>
(define piano  (au:make-node &quot;aumu&quot; &quot;dls &quot; &quot;appl&quot;))<br>
(define *mixer* (au:make-node &quot;aumx&quot; &quot;smxr&quot; &quot;appl&quot;))<br>
<br>
(au:connect-node piano 0 *mixer* 1)<br>
(au:connect-node *mixer* 0 *au:output-node* 0)<br>
<br>
(au:update-graph)<br>
(au:print-graph)<br>
<br>
;;; times<br>
<br>
(define *metro* (make-metro 120))<br>
(define metre (make-metre &#39;(4) 1)) ;;  a classic 4/4<br>
(define metre2 (make-metre &#39;(8) 1))<br>
<br>
;;;;;;;;;<br>
;;<br>
;;; this crashes the sound output ... I timed it, always after 1:33<br>
<br>
(define mel1<br>
    (lambda (beat)<br>
       (if (metre beat 1)<br>
           (play piano 60 60 *second*))<br>
       (if (metre2 beat 1 )<br>
           (play piano 48 60 *second*))<br>
       (if (metre2 beat 1  )<br>
           (mel2 beat 36))<br>
       (if (metre2 beat 5  )<br>
           (mel2 beat 40))<br>
       (callback (*metro* (+ beat .4)) &#39;mel1 (+ beat .5))))<br>
<br>
<br>
(define mel2<br>
    (lambda (beat note)<br>
       (if #t<br>
           (play piano note 50 10000))<br>
       (if (not (metre beat 4))<br>
           (callback (*metro* (+ beat .4)) &#39;mel2 (+ beat 1) note))))<br>
<br>
<br>
<br>
(mel1 (*metro* &#39;get-beat))<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Impromptu mailing list<br>
<a href="mailto:Impromptu@lists.moso.com.au">Impromptu@lists.moso.com.au</a><br>
<a href="http://lists.moso.com.au/mailman/listinfo/impromptu" target="_blank">http://lists.moso.com.au/mailman/listinfo/impromptu</a><br>
</blockquote></div><br></div>