hey,
i have been using PmonoArtic with Pfindur inside Pspawner for scheduling events so far and have to restructure the setup to Synth + Pbind with Event \type \set
instead because of some detailed reasons.
The PmonoArtic, Pfindur inside Pspawner Setup would look like this:
(
SynthDef(\pluck, {
var trig = \trig.tr(1);
var lfoRate = \lfoRate.kr(1);
var sig, lfo;
lfo = LFSaw.ar(lfoRate * (1 + (LFNoise2.kr(lfoRate) * 0.5)));
sig = SinOsc.ar(lfo.linexp(-1, 1, 100, 8000)) + SinOsc.ar(lfo.linexp(-1, 1, 1000, 4000));
sig = Pluck.ar(sig, trig, 0.1, \freq.kr(50).reciprocal, \dec.kr(0.1), \coef.kr(0.5));
sig = sig * \amp.kr(0.25);
Out.ar(\out.kr(0), sig);
}).add;
)
t = TempoClock.new(60/60).permanent_(true);
(
Pdef(\pluckL,
PmonoArtic(\pluck,
\legato, 1.0,
\dur, 1/12,
\freq, 125,
\dec, 0.2,
\coef, 0.5,
\lfoRate, 0.3,
\amp, 0.125,
\out, 0,
)
);
Pdef(\pluckR,
PmonoArtic(\pluck,
\legato, 1.0,
\dur, 1/12,
\freq, 130,
\dec, 0.3,
\coef, 0.5,
\lfoRate, 0.2,
\amp, 0.125,
\out, 1,
)
);
Pdef(\player,
Pspawner({ |sp|
sp.par(Pfindur(12, Pdef(\pluckR)));
sp.seq(Pfindur(12, Pdef(\pluckL)));
sp.wait(12);
sp.suspendAll;
})
).play(t, quant:1);
)
Here is the attempt to use Synth + Pbind with Event \type \set
(
Tdef(\task,
l = Synth(\pluck, [
\freq, 125,
\dec, 0.2,
\coef, 0.5,
\lfoRate, 0.3,
\amp, 0,
\out, 0
]);
r = Synth(\pluck, [
\freq, 130,
\dec, 0.3,
\coef, 0.5,
\lfoRate, 0.2,
\amp, 0,
\out, 1,
]);
);
Pdef(\pluckL,
Pbind(
\type, \set,
\id, l.nodeID,
\instrument, \pluck,
\args, 0,
\dur, 1/12,
\freq, 125,
\dec, 0.3,
\coef, 0.5,
\lfoRate, 0.3,
\amp, 0.1,
\out, 0,
));
Pdef(\pluckR,
Pbind(
\type, \set,
\id, r.nodeID,
\instrument, \pluck,
\args, 0,
\dur, 1/12,
\freq, 130,
\dec, 0.3,
\coef, 0.5,
\lfoRate, 0.2,
\amp, 0.1,
\out, 1,
));
Pdef(\player,
Pspawner({ |sp|
Tdef(\task);
sp.par(Pfindur(12, Pdef(\pluckR)));
sp.seq(Pfindur(12, Pdef(\pluckL)));
sp.wait(12);
sp.suspendAll;
})
).play(t, quant:1);
)
1.) How can i make the Synth and the Pbind with Event \type \set
run in sync? I was trying to use Tdef
or a Routine
. At the moment they are not running in sync, you can hear that when evaluating the code. the pitch always starts differently compared to the PmonoArtic approach.
2.) when using Pfindur i can easily end the streams. when now using the Synth + Event \type \set approach you also have to start and stop the Synth individually (which is intended). how would you go about that in the Pspawner setup below? so the synth starts and stops exactly at the same time the Pfindur does.
3.) Im also not sure how to go about the arguments. I think the Synth doesnt need any arguments at all. it should pick up all the arguments from the Pbind and just make sure the Stream will never die when im not telling it explicitly to do so.
thanks