[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Re: Env loop indexes?



Ahhh... this is another bit of confusion based on the fact that the first element in the levels list is *not* a node... I'm going to submit a patch to the helpfile that clarifies that a bit.

I'd be interested to hear if there's a solution that doesn't require one sample of delay.

Thanks for the clarification!

Tom


On Thu, Dec 15, 2016 at 3:05 PM, Eli Fieldsteel <eli.fieldsteel@xxxxxxxxxx> wrote:
In your example, loop node refers to the starting value of the Env, or the
Env item with index zero (the number zero), and release node refers to the
Env item with index two (the value 0.5).

My understanding may not be perfect, so someone please correct me if I
misspeak -- Env "nodes" (not to be confused with Synth/Group Nodes on the
server) have three parameters: a shape, a target value, and a duration --
but *not* a starting value. When an Env moves to a new node, its starting
value is wherever it happens to be in that instant.

So, your Env reaches node 2, and loops back to node 0 -- which has a target
value of 1, and a duration of 1 (linear is the default, unspecified in your
example). So, over 1 second, we move linearly from 0.5 to 1 over 1 second.
Then we progress forward by one node, moving from 1 to 0.5 over 1 second --
then we loop again, etc.

I don't know whether this is the *best* solution, but as a quick solution
you can build in an extra node with a zero value and duration (note that a
zero duration is not actually zero seconds, rather it's the duration of one
sample -- so synchronization problems may occur with multiple envelopes):

play { | gate=1 |
   var env = Env([0,0,1,0.5,1,0], [0,1,1,1,1], releaseNode: 2, loopNode: 0);
   env = EnvGen.ar(env, gate);
   SinOsc.ar * env
};

Eli



--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Env-loop-indexes-tp7629529p7629532.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/