- Transitioning between patterns in static (not live coded) compositions is really really hard. It’s not straightforward have overlapping patterns where one fades on and another fades in for more than two parts. Something that is fairly trivial in a DAW.
This is also a big deal for me. Funny enough, I ended up using routines transition between different sections, changing the Pdefn
. Maybe it’s not the easiest way to do this but patterns had so many complications I just didn’t want to deal with them anymore.
~iterCount = 0;
~createGroups.();
~createSrcFaders.();
~createSynthFaders.();
~initGrps.();
~setSectionPdefn.(~s1_evnt.(expBuf: ~expBuf, exps: ~exps)); // Sets the Pdefns for the current section
~initProuts.(event: ~s1_evnt.(expBuf: ~expBuf, exps: ~exps));
~initPatterns = Routine({
var sectionDur, fltScl;
loop{
if(3 == ~iterCount) // The Pdefn for the next section have to be initalized at the previous iteration
{
~setSectionPdefn.(~s1b_evnt.(expBuf: ~expBuf, exps: ~exps));
~initProuts.(event: ~s1b_evnt.(expBuf: ~expBuf, exps: ~exps));
"Stage 1b".postln;
~atkVar.wait; // Wait until current iteration ends
};
if(4 == ~iterCount){ // Trigger the new Pbinds
~bell = ~bellTrigger.(event: ~s1b_evnt.(expBuf: ~expBuf, exps: ~exps), time: ~atkVar).play(quant:0);
~fluteScaleAcc = true;
~fltScl = ~fluteScaleTrigger.(~s1b_evnt.(expBuf: ~expBuf, exps: ~exps)).play(quant:0);
~fluteAccAcc = true;
~fltAcc = ~fluteAccTrigger.(~s1b_evnt.(expBuf: ~expBuf, exps: ~exps)).play(quant:0);
~glissAcc = true;
~gl = ~glissTrigger.(~s1b_evnt.(expBuf: ~expBuf, exps: ~exps)).play(quant:0);
~atkVar.wait;
};
0.1.wait;
};
});
I also wanted to set limited duration for some patterns and the duration had to change at every iteration. I found Pfindur
and I though, “well, yeah that’s nice” until I discovered I cannot put Pseq
as a findur
. So my work around was to have a function to generate a Pfindur
at each iteration like this:
~fluteAccP = {
arg findur = ~atkVar;
["findur",findur].postln;
Pfindur(findur,
Pbind(
\instrument, \fluteAcc_waveguide,
\freq, Pdefn(\fluteAccFreq),
//\strum, 1,
\dur, Pdefn(\fluteAccDur),
\time, Pdefn(\fluteAccTime),//Pwhite(2.0, 4.0),
\ibreath, Pdefn(\fluteAccBreath),
\amp, 0.4,
\dBamp, 0,
\out, ~fluteAccBus,
\group, Pdefn(\fluteAccGrp),
);
)};
And I have another function to trigger those functions at each iteration:
~fluteAccTrigger = {
arg event, time = ~atkVar;
var flAcc;
Prout({
loop{
~atkVar.postln;
if(~fluteAccAcc)
{
Pdefn(\fluteAccDur, ~accel.(time: time, x: event[\fluteAccx], startHi: event[\fluteAccstartHi], startLo: event[\fluteAccstartLo]));
flAcc = ~fluteAccP.(~atkVar).play;
//"Acc ON".postln;
}
{Pdefn(\fluteAccDur, event[\fluteAccDur]);
flAcc = ~fluteAccP.(~atkVar).play;
};
~atkVar.wait;
flAcc.stop;
}});
};
Did you see what happened there? I ended up using a Prout
! Does this approach count as using patterns? On the outside yes. But I feel like I ended up using a routine after all, to do all of this and I could just use a routine instead, from the beginning and maybe it wouldn’t need so many functions. And if there was a way to do this with patterns in an easier way, I just couldn’t find it.