GameOfLife / Unit-Lib

The Unit Library is a system that provides high level abstractions on top of the SuperCollider language.
25 stars 6 forks source link

fade curves not working properly #52

Closed woutersnoei closed 8 years ago

woutersnoei commented 9 years ago

I ran into problems with a previously saved file after the fade curves addition. With a non-release-self event of 6 seconds, with also a fadeOut time of 6 seconds it doesn't work and can even blow up. Have to invesigate further what and where exactly goes wrong, but I've disabled the line: 5, Dseq( [ fadeInCurve, 1, fadeOutCurve, 1 ], 1 ), for now in UEnv just to get the performance I'm doing to run properly, and it works as it should now (without actual sounding fade curves of course)..

miguel-negrao commented 9 years ago

Oh, very sorry about that. :-( I have been running that code for a while, with a couple of performances in between too, and never hit any problems... I will look at it asap.

A reproducer:

UScore(UChain(0,0,6, false, \sine,\stereoOutput).fadeOut_(6)).prepareAndStart

Hum, I don't think the problem is in DemandEnvGen but in the other Env, polling the gate parameter, with releaseSelf = false it's already 0 on the first block and this appears to be causing to free the synth immediately instead of doing the fadeout.

Env([ 1, 0, 0 ],[ fadeOut, extraSilence ], \lin, 0 ) .kr( doneAction, RunningMin.kr( gate.poll(label:"gate") ) + Impulse.kr(0) )

Commenting out the code above the synth will play fine. This is on sc3.7 dev.

So if the u_gate is already zero at start the synth will free immediately.

(
x = {
    WhiteNoise.ar(mul:0.01) *
    Env([ 1, 0, 0 ],[ 6, 0 ], \lin, 0 )
    .kr( 14, RunningMin.kr( \gate2.kr(0) ) + Impulse.kr(0) ).poll

}.play
)

In the synth above poll only posts once and the synth quits immediately. If I start the synth with \gate2 at 1 and then set it to 0 then it works fine, it does the fade out. Can you reproduce this in sc 3.5 also ? So if this is what is causing the problem, I wonder how is it that before it was working ?

I already spotted some unrelated mistakes in there (the Env doesn't have fadeCurves) that I can correct.

miguel-negrao commented 9 years ago

Rolling back to commit 2419ee9b988ebd1da6197de906220d79603630fc , before the fades were added I see the same issue (on sc 3.7). Are you sure this is related to the fade curves ?

woutersnoei commented 8 years ago

fixed a while ago