Pseed confusion

Hello,

I have a confusion regarding Pseed, maybe the best is to show you by this example.
Here Pseed does what I expect, allowing me to repeat exactly the same pattern each time I change the seed number

(
p = Pbind(
    \degree, Pseed(10, Pseries({ rrand(-7, 0) }, Pwhite(1, 3, inf), { rrand(4, 10) })),
    \dur, 0.25
).play;
)

My problem is when I try to apply Pseed to Pseq, this is not working like above : new values are produced each time pseq repeat itslef, what would be the syntax allowing me to keep my values after changing the seed number :

(
//not working
p = Pbind(
	\degree, Pseed(10, Pseq([Pwhite(1, 10,1), Pwhite(1, 10, 1)],inf)),
	//or \degree, Pseed(10, Pseq(rrannd(1, 10),rrand(1, 10)],inf)),
    \dur, 0.25
).play;
)

I am sure this is super easy, sorry :slight_smile:

Thanks

Currently Pseed is running once, and the pattern inside it is running for a long time without releasing control back to Pseed.

I think this is probably what you want:

Pn(
    Pseed(
        10,
        Pseq([
            Pwhite(1, 10,1), 
            Pwhite(1, 10, 1)
        ], 1)  // note, *not* inf here
    ),
    inf  // but inf *outside* Pseed
)

hjh

Thanks a lot ! That’s it. Here it is applying to the degree params but would it be possible to use one single Pseed " id " to change all the random parameters of my Pbind at once ? I would like to avoid to change the Pseed number for each params after the other …

Thanks !

You should be able to achieve that by nesting your Pbind within Pseed.

Pn(
    Pseed(
        10,
        Pbind(....) // as noted, don't use inf inside of the Pbind, inf playback created by Pn
    ),
    inf 
)

Hi.

I do this kind of thing all the time:

(
SynthDef.new(\saw, {
    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, cutoff.clip(20.0, 20000.0), rq.clip(0.0,1.0));
    sig = Pan2.ar(sig, pan);
    Out.ar(out, sig * amp);
}).store;
)

(
Pdef(0,
    Pseed(1848, // This changes everything.
        Pbind(*[
            instrument: \saw,
            type: Prand([\note, \r], inf),
            dur: 1 / Pstutter(Phprand(5, 11), Phprand(5, 11)),
            release: Phprand(2, 20),
            octave: Pmeanrand(2, 5).round,
            scale: Scale.harmonicMinor.tuning_(Tuning.mean6),
            degree: Pwhite(0, 7),
            cutoff: Pexprand(200, 20000),
        ])
    )
).play
)

I hope I understood correctly and that is what you want.

1 Like