Tutorials/JITLib | JITLib > Tutorials | Tutorials > JITLib


Timing in NodeProxy

Changes that happen to NodeProxy, most importantly setting its source, are normally done whenever the put method is called (or, in ProxySpace, the assignment operation = ). Sometimes it is desirable to time these changes relative to a clock.

a) clock

generally, every node proxy can have its own time base, usually a tempo clock. the clock is responsible for the timing of insertion of new functions, per default at the next beat of the clock.

sequence of events

When inserting a new function into the proxy, the synthdef is built, sent to the server who sends back a message when it has completed. Then the proxy waits for the next beat to start the synth. When using node proxies with patterns, the patterns are played using the clock as a scheduler.

b) quant and offset

In order to be able to control the offset/quant point of insertion, the 'quant' instance variable can be used, which can be either a number or an array of the form [quant, offset], just like in pattern.play(quant).

quant and offset scheduling is used for the following operations: play, put, removeAt, setNodeMap, wakeUp, rebuild (and the rebuild operations lag, setRates, bus_). For more information about quantisation in SC, see Quant.

c) connecting client and server tempo

a ProxySpace has the method ProxySpace: -makeTempoClock, which creates an instance of TempoBusClock together with a node proxy (~tempo) which it keeps in sync.

d) sample accurate output

for efficiency, NodeProxy uses a normal Out UGen for writing to its bus. If sample accurate playback is needed (OffsetOut), the ProxySynthDef class variable ProxySynthDef: -sampleAccurate can be set to true. Note that for audio through from external sources, this creates a delay for up to one block (e.g. about 1 ms.)

previous: jitlib_basic_concepts_03