[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Can MixerChannel and PbindFX play nicely together?




Hi again,

I did some quick tests and everything seems to work straightforward. Define the out arg within PbindFx, then the processed audio is finally routed to that bus.

You can use classes together also with the concvenience method MIxerChannel.play. However you should rethink your example, if you're only taking one reverb with same settings then PbindFx is kind of waste and you should rather play to a dedicated fx bus

// test FX SynthDef
(
SynthDef(\freeverb, { |out, in, damp(0.1), room(0.95), amp(1), mix(1)|
var signal, rvb;
signal = In.ar(in, 2);
rvb = FreeVerb.ar(signal, mix, room, damp, amp);
signal = signal + rvb;
Out.ar(out, signal);
}).add;
)

// the mixer channel
m = MixerChannel("test1", s, 2, 2, 1);

// take new reverb synth with same params for *every* reverb event, they overlap in this case
// wasteful, but working 
(
// the sequence
p = PbindFx([
\instrument, \default, // use default Synth for test
\dur, 0.25,
\amp, 0.2,
// reverb only for high note
\midinote, Pseq([60, 67, 70, Pwhite(80.0, 90, 1)], inf),
\fxOrder, Pseq([0, 0, 0, 1], inf),
\out, m.inbus.index, 
\cleanupDelay, 0.1
],[
\fx, \freeverb,
\amp, 1,
\damp, 0.1,
\room, 0.99,
\mix, 1,
\cleanupDelay, Pkey(\room) * 9
]
);

// play sequence through a mixer channel
x = m.play(p);
)

m.level_(0.2)
// here PbindFx makes more sense, different reverbs overlap
(
// the sequence
p = PbindFx([
\instrument, \default, // use default Synth for test
\dur, 0.25,
\amp, 0.2,
// reverb only for high note
\midinote, Pseq([60, 67, 70, Pwhite(80.0, 90, 1)], inf),
\fxOrder, Pseq([0, 0, 0, 1], inf),
\out, m.inbus.index, 
\cleanupDelay, 0.1
],[
\fx, \freeverb,
\amp, 1,
\damp, Prand([0, 0.5, 1], inf),
\room, Pseq([0.99, 0.5, 0.3, 0.1], inf),
\mix, 1,
\cleanupDelay, Pkey(\room) * 9
]
);

// play sequence through a mixer channel
x = m.play(p);
)
Also note that with long reverbs a lot of buses is needed, you might have to boost resources as described in PbindFx help:

// boot server with extended resources, e.g.

(
s.options.numPrivateAudioBusChannels = 1024;
s.options.memSize = 8192 * 16;
s.reboot;
)


Greetings

Daniel

----------------------------------------------------
http://daniel-mayer.at/software_en.htm
----------------------------------------------------