Skip to content

About time

The clock

When cslc begins, a global clock (gk_now) begins running. The clock value increments every control period in Csound.

The size of the increment will vary, depending upon the tempo. The default tempo - 60 ( in beats per minute ) - means the clock increments by a whole number on every second.

There is a UDO to retrieve the clock value (see now), however it's rare to get now explicitly: CSLC, and Csound, tend to schedule events relatively, rather than using absolute time.

The beat

A 'beat' therefore can be considered as a whole number in the clock. 344.0 is 'on the beat', 412.5 is 'on the half-beat' etc.... The UDO's nextbeat, onbeat, and nextrh all round rhythms to the whole or fractional values on the clock as required.

In cslc, there are rhythm UDO's to convert 'beat' times into seconds. This is mostly useful for Csound opcodes expecting input in seconds (such as schedule)

However, be mindful that the event UDO's embed these tools to perform automatic conversions of onset times and durations.

Temporal recursion and loopcode

In this manual you'll see code examples which endlessly repeat. This is done in two ways: One is to schedule events inside an instrument that calls itself. This is called Temporal Recursion. This recursive instrument holds all the algorithms and logic flow to generate events in (hopefully) interesting patterns, such that when it calls itself again it may, or may not, repeat what it played previously.

The other method uses the loopcode UDO. In fact this is effectively the same method 'under the hood', but the recursion code has been abstracted away in a simplified input.

For more on temporal recursion, see Andrew Sorensen, Henry J. Gardner: Programming with time: cyber-physical programming with impromptu. OOPSLA 2010