Seq of Patterns || Newbie question

Hello everyone,
I kindly ask you, if for you this is a good way of making Phrases or if you suggest another approach.
As far as i’m concerned I find it quite flexible because I can edit the values in the Pbindef, while I’m working on the phrase, but I don’t know if this is the right way of making phrases or if it’s better to stick with the guide, specifically here:

https://doc.sccode.org/Tutorials/A-Practical-Guide/PG_04_Words_to_Phrases.html
https://doc.sccode.org/Tutorials/A-Practical-Guide/PG_Cookbook06_Phrase_Network.html

In other words … have I to use Pfsm - Finite State Machine?

// group of half
(
Pbindef(\grphalf,
	\instrument, \DcOuts,
	\bus,Pseq([(0…2),(3…5)],inf),
	\dur, Pseq((1/8!3),1)
);

//  on - off  
Pbindef(\oneononeoff,
	\instrument, \DcOuts,
	\bus, Pseq([[0,2,4]],1),
	\dur, Pseq([1/12],inf),
);

Pbindef(\tutti,
	\instrument, \DcOuts,
	\bus,Pseq([(0…5)],inf),
	\dur, Pseq([1],2)
);
)

Pdef(\play, Psym(Pseq([\grphalf, \oneononeoff, \tutti], inf).trace)).play;

Really thanks !

Should be OK as far as I can see.

hjh

1 Like

Just a note: this sequence of patterns will run on one and the same clock, which is Pdef(\play)'s clock, or the one you give to .play().

If you want a sequence of Pdefs, each on its own clock, I didn’t find any other way than forking a routine and waiting for each player to finish:

{
    var cond = Condition();
    [\a,\b].do{|n|
        var ctrl;
        Pdef(n).play;
        ctrl = SimpleController(Pdef(n).player);
        ctrl.put(\stopped){
            cond.unhang;
        };
        cond.hang;
        ctrl.remove;
    }
}.fork

EDIT: changed to the correct way of removing dependencies in SimpleController - thanks @jamshark70!

1 Like

You know me :slight_smile:

thanks a lot like always!

Sure, I hadn’t thought of separate clocks. But – remove the SimpleController by ctrl.removeremoveAt does not release the dependency.

hjh

2 Likes