SuperCollider CLASSES


synchronise and limit pattern duration


Psync behaves somewhat like Pfindur -- it has a maxdur argument that limits the total duration of the event stream.

The difference is in what happens if the event pattern stops on its own before maxdur is reached. If the total duration of the event pattern is shorter than the given maximum duration:

Pbind's natural durationPfindur(16, Pbind(....)) behaviorPsync(Pbind(....), 4, 16) behavior
6 beatsPfindur plays only 6 beatsPsync rounds up to 8 beats (adds a two-beat rest)
18 beatsPfindur cuts off after 16 beatsPsync cuts off after 16 beats

maxdur may be omitted. If the Pbind stops by itself, the rest will be inserted according to quant, but the total duration will be unlimited.

Class Methods

*new (pattern, quant, maxdur, tolerance: 0.001)



a pattern that returns events.


rounding factor for total duration (effectively a "bar length")


maximum duration


difference threshhold that a pattern must exceed max to be ended.

Inherited class methods

Instance Methods

Inherited instance methods

Undocumented instance methods

-embedInStream (event)


-maxdur = value


-quant = value


-tolerance = value


    { arg out=0, freq=440, sustain=0.05, pan;
        var env;
        env =, sustain, 0.3), doneAction:2);,, 0, env), pan))

// a fixed duration pattern:

f = Pbind(
    \dur, 0.5,
    \degree, Pn(4,1),
    \instrument, \help_sinegrain

// this pattern has indetermined length:
a = Prand([
        \dur, Pseq([0.02, 0.002, 0.1, 0.1],2),
        \degree, Pseq([9, 7, 5],inf),
        \instrument, \help_sinegrain
        \dur, Pseq([1, 0.35],2),
        \degree, Pseq([0, [2b,5b]],inf),
        \instrument, \help_sinegrain
        \dur, Pseq([0.15, 0.25, 1.3],2),
        \degree, Pseq([2b,4,5b],inf),
        \instrument, \help_sinegrain

Pseq([f, f, a, a], inf).play; // play a sequence

// Psync allows to limit the duration of a stream relative to a beat grid

b = Psync(a, 1, 1); // create a sequence of exactly 1 beat elements
Pseq([f, f, b, b], inf).play;

b = Psync(a, 1, 2); // create a sequence of elements of either 1 or 2 beats length
Pseq([f, f, b, b], inf).play;

b = Psync(a, 2);    // create a sequence of elements with a minimum of 2 beats,
            // but with undetermined upper limit
    Pseq([f, f, b, b], inf), // sequence
    Pbind(\instrument, \help_sinegrain, \freq, 1000, \sustain, 0.01, \dur, 2) // metronome