how do you transform LFNoise to pattern logic?
LFNoise(0,1,2…) are simply generating interpolated random values, so I guess you could make use of the array interpolation methods included in the wslib quark:
// extend array of 5 random values between -1 and 1 to array of length 100
// using cubic (hermite) interpolation
(
var len = 5;
var frand2arr = { 1.0.rand2 } ! len;
frand2arr.resize(100, \hermite, false).plot;
)
{ LFNoise2.ar(500) }.plot(0.01); // for comparison
Here, the len
variable loosely corresponds to LFNoise’s rate
arg.
I don’t have time to figure out how to properly turn this into a pattern right now, but two tentative ideas on how you could do that:
- Wrap the array interpolation code in a
Pn(Plazy({...})
orPLx
patterns from miSCellaneous_lib.
// very hacky
(
Pbind(
\note, Pn(Plazy({
var len = 5;
var lfnArr = { 12.rand2 }.dup(len);
lfnArr = lfnArr.resize(100, \hermite);
Pseq(lfnArr);
})).trace,
\dur, 0.1
).play;
)
- Look at the implementation of
Pseg
and try to replace the instances ofEnv.at
with interpolated arrays and wslib’sintAt
method. You might want to read the Pattern Internals reference first, which has a lot of detailed information on how to write your own Patterns.
Forgot to add, there are a bunch of built-in pattern classes which generate random values, maybe they are already sufficient for your use case.
And here’s an interesting thread on handling continuous control changes in the pattern paradigm.