[CM] set! samples

James Hearon j_hearon at hotmail.com
Tue Jun 19 11:02:31 PDT 2018


Hi,
I get a crash that I cannot seem to understand with the following code.  In the do loop when I set the test to (= i 40400) I get a squarish-wave in the editor; but when I set it to 40500 or above  I get an endless loop and a crash.

I was trying to create a 2 sec. test.snd, then write the samples to the editor to fill out the 2 sec. or 44100 samples if sr is 22050, but I must be doing something wrong.


(set! *clm-srate* 22050)

      (let* ((dur (* *clm-srate* 2))
            (ind (new-sound "test.snd" 1 *clm-srate* mus-ldouble mus-riff :size dur))
            (v1 (make-float-vector 100 .75))
            (v2 (make-float-vector 98 -.5))
            )
          (do ((i 0 (+ i 200)))
              ((= i 40400))  ;xxx 40400 works, but 40500 crashes
           (set! (samples i (+ i 100)) v1)
           (set! (samples (+ i 101) (+ i 199)) v2)
          )
        )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20180619/9abfc7c8/attachment.html>


More information about the Cmdist mailing list