If you're happy to schedule everything in seconds, and work any rhythmic representations out for yourself, you're set to go.

To get the current SystemClock time you can use this code:

Main.elapsedTime; //gives a time since the application started

And in scheduling schedAbs schedules with respect to an absolute time

(

SystemClock.schedAbs(Main.elapsedTime+1.0,//start at absolute system clock time now + 1 second

{

Synth(\bleep,

[ //passing in arguments to the Synth

\note, (#[0,2,4,5,7,9] + 48).choose,

\pan, 1.0.rand2

]

);

// random choice of repeat time:

[0.25,0.3,0.7,0.1].choose

})

)

In many cases you'd prefer to work relative to some tempo, (for instance, if you want to schedule events in terms of beats and measures)

SuperCollider measures tempi in beats per second (bps) rather than beats per minute, i.e

1 bps = 60 bpm

1.6666667 bps = 100 bpm

2 bps = 120 bpm

2.4 bps = 144 bpm

3 bps = 180 bpm

(multiply by 60 to go from bps to bpm, divide by 60 in the other direction)

For beat-based scheduling we use TempoClock:

(

var t;

t = TempoClock(2); // make a new tempoclock at tempo 120 bpm = 2 beats per second

t.schedAbs(0, { arg ... args;// start at absolute beat 0 immediately

args.postln;//post the input arguments to our event function

//(will post logical time in beats, elapsed time

//in seconds of enclosing thread and this clock)

Synth(\bleep);// make a bleep

1.0// reschedules every beat

})

)

TempoClock is set up to react appropriately to changes of tempo and timesig.

There is an automatically available TempoClock

t= TempoClock.default;

You can ask a tempoclock where it is; this default clock might have been running for a long time already

t.elapsedBeats; //what exact logical beat time are we at

t.bar;//which bar are we in (default assumption is 4/4)

t.elapsedBeats.ceil; //find next beat

t.elapsedBeats.floor; //find last beat

(

var t;

t = TempoClock.default;// the default TempoClock might have been running

// for a very long time already, so you should start at the next beat.

t.schedAbs(t.elapsedBeats.ceil, // start at next whole beat

{

Synth(\bleep, [\note, [36,40,43].choose, \pan, 1.0.rand2]);

[0.25,0.5,1.0, nil].wchoose([0.5,0.4,0.05,0.05]); //weighted choice// repeat at some number of beats from the array- nil means stop

})

)

[1,2,3,4].wchoose([0.8,0.1,0.07,0.03]); //wchoose allows a weighted choice of values in one array with respect to the weights in a second array (which must add up to 1 and there must be as many weights as items to pick from)

If you ask for a beat that has already occured, the scheduler will try to catch up with the queue of events as quickly as possible: