Dan Stowell
Dan Stowell

Reputation: 4758

SuperCollider patterns library: how to get a reference to the synths' nodeIDs?

Patterns library question: How can I get a reference to the Synth that is created by a Pbind? For instance,

Pbind( \type, myCustomSynthDef, \midinote, Pseq([60, 62, 64], inf), \dur, 0.5 ).play

gets me a repeating do-re-mi sequence. If I'd like to change some modulation parameter on the synth that plays 're', how can I get that synth's nodeID into a variable?

Upvotes: 0

Views: 304

Answers (1)

Dan Stowell
Dan Stowell

Reputation: 4758

To control the "re" synth, you would normally put some extra parameters into the Pbind and then simply use them in the synth, e.g. add

\craziness, Pseq([0, 100, 0], inf)

to your Pdef, and add something in your SynthDef to use it.

If you really really want to know the nodeID (bleh, not pleasant) then you don't use Pattern.play. I guess you could iterate the pattern manually (e.g. using .next) and manually call .play on each Event in that iteration. When you call the Event's .play it returns an Event that has the node ID inside, stored in the id key.

Upvotes: 0

Related Questions