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

James Hearon j_hearon at hotmail.com
Fri Sep 7 10:13:09 PDT 2018

Thank you for that info.  I understand now where I was getting confused re: float-vector->channel and see I need to adjust the vector size as I go.  Clear now.

From: cmdist-bounces at ccrma.Stanford.EDU <cmdist-bounces at ccrma.Stanford.EDU> on behalf of cmdist-request at ccrma.Stanford.EDU <cmdist-request at ccrma.Stanford.EDU>
Sent: Thursday, September 6, 2018 7:00 PM
To: cmdist at ccrma.Stanford.EDU
Subject: Cmdist Digest, Vol 124, Issue 2

Send Cmdist mailing list submissions to
        cmdist at ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body 'help' to
        cmdist-request at ccrma.stanford.edu

You can reach the person managing the list at
        cmdist-owner at ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."

Today's Topics:

   1. env->channel, and float-vector->channel (James Hearon)
   2. Re: env->channel, and float-vector->channel
      (bil at ccrma.Stanford.EDU)


Message: 1
Date: Thu, 6 Sep 2018 17:51:00 +0000
From: James Hearon <j_hearon at hotmail.com>
To: "cmdist at ccrma.Stanford.EDU" <cmdist at ccrma.Stanford.EDU>
Subject: [CM] env->channel, and float-vector->channel
        <MWHPR1001MB2080A2E3510FF2BDF6232333E5010 at MWHPR1001MB2080.namprd10.prod.outlook.com>

Content-Type: text/plain; charset="iso-8859-1"

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!


(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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20180906/c3da40cd/attachment-0001.html>


Message: 2
Date: Thu, 06 Sep 2018 11:30:10 -0700
From: bil at ccrma.Stanford.EDU
To: James Hearon <j_hearon at hotmail.com>
Cc: "cmdist at ccrma.Stanford.EDU" <cmdist at ccrma.Stanford.EDU>
Subject: Re: [CM] env->channel, and float-vector->channel
Message-ID: <b1f4d4784405be5bf9616895019b0491 at ccrma.stanford.edu>
Content-Type: text/plain; charset=US-ASCII; format=flowed

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 at ccrma.stanford.edu

End of Cmdist Digest, Vol 124, Issue 2

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20180907/752d0b09/attachment.html>

More information about the Cmdist mailing list