I have a pattern. Inside that patter i want \lag to depend on \delTime. \lag is inside the pbindData part. \delTime is inside the fxData part. So i have to share data between those parts.
(
var rate = 1;
~rimtry = PbindFx([
\instrument, \pBuf,
\rate, Pseq([rate.neg,rate,rate,rate,rate,rate],inf),
\buf, b.rimclick,
\dur, Pseq([1/16,3/16,3/16,1/16,4/16,4/16], inf),
\amp, 1,
\lag, PL(\delTime),
\stretch, 1,
\fxOrder, 1,
\cleanupDelay, 0.05
],
[
\fx, \flutter,
\flutFreq, Pseq([Pwhite(5e2, 8e2,1),Pwhite(2e3,2e3,3), Pwhite(5e2, 8e2,1)],inf),
\delTime, Pwhite(0.05,0.06),
\k, Pwhite(0.3,0.5),
\amp, 1,
\cleanupDelay, 2
]);
)
Here you can see ive tried with PL(\delTime) to share data. The result is silence. Replacing PL(\delTime) with a number, plays the pattern properly.
From what iv’e understood from the helpfiles is that PbindFx sort of treats its pbinddata and fxdata as two separate Pbinds(if there is only 1 effect). So i guess if i want to data share between pbinddata and fxdata, i need to do it the same way you’d do between two different Pbinds. I couldnt figure out how to access those two ‘indepent’ Pbinds of the PbindFx. So i made the pbinds beforehand separately, like the PbindFx helpfile describes.
(
var rate = 1;
~src = Pbind(
\instrument, \pBuf,
\rate, Pseq([rate.neg,rate,rate,rate,rate,rate],inf),
\buf, b.rimclick,
\dur, Pseq([1/16,3/16,3/16,1/16,4/16,4/16], inf),
\amp, 1,
\lag, 0.1, //need to get the delTime data here somehow
\stretch, 1,
\fxOrder, 1,
\cleanupDelay, 0.05
);
~fx1 = Pbind(
\fx, \flutter,
\flutFreq, Pseq([Pwhite(5e2, 8e2,1),Pwhite(2e3,2e3,3), Pwhite(5e2, 8e2,1)],inf),
\delTime, Pwhite(0.05,0.06),
\k, Pwhite(0.3,0.5),
\amp, 1,
\cleanupDelay, 2
);
~rimtry = PbindFx(PL(\src),PL(\fx1));
~rimtry.play;
)
However there is a problem.
This is an example from the helpfiles for sharing data between two different pbinds.
~bass = Pbind(
\degree, Pwhite(0, 7, inf),
\octave, 3, // down 2 octaves
\dur, Pwhite(1, 4, inf),
\legato, 1,
\amp, 0.2
).collect({ |event|
~lastBassEvent = event;
}).play(quant: Quant(quant: 1, timingOffset: 0.1));
Here some other pattern wants to get data from the ~bass pattern. You’d have to set the timingOffset of the Quant for this being able to happen.
The problem is that i cant do this because the PbindFx is played as a whole.
How do i share data between these two parts of the PbindFx.
Would someone please get me out of this hole, im trying to get on with my project, but something seemingly simple like this just prevents me from getting on.