home/ atoms/ sc-patterns-pbindef-modification

Pbindef modifies individual keys of a running Pbind without restarting the stream

While Pdef replaces an entire Pbind pattern on re-evaluation, Pbindef allows changing individual keys of a named Pbind without affecting the others. Pbindef(\name, \key, newValue) updates only that key, leaving all other keys unchanged in the running stream. This is the most surgical live-editing approach — useful when one parameter needs to change but the overall rhythmic structure should persist. Pbindef is a special case of Pdef; both maintain state across re-evaluations. To remove a key from a Pbindef, set it to nil.

Examples

Pbindef(\seq, \freq, 440); // change only freq while seq keeps playing Pbindef(\seq, \amp, 0.5); // change only amp Pbindef(\seq, \freq, nil); // revert freq to Pbind default

Assessment

You have a Pbind playing through Pdef. You want to change only the frequency pattern without restarting any other patterns. Should you use Pdef or Pbindef? Describe the difference.

“Pbindef, with an "ef" at the end instead of just "f." The latter is a live coding class, while the former, on the other hand, is an object that lets us add or modify key-values pairs in an existing Pb”
corpus · supercollider-tutorials-full-transcripts-and-code-eli-fields · chunk 113