-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Hi, long time since my last message. I hope everything is ok.
I have an array of Patchable called effects where each one is actually an effect (BasiVerb, VAFilter, etc). So it represents a "daisy chain" of effects.
I'm adding and removing effects on the fly and when adding I experiment random crashes. My guess is some method I'm using is not thread safe.
The code is pretty simple:
void AudioEffects::addEffect(EffectUI *newEffect)
{
effects.push_back(newEffect);
if ( effects.size() == 1 ) {
nodeIn0.disconnectOut();
nodeIn1.disconnectOut();
nodeOut0.disconnectIn();
nodeOut1.disconnectIn();
nodeIn0 >> effects[0]->channelOut(0) >> nodeOut0;
nodeIn1 >> effects[0]->channelOut(1) >> nodeOut1;
} else {
int last = effects.size() - 1;
effects[ last - 1 ]->disconnectOut();
nodeOut0.disconnectIn();
nodeOut1.disconnectIn();
effects[ last - 1 ]->channelOut(0) >> effects[ last ]->channelIn(0);
effects[ last - 1 ]->channelOut(1) >> effects[ last ]->channelIn(1);
effects[ last ]->channelOut(0) >> nodeOut0;
effects[ last ]->channelOut(1) >> nodeOut1;
}
}
nodeIn0 and nodeIn1 are just PatchNodes.
AudioEffects is also a Patchable and is part of a larger pipeline that includes two Samplers and multiple Amps
I've tried:
- unpatching everything and then patching again
- stopping audio engine and restarting. This prevent crashes but has two issues: a short hiccup and JACK being disconnected and connected causing manually set "virtual cables" to not reconnect.
I hope you can point me in the right direction, thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels