<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,<br>re: finding myself s7 challenged for CM_patterns.scm in Snd without Grace process, sprout etc.<br><br>I've kept digging with this and got something working, but it's not very pretty. It uses 'list-ref'<br>in with-sound (), but that could be improved, I'm sure.<br>Regards,<br>Jim<br><br><br>------------------<br>(load "snd/CM_patterns.scm")<br><br>(definstrument (examp1 start-time duration frequency amplitude sampling-rate)<br> (let* ((beg (floor (* start-time sampling-rate)))<br> (end (+ beg (floor (* duration sampling-rate))))<br> (sine-wave (make-oscil :frequency frequency)))<br> (do ((i beg (+ i 1)))<br> ((= i end))<br> (outa i (* amplitude (oscil sine-wave))) <br> (outb i (* amplitude (oscil sine-wave))) <br> )))<br><br> (define xxx '(160.0 600.345 1000.0 400))<br> (define aaa (make-heap xxx))<br> (define bbb (next aaa #t))<br><br>(with-sound (:output "MyTest.wav" :srate 48000 :channels 2<br> :header-type mus-riff :statistics #t)<br> (do (( i 0.0 (+ i 2.0))) <br> ((>= i 2.0)) <br> (examp1 0 0.25 (list-ref bbb 0) 0.5 48000)<br> (examp1 (+ i 1.0) 0.25 (list-ref bbb 2) 0.5 48000)<br> (examp1 (+ i 2.0) 0.25 (list-ref bbb 3) 0.5 48000)<br> (examp1 (+ i 3.0) 0.25 (list-ref bbb 1) 0.5 48000)<br> ))<br>                                            </div></body>
</html>