<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi,</p>
<p><br>
</p>
I had written about a scheme method to do something similar to CLM's with-mix<br>
for larger compositional structures using multiple instruments and Bill had replied...<br>
<br>
&quot;If you want to concatenate several with-sounds into one,<br>
just concatenate the instrument calls, with some variable<br>
holding the section's start time.&quot;<br>
<br>
I tried several ways to concatenate definstrument calls and place those with the<br>
body of with-sound, but nothing seems to work.&nbsp; It seems like ws.scm just wants<br>
a direct call to a definstrument in the body part. &nbsp;<br>
<br>
I gave up and tried concatenating with-sound blocks instead, and it works after a fashion but the
<br>
creation of separate audio files means those still have to be stitched together at some point.<br>
At least this is getting closer to what I was after.<br>
<br>
<p>regards,</p>
<p>Jim</p>
<p><br>
</p>
<br>
(load &quot;/opt/snd-16/CM_patterns.scm&quot;)<br>
<br>
(define (round-off z n)<br>
&nbsp; (let ((power (expt 10 n)))<br>
&nbsp;&nbsp;&nbsp; (/ (round (* power z)) power)))<br>
<br>
(definstrument (examp1 start-time duration frequency amplitude)<br>
(let* ((beg (seconds-&gt;samples start-time))<br>
(end (&#43; beg (seconds-&gt;samples duration)))<br>
(sine-wave (make-oscil :frequency frequency)))<br>
(do ((i beg (&#43; i 1)))<br>
((= i end))<br>
(let ((x (* amplitude (oscil sine-wave))))<br>
(outa i x)<br>
(outb i x)))))<br>
<br>
(definstrument (examp2 start-time duration frequency amplitude)<br>
(let* ((beg (seconds-&gt;samples start-time))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (end (&#43; beg (seconds-&gt;samples duration)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (gen (make-polywave :frequency frequency :partials '(1 1.69 3 5))))<br>
(do ((i beg (&#43; i 1)))<br>
&nbsp;&nbsp;&nbsp; ((= i end))<br>
(let ((x (* amplitude (polywave gen))))<br>
(outa i x)<br>
(outb i x) ))))<br>
<br>
(let ((var '())<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (aaa (make-heap '(360 800.345 1200 600))) ;freq<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (bbb (make-cycle '(1 1 .75 .25 .20 .15 .10 .10 .10 .10))) ;dur<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ccc (make-heap '(241 840.345 1000 960 500))) ;freq<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ddd (make-cycle '(.2 1.25 .75 .25 .20 .15 .10 .10 .50 .10 .50))) ;dur<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br>
&nbsp;&nbsp;&nbsp;&nbsp; (set! var (cons<br>
(with-sound (:reverb nrev :output &quot;Test1.wav&quot; :srate 48000 :channels 2&nbsp; &nbsp;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :header-type mus-riff :statistics #t :play #t)<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; (let ((i 0))<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (do ((k 0 (&#43; k 1))) &nbsp;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((&gt;= k 25))<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (let ((v (next bbb)))<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (examp1 i v (next aaa) .3)<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;(set! i (&#43; (round-off i 2) v))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ))))&nbsp; ;;end of with-sound<br>
(with-sound (:output &quot;Test2.wav&quot; :srate 48000 :channels 2 &nbsp;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :header-type mus-riff :statistics #t :play #t)<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; (let ((j 1))<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (do ((k 0 (&#43; k 1))) &nbsp;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((&gt;= k 25))<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (let ((v (next ddd)))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (examp2 j v (next ccc) .1)<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;(set! j (&#43; (round-off j 2) v))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ))))&nbsp; ;;end of with-sound<br>
) ;end var<br>
) ;end set!<br>
&nbsp; var<br>
&nbsp; ) ;end let<br>
<br>
</div>
</body>
</html>