Re: [CM] env->channel, and float-vector->channel

2018-09-06 Thread bil

You're talking about the length of each blip?  In the
env-channel case, the vector is treated as an envelope
and applied to .015 seconds of samples, but in the
float-vector->channel case, the vector itself is simply
copied into the file.  It only has 8 samples, so in the
float-vector->channel case, the blips are 8 samples wide,
rather than .015 * 48000 = 720 samples.

(By the way, I think you don't need the insert-silence
statement -- it just adds 48000 samples to the overall
file length).

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist



[CM] env->channel, and float-vector->channel

2018-09-06 Thread James Hearon
Hi,
I'm having some confusion about successive edits using env->channel vs. 
float-vector->channel.  For example if I loop employing env-channel and a 
vector as an envelope, then I see the successive edits every 1k samples; but 
when I try to do that using float-vector->channel the spacing is squished.

Float-vector->channel works fine if I employ the vector as envelope across the 
whole snd., but I'm failing to understand how to employ it for successive 
back-to-back edits within the snd.

Thank you for Snd 18.7!

Regards,
Jim


(set! (mus-srate) 48000)

 (let*   ((mysize 8) ;size of vector for envelope pairs
 (fsize 48000) ;size of the snd
 (myvec (make-float-vector mysize))
 )
   (new-sound "test.snd" :size fsize)
(insert-silence 0 fsize)
 (map-channel (lambda (y) 0.5))

(float-vector-set! myvec 0 0.1);x1
(float-vector-set! myvec 1 0.5 );y1
(float-vector-set! myvec 2 0.5 );x2
(float-vector-set! myvec 3 1.0 );y2
(float-vector-set! myvec 4 0.75 );x3
(float-vector-set! myvec 5 -1.0 );y3
(float-vector-set! myvec 6 1.0 );x4
(float-vector-set! myvec 7 0.0 );y4

  (do ((i 0 (+ i 1000)))
((= i 24000))
(env-channel (make-env myvec :duration 0.015 :scaler 1.0) i 1000 0 0 )
;(float-vector->channel myvec i 1000 0) ;place float-vector in the editor ;XXX
))
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist