Hey y’all.
I feel like I’ve been bothering my friends with this question for years now so, I figured it’s time I take this here.
How do I make a “scrubbable” or “fastforwardable” Pattern using Pseed?
Roughly my idea here is that a listener has no way of distinguishing between a stream of values which were all derived from a single seed and, a stream of values which were all made using their own unique seed. So, I’d like to somehow increment the seed with each new event (I hope I’m using this word correctly) as the pattern moves forward. I think of an event as one bleep or bloop. A single sound that could be made up of a bunch of individual parameters. I made a little pattern thing to show where I’m at. My little pattern thing does not work as I would like it to work. The seed does not update. Pseed get’s stuck, just using the first number forever. I am including my failed attempt code for two reasons. The first is to show the general style and the feature set of the code that I’m hoping to be able to stick with even after this group huddle effort. The second is to show that I care a lot and that I tried my darndest here.
(
SynthDef.new(\default, {
arg dur, attack=0.01, release=1.0,
t_gate=1, out, freq=442, cutoff=5500,
rq=1, pan=0.0, amp=0.5;
var env = EnvGen.kr(Env.perc(attack, release), t_gate, timeScale: dur, doneAction: 2);
var sig = Saw.ar(freq: freq, mul: env);
sig = RLPF.ar(sig, (freq*2).clip(20.0, 20000.0), rq.clip(0.0,1.0));
sig = Pan2.ar(sig, pan);
Out.ar(out, sig * amp);
}).add;
)
(
Routine{
~sed = Pseries(0, 1).asStream;
~ita = Plprand(1.0, 2.0).asStream;
thisThread.randSeed = 2378;
Pdef(0,
Pfindur(1,
Pseed(Pfunc({~sed.next}),
Pbind(*[
degree: Pwhite(0, 7, 1).trace,
octave: Pwhite(4, 6, 1).trace,
])
)
)
).play;
(~ita.next + exprand(1.0, 2.0)).postcs.wait;
Pdef(0).reset;
}.loop.play;
)
Now, some of you are likely wondering; Why would anyone want this?
I make a lot of generative music which is also deterministic. I am fascinated and inspired by the conceptual framework and mindset that dealing with potential infinities opens me up to. In my work I am often sat down for long stretches waiting in realtime for events to unfold. Non-realtime is not an option for me because of reasons. Fastforwarding to the 15 minute mark into a generative piece would make my life easier. I’d also like to use this technique to combine different parts of different materials derived from different seeds.
Here is a link to audio, code and samples for the kind of music that I am making:
https://danielmkarlsson.com/log/
I’m including the link above as further hints for the kind of code style I am looking to preserve going forward.