im still trying to find a way to understand whats happening here. its giving me sleepless nights.
why is it not possible to chain the Pmono(\bass)
with the ~bassData
function in the example above? this would solve all the problems for multiple Event Patterns inside PSPdiv. as i understand it the \dur
values inside the function ~bassData
are calculated from pulse, div and divBase inside Pspawner
wrapper class PSPdiv
and then passed as arguments to the function ~bassData
.
If this is really not working is there another way to have one “master pulse” Pbind where its index only advances on phrase boundaries like described here:
which is then chained to several Pbinds which do their math to the master pulse for \dur
(divide the pulse and multiply by Pbjorklund2, to have one master pulse equally divided by hits and divisions) and then chain these Pbinds
to their specific Pmonos
?
im not sure if this is working correctly:
EDIT: (its not, the master pulse is going faster when divided by a specific number in the subpatterns).
(
~index = Pn(Pseq([0,1], inf)).asStream.trace(prefix: "measure index: ");
Pdef(\pulse,
Pdup(2,
Pn(Pbind(
\dur, Pdict(~patDict, Pfin(1, PL(\index))).trace,
), inf)
).asStream
);
// bass
~numberOfHits_bass = 3;
~div_bass = 4;
// sine
~numberOfHits_sine = 5;
~div_sine = 6;
Pdef(\bass,
Pbind(
\dur, Pkey(\dur) / ~div_bass * Pbjorklund2(
k: Pseq([~numberOfHits_bass.clip(0, ~div_bass)]),
n: Pseq([~div_bass])
),
\degree, 3,
) <> Pdef(\pulse);
);
Pdef(\sine,
Pbind(
\dur, Pkey(\dur) / ~div_sine * Pbjorklund2(
k: Pseq([~numberOfHits_bass.clip(0, ~div_sine)]),
n: Pseq([~div_sine])
),
\degree, 5,
) <> Pdef(\pulse);
);
)
Pdef(\player, Ppar([Pdef(\bass), Pdef(\sine)], inf)).play;