FX Pedal Bus Management

Does anyone have a good solution for managing an FX chain with a pedalboard? I have a MIDI pedalboard that I have set up with 10 pedals.

I want the pedals to create or remove Synths when I press them. I have empty groups for each of the 10 effect synths so they always end up in the right order on the server. I want the signal flow to always go straight down the chain so I can just replace or remove the contents of each group/effect synth slot.
I need something to manage the buses though.

I really don’t want to reinvent the wheel and I’m guessing @jamshark’s ddwMixerChannel will work, but I’m a bit confused by the html help files and on top of this, the examples in the html files stopped working after I hit cmd-. They still don’t work after rebooting the server. Any suggestions for managing the effects synths?

EDIT: I did see an older post about using ddwMixerChannel for this, but it doesn’t help that it isn’t working and I don’t plan to reorder the synths. I may change the effects, but I don’t want to reorder anything.

I’m not sure you need to manage busses beyond just using Bus. If your program has variables, which it declares every time you run the code, pointing to allocated busses, won’t that be enough?

Sam

I don’t think so. Say the first private bus is 10. I send the first wet signal there when the first FX synth is instantiated, say it’s a distortion. The next synth is maybe a flanger and sends to bus 11. I don’t want to use the flanger, but the next synth is taking input from bus 11, which has nothing. So I’d need to make sure the buses were routed correctly, no? Or is there another way? or maybe I’m overthinking this and I can just keep using ReplaceOut?

Possibly, but I kinda think it’s not ideal for this use case. Better to keep going your other way.

“Isn’t working,” I can’t do anything about because it isn’t clear what you mean.

Often people intend “it isn’t working” as a shortcut for “I did action A, and expected result B, but got result C” but the shortcut omits A, B and C! So anyone reading it has a choice: guess, or ignore the question.

A: You ran an example / some examples in the (old html) help, and then hit cmd-period. Which example(s)?

B: Here I might guess that you expected effects to persist through cmd-dot.

C: And I’d guess they didn’t persist.

But maybe B and C are wrong guesses.

In any case: currently effects do not survive cmd-dot. I could think about how to change that – there may be good reason to keep the completionFunc around and rerun it when rebuilding the channel. There might also be some corner cases where auto-rebuilding effects could cause other problems.

I think, as a stopgap, with ServerTree, you could register a function like ~aMixer.doWhenReady { ... your fx here ... } – I’d agree that the redundant code isn’t ideal, just need to consider whether a completionFunc change would be ok.

But I also think you don’t really need MixerChannel for this.

hjh

If the order of the synths is always the same, and all you want to do is turn them on or off…

…then I’d design each synth to have an ‘amount’ control (a value between zero and one) that fades in the effect.
This way, it is easy to gradually turn on an effect, thereby avoiding clipping.

I’d build a function like this…

~effectOutputter = XOut.ar(\out.kr, \amount.kr(0).lag(0.2), _);

SynthDef(\someFx, {

	var sig = ... stuff;

	~effectOutputter.(sig);
}).add;

Then build the graph of all the synths and busses upfront (however you want), and just turn the amounts up or down when you trigger them.

Sometime supercollider encourages you to make these big complex dynamic structures, when want you really want is a simple static structure.

Yes, you’re right. This is what happened (although it is a bit of a digression):

(
//the example was pink noise through a filter, but I swapped this out
SynthDef("nz", {
	var sig = WhiteNoise.ar(\amp.kr(1.0));
    Out.ar(\outbus.kr(0), sig);
}).send(s);
)

(
    m = MixerChannel("nz", s); 
)

(
    a = m.play("nz");
)

Server tree shows some stuff. Stuff makes sense. Computer speakers a meditative “pshhh”.

CMD-.

(
SynthDef("nz", {
	var sig = WhiteNoise.ar(\amp.kr(1.0));
    Out.ar(\outbus.kr(0), sig);
}).send(s);
)

(
    m = MixerChannel("nz", s); 
)

(
    a = m.play("nz");
)

Empty tree. No sound. I definitely want to use the quark for other projects, that’s why I ask, despite it being a digression.

@jordan @Sam_Pluta facepalm. I was totally overthinking this.

(
    b = Buffer.read(s, "/Users/josiahsytsma/Desktop/JS/Breaks/amen_01.wav");
)

(
    SynthDef(\test, {
        var sig = PlayBuf.ar(2, b, BufRateScale.kr(b), loop:1);
        Out.ar(\out.kr(0), sig);
    }).play;
)

(
 x = SynthDef("trem", {
    var out = \out.kr(0);
    var sig = In.ar(out, 2);
    var mod = LFTri.kr(8.0).unipolar;
    var env = Line.kr(0.0, 1.0, 0.05);
    sig = sig * mod;
    XOut.ar(out, env, sig);
}).play(addAction: \addToTail);
)

(
 y = SynthDef("filt", {
    var out = \out.kr(0);
    var sig = In.ar(out, 2);
    var freq = MouseY.kr(20.0, 20000.0, 1);
    var rq = MouseX.kr(0.1, 1.0);
    var env = Line.kr(0.0, 1.0, 0.05);
    sig = BLowPass4.ar(sig, freq, rq);
    XOut.ar(out, env, sig);
}).play(addAction: \addToTail);
)

x.free;

If you have something more complex than a linear chain of effects, Ndef is a great option as it means you don’t have to think about the busses or ordering.

Ndef(\input, {
	PlayBuf.ar(2, b, BufRateScale.kr(b), loop:1);
});

Ndef(\clean, {
	Ndef.ar(\input, 2) * \amount.kr(0, lag: 0.2)
});

Ndef(\trem, {
	var sig = Ndef.ar(\input, 2); // read 2 channels from \input
	var mod = LFTri.kr(8.0).unipolar;
	sig * mod * \amount.kr(0, lag: 0.2);
});

Ndef(\reverb, {
	var sig = Ndef.ar(\clean, 2) + Ndef.ar(\trem, 2);
	...stuff...
});

Ndef(\trem).set(\amount, 1);

Hmm. The mixer channel should be rebuilt after cmd-. but not the noise synth. If the tree is completely empty, there’s a bug somewhere. But I’m coming down from 12 hours in the office today so I’ll have to check it later.

Thanks for letting me know something might be amiss.

hjh

FWIW – I cannot reproduce this problem. On my system, MixerChannels continue to function after cmd-dot.

Maybe you have an extension that is interfering with normal CmdPeriod behavior?

hjh

Must be. I’ll go through and see what I have. Thanks James!