I’m trying to build a way to control, with patterns, a complex “playable object”, which is the sum of different synths played at different times.
If a regular PBind could be represented this way ( a synth replayed at each Pbind event):
And a Pmono like ( a synth played once, and modified at each Pmono event):
What I’m trying to do, is this:
a complex “playable object” that I could play on and on, and control like a Synth with a Pbind.
I’ve already taken one approach. It’s a kind Timeline and Nodes mechanism (the code is here).
And I would use like this:
~loop=StTimeline.new();
~n1=~loop.addNode(
StNode.new(name: "node1", start: 0,
action: {
~yellow=Synth.newPaused(\yellowSynth);
~green=Synth.newPaused(\greenSynth,addAction: 'addToTail');
~blue=Synth.newPaused(\blueFilter,addAction: 'addToTail');
~yellow.run;
}, actionArgs: [])
);
...
~n8=~loop.addNode(
StNode.new(name: "node8", dependOn: ~n7, start: 7.5,
action: {
~yellow.release;
~black.run;
}, actionArgs: [])
);
...
// build timeline control
(
~ready=Condition.new(false);
NotificationCenter.register(~n9,\done,this,{~ready.unhang;});
)
// play loop
(
~r={
~gate=1;
while({~gate>0},
{
// add some variations
~n8.start=5+4.0.rand2;
~n5.set(\freq,~n5.get(\freq)*1.5.rand2);
// play
~loop.play(TempoClock(1));
~ready.hang;
}
);
}.fork;
)
It’s working well.
It allows dependencies between nodes (StNode.new(dependOn: ~n7
), manually holding at some points (StNode.new(holdCondition:~hold2
), looping within the pattern (as a sampler would do: StNode.new(loopAt:~n3
), defining from which node the timeline should be retriggered (NotificationCenter.register(~n8,\done,this,{~ready.unhang;})
), …
But I miss the flexibility of the patterns, and their “neatness”, their concision.
So I’m here, wondering if I could achieve this “playable object” in some other ways in a pure Pattern style, or if I could introduce patterns in my current Timeline approach.
Any advice ?