Use this class to receive sync and have SuperCollider act as a slave.
AudioMulch is a program written by Ross Bencina. http://www.audiomulch.com/
AudioMulchClock is a SuperCollider class for synchronising playback with this program via network sync.
This clock has no notion of time in seconds. Rather time advances in ticks and each incoming network sync message includes a tick counter. There are 24 ticks per beat and 96 per bar (assuming 4/4 - change beatsPerBar to use something different).
A tick is roughly 1/24 seconds long at tempo 60bpm. Though network jitter will add and subtract to this value.
Sub tick accurate scheduling (precision lower than 1/24th of a beat) is also possible.
In AudioMulch's preference panel under the Network Sync tab, set the Send to address to 127.0.0.1 and the corresponding UDP Port to 57120. Activate Generate Network Sync under the Control meny.
Pbind legato does not behave correctly - scale it with beat duration.
Creates a new clock.
Returns the default clock. It is created the first time you try to access it and is permanent.
Schedules a function to be evaluated at some future beat - usually the next beat or next 4 beats (bar).
task |
A Function. The function is passed tick, time and clock as first three arguments. |
quant |
1 plays on the next beat, 4 on the next bar etc. Also fractions of beats are possible. |
Schedules a function to be evaluated at a certain tick.
tick |
Use |
item |
A Function. The function is passed tick, time and clock as first three arguments. If the function returns a number, it will be rescheduled in that amount of beats (yes, not ticks). |
Schedules a function to be evaluated at some future beat.
delta |
1 here means the next upcoming beat. Also fractions of beats are possible as well as sub tick accuracy (1<24th of a beat). |
item |
A Function. The function is passed tick, time and clock as first three arguments. If the function returns a number, it will be rescheduled in that amount of beats. |
Used for finding out at which tick in the future the next beat or bar will occur.
quant |
If 1 then return the tick for the next tick%24==0. If 4 then the tick for the next tick%96==0 etc. |
phase |
Adds to the quant. e.g. quant 4 and phase 2 will return the tick at the next bar + two beats. |
Stops the clock and removes all tasks from the scheduling queue.
Return the average beat duration in seconds.
Return the current beat.
A Boolean that is set when either a \t_start
or a \t_pulse
message is received. It is cleard when a \t_stop
message is received or the clock is cleared.
An Integer that counts up indefinitely.
An Integer specifying latency compensation in ticks. If negative items will be scheduled slightly early.
An Integer that should match the number of beats in a bar. Used when restarting after a \t_stop
.
A Boolean. If true then the clock will continue to run after a CmdPeriod. The user is responsible for clearing permanent clocks with the -clear method.
A Float that represents the average tempo in beats per minutes.
A Function that is evaluated when the external clock is started (a \t_start
is received).
A Function that is evaluated when the external clock is stopped (a \t_stop
is received).