| Newsgroups |
gmane.comp.audio.supercollider.user |
| Message-ID |
<CAFniQ7WpE8sqMC54QuHfpJ=kWmPtSpg9mkTrTyhK_papxZ2oFA@mail.gmail.com> |
On Wed, Mar 3, 2021 at 9:01 PM <[email protected]> wrote:
> is it safe to assume two UGens with the same name and arguments are the same?
If they are completely deterministic, I think so. SinOsc, yes. MouseX, no.
> Also, I've noticed the input-specs for EnvGens are crazy. ... it would be much easier if there was a reference somewhere...
I'm not aware of an English document about this, but the UGen input
order is written straightforwardly in EnvGen *new1:
*new1 { arg rate, gate, levelScale, levelBias, timeScale,
doneAction, envArray;
^super.new.rate_(rate).addToSynth.init([gate, levelScale,
levelBias, timeScale, doneAction]
++ envArray.dereference);
}
So let's check:
a = Env.adsr(0.01, 0.3, 0.5, 1.0);
a.array;
-> [ [ 0.0, 3, 2, -99, 1.0, 0.01, 5, -4.0, 0.5, 0.3, 5, -4.0, 0.0,
1.0, 5, -4.0 ] ]
^^ So those are the envelope contents: beginning level, number of
segments, releaseNode, loopNode, levels[1], times[0], shapeNum[0],
curveValue[0], levels[2], times[1], shapeNum[1], curveValue[1], etc.
to the end. These will be the last inputs to EnvGen (at the end,
because the EnvGen C code doesn't know how many segments there will
be).
b = { |gt = 1|
(SinOsc.ar(440, 0, 0.1)
* EnvGen.kr(a, gt, levelScale: 0.5, levelBias: -0.1,
timeScale: 1.5, doneAction: 2)
).dup
}.play;
b.trace;
unit 1 EnvGen
in 1 0.5 -0.1 1.5 2 0 3 2 -99 1 0.01 5 -4 0.5 0.3 5 -4 0 1 5 -4
out 0.15
b.release;
^^ And EnvGen is getting:
- 1 = gate
- 0.5 = levelScale
- -0.1 = levelBias
- 1.5 = timeScale
- 2 = doneAction (these are exactly in order from the *new1 array)
- 0, 3, 2, -99, 1, 0... the Env array
hjh
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/