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

Re: [sc-users] envgen freeing synth immediatelly at synth start



Miguel,

I modified your code slightly to use a new group so as not to trash my server:

(
g = Group.new;
x = SynthDef(\test, {

        var env = Env([ 1, 0, 0 ],[ 6, 0 ], \lin );

        EnvGen.kr(env, \gate.kr(0), doneAction:14).poll

}).play(g);
)

Yes, the freeing of the Group by doneAction: 14 frees both group and synth.  I changed the \gate to \gate.kr(1) and that, as expected, ran the envelope down to to zero, where the poll stopped.

Not exactly sure what outcome you are trying to achieve with \gate.kr(0) but I can confirm that the behaviours between DoneAction 2 and 14 are quite different..  PlotTree confirms what's happening, as I'm sure you've checked. . .

Pete

On 15 December 2014 at 15:12, Miguel Negrão <miguel.negrao-lists@xxxxxxxxxxxxxxxxx> wrote:
On 10-12-2014 08:14, James Harkins wrote:
> At Tue, 09 Dec 2014 15:35:49 +0000,
> Miguel Negrão wrote:
>> I'm a bit confused by the following behaviour of EnvGen:
>>
>> (
>> x = SynthDef(\test, {
>>      var env = Env([ 1, 0, 0 ],[ 6, 0 ], \lin );
>>
>>      EnvGen.kr(env, \gate2.kr(0), doneAction:2).poll
>>
>> }).play
>> )
>>
>> this will post
>>
>> UGen(EnvGen): 1
>>
>> only once because the synth gets immediately freed.
>
> Likewise, not reproducible here. Have you modified EnvGen's class definition, or C++ code (LFUGens.cpp)?

Ok, copied the wrong bit of code, the bug is only happening with
doneAction = 14, so this is the code that causes it:

(
x = SynthDef(\test, {

        var env = Env([ 1, 0, 0 ],[ 6, 0 ], \lin );

        EnvGen.kr(env, \gate.kr(0), doneAction:14).poll

}).play
)

this will immediatlly free the synth. This doesn't happen on any other
doneAction numbers. Hopefully others can reproduce this one.

best,
Miguel