hey, im currently putting some stuff together and using L-System Abstractions stored in ~absDict together with PSPdiv for creating Rhythms and would like to know a good way for organizing the code for a Live Coding Situation. i think beside the current pattern i would like to add 1-2 additional layers to create polyrythmic textures and 1-2 Fx with PbindFx and already looked at the PSPdiv helpfile for doing this. I mean in terms of Tasks, Enviroments, shared Envelopes, Pspawner, Pbindef vs. Pdef, the global structure to have full and easy acces to all the parameters. Im also running in a bit of CPU overload with 1-2 layers of FFT/Granular SynthDefs with rapid pulses. Any ideas? thanks
(
Pdef(\pv_BinBufRd,
Pbind(
\type, \hasEnv,
\instrument, \pv_BinBufRd,
\recBufs, ~buffers[\laser][11][\pvRecBuf],
\soundBuf, ~buffers[\laser][11][\sndBuf],
\posLo, 0.01,
\posHi, 0.99,
\posRateE, 0,
\posRateM, 1,
\trigRate, 1,
\overlap, 7,
\loBin, Pseq([Pseries(0,1,26)],inf),
\hiBin, 12,
\panMax, 0.80,
\legato, Pseq([Pseries(0.75,0.01,26)],inf),
\posRate, Pseq([Pseries(1,-0.01,26).midiratio],inf),
\atk, Pwhite(0.01,0.03,inf), // between 0 and 1
\sus, (1 - Pkey(\atk)) * Pexprand(0.35,0.50,inf), // between 0 and 1
\gainEnv, Pfunc{|e|
var rel = (1 - e.atk - e.sus);
var c1 = exprand(2,6);
var c2 = exprand(-2,-6);
Env([0,1,1,0],[e.atk, e.sus, rel],[c1,0,c2])
},
\amp, 0.15,
\finish, ~utils[\hasEnv],
\cleanupDelay, Pkey(\dur) * Pkey(\legato),
\fxOrder, [1]
);
);
// default values for PL proxies, want to replace later on
~durIndex = 5;
~pulse = Pn(Plazy {|event|
Pseq(~absDict.at(~durIndex), 1)
},inf);
~div = [
PLshufn([1, 2],1),
PLshufn([2, 3],1),
PLshufn([4, 3],1),
PLshufn([5, 3],1)
];
~divSeries = PLseq((0..3));
~divBase = 1;
~divType = \seq;
u = PSPdiv(
PL(\pulse).trace,
Pdef(\pv_BinBufRd),
Pn(Plazy{ PLswitch(\div, \divSeries)},inf).trace,
PL(\divBase),
PL(\divType)
);
)
// start
x = u.play(t, quant:1);
// Update Pattern
(
~divSeries = PLseq((0..1));
~durIndex = 0;
)