Hello everyone,
i have a Pbind that plays a synth and on some steps i want to add more complex modulation to an argument of the synth. My idea is to map the arg to a bus and play another synth on that bus that outputs the modulation i want.
I came up with an idea, using a Prout, that creates the bus and plays the modulation-synth inside the Pbind but it feels a bit laborious and im not able to free the bus properly. Also it feels strange to play another synth inside a Pbind.
(SynthDef.new(
\sin,
{
arg freq=4000, phase=0, amp=1, add=0, attack=0.02, release=0.5, curve=(-5), pan=(0), out=0;
var env, sig;
env = Env.perc(attack, release, amp, curve).ar(2);
sig = Mix.ar(SinOsc.ar(freq, phase*2pi, env, add));
sig = Pan2.ar(sig, pan);
Out.ar(out, sig);
}
).add)
(
Pbind(
\instrument, \sin,
\degree, Pseq([1,2,3,2,1,3,1,[1,3,5,7]],inf),
\dur, Pseq([Pn(1/4,6), 3/8, 1/8],inf),
\amp, 0.5,
\phase, Prout({
var bus;
bus=Bus.audio;
loop{
Synth(\sin,[
\out, bus, \freq, 100, \amp, 1,
\release, 2]);
bus.asMap.yield;
0.yield;
}
}),
).play)
I know that there is Pproto, which seems to be the right class for this task, but the documentation is missing examples for \audioBus, and i couldnt figure it out on my own.
Is there a better way of doing this?