How do I make a "scrubbable" or "fastforwardable" Pattern using Pseed?

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.

(\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 =, release), t_gate, timeScale: dur, doneAction: 2);
	var sig = freq, mul: env);
	sig =, (freq*2).clip(20.0, 20000.0), rq.clip(0.0,1.0));
	sig =, pan);, sig * amp);

	~sed = Pseries(0, 1).asStream;
	~ita = Plprand(1.0, 2.0).asStream;
	thisThread.randSeed = 2378;
					degree: Pwhite(0, 7, 1).trace,
					octave: Pwhite(4, 6, 1).trace,
	( + exprand(1.0, 2.0)).postcs.wait;

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:

I’m including the link above as further hints for the kind of code style I am looking to preserve going forward.


Take a look at RandomOrbit (from the adclib quark) - it doesn’t capture entire events, but it’s an interesting spin on the repeatable/reversible behavior you are looking for.

1 Like

My senpai gave me this solution. It is exactly what I was looking for. I think it is best I post it here in case someone else might find use of it:

var seed = 2378;
thisThread.randSeed = seed;

~ita = Plprand(60.0, 180.0).asStream;

Routine { {arg i;
        Pdef(\x, Pseed(seed + i, Pbind(\n, Prand((0..10), inf).trace))).play;'ita');