[CM] Cmdist Digest, Vol 154, Issue 3

bil at ccrma.Stanford.EDU bil at ccrma.Stanford.EDU
Fri Mar 5 12:32:11 PST 2021


It says that because you are remaking the regs vector
on each iteration of the loop, but only setting the
i-th member.  Make the regs vector outside the do loop,
or in the do loop's variables, not in the inner let*:

(begin
    (do ((i 0 (+ i 1))
         (regs (make-vector 3)))
        ((= i 3))
    (let* ((g (gaussian-distribution 10.0))
          (mysamples (mus-sound-samples  "myfile.wav"))
          (myran 0.0)
          (regstart 0)
          (regend 0)
          (regdur 1000)
          (myreg 0)
          )
         (set! myran (any-random (abs 10.0) g))
         (set! regstart (round (* myran mysamples)))
         (set! regend (round (+ regstart regdur)))
    (vector-set! regs i (make-region regstart regend 0 1))
    (set! myreg (vector-ref regs 0))
    (insert-region myreg   0 0 1)
    )))



More information about the Cmdist mailing list