Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sum channels to avoid premature pause #298

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

redFrik
Copy link

@redFrik redFrik commented Dec 3, 2023

summing the sound channels (after rectification) makes sure that there's only a single DetectSilence and that no channel can pause the node prematurely.

this is a fix for a subtle bug in DirtPause. fixing it shouldn't affect sound except in some very rare corner cases. and then one would want the fix applied anyways i guess.

issue demonstrated here using rms but same problem can be found in all places where DirtPause is used. e.g. reverbs stopping early.

SuperDirt.start;
~d1 = ~dirt.orbits[0];
~dirt.startSendRMS;

//with default graceTime 4 the following should finish around 9
//i.e. dirt_rms node pauses itself and stop sending messages
(
var start= Main.elapsedTime;
OSCdef(\rms, {|msg, time| (time-start).postln}, "/rms");
~d1.((sound: 'tutorial2', dur: 5, pan: 0.5));
)


//same code panned hard right.
//note: it will finish early - around 8!
(
var start= Main.elapsedTime;
OSCdef(\rms, {|msg, time| (time-start).postln}, "/rms");
~d1.((sound: 'tutorial2', dur: 5, pan: 1));
)

the silent left channel stopped dirt_rms node sending 1sec early.
with the proposed fix the two examples both hold the full duration.

summing the sound channels (after rectification) makes sure that there's only a single DetectSilence and that no channel can pause node prematurely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant