ccrma / chuck

ChucK Music Programming Language
http://chuck.stanford.edu/
GNU General Public License v2.0
799 stars 127 forks source link

Global Gain UGen does not disconnect itself from a local UGen when a shred is removed. #413

Open eitomurakami opened 9 months ago

eitomurakami commented 9 months ago

Global Gain UGen does not seem to disconnect itself from a local UGen when a shred is removed.

Case1: local Gain => global Gain Result: Removing this shred and adding it again adds another layer of 440Hz sinusoid and results in clipping.

global Gain globalGain;
SinOsc osc => Gain localGain => globalGain => dac;

while(true)
{
    100::ms => now;
}

Case2: global Gain => local Gain Result: Removing this shred and adding it again safely results in a new 440Hz every time.

global Gain globalGain;
SinOsc osc => globalGain => Gain localGain => dac;

while(true)
{
    100::ms => now;
}

Tested on Windows 11 with miniAudicle. The same behavior can be observed in Chunity. (Chunreal currently uses dummy local Gains as in Case2).