On the definstrument, I think I'd write it: (definstrument (examp1 start-time duration frequency amplitude) (let* ((beg (seconds->samples start-time)) (end (+ beg (seconds->samples duration))) (sine-wave (make-oscil :frequency frequency))) (do ((i beg (+ i 1))) ((= i end)) (let ((x (* amplitude (oscil sine-wave)))) (outa i x) (outb i x)))))
In the original you're calling the same oscil twice, so you get a sinewave in each channel at twice the desired frequency. Also, once the srate is set in with-sound, you don't need to repeat it. (with-sound (:output "MyTest.wav" :srate 48000 :channels 2 :header-type mus-riff :statistics #t) (let ((i 0.0)) (for-each (lambda (b) (examp1 i 0.25 b 0.5) (set! i (+ i 1.0))) bbb))) The do loop in your example evaluates its body once and quits. _______________________________________________ Cmdist mailing list Cmdist@ccrma.stanford.edu https://cm-mail.stanford.edu/mailman/listinfo/cmdist