OSC and Network

Ableton Link Opcodes

The purpose of Ableton Link is to synchronize musical time, beat, and phase between musical applications performing in real time from separate programs, processes, and network addresses. This is useful, e.g., for laptop orchestras.

Ableton Live is not required to use the Ableton Link protocol, as it is a peer-to-peer protocol. There is one Link session on the local area network that maintains a global time, tempo, and beat. Any peer may set the tempo, and thereafter all peers in the session share that tempo. A process may have any number of peers (i.e., any number of Link objects). Each peer may also define its own "quantum" i.e. some multiple of the beat, e.g. a quantum of 4 might imply 1 beat every measure of 4/4 time. The phase of the time is defined w.r.t the quantum, e.g. phase 0.5 of a quantum of 4 would be the second beat of the measure. Peers may read and write timelines with local time, beat, and phase, counting from when the peer is enabled, but the tempo and beat on all timelines for all peers in the session will coincide.

The first peer in a session determines the initial tempo. After that, the tempo is changed only, and whenever, any peer explicity calls the set tempo functon (link_tempo_set, in Csound).

The Link tempo is independent of the Csound score tempo. Performances that need to synchronize the score tempo with the Link tempo may use the tempo opcode to set the score tempo from the Link tempo; or conversely, set the Link tempo from the score tempo using the tempoval opcode.

Please note, the phase and beat obtained or set by these opcodes is only as precise as allowed by the duration of Csound's kperiod, the audio driver used by Csound, network latency and stability, and the system's most precise clock.

  • link_create - Creates an Ableton Link peer object.

  • link_enable - Enable/disable synchronization with the network Ableton Link session tempo and beat.

  • link_is_enabled - Returns whether or not this Ableton Link peer has joined the network session.

  • link_tempo_set - Sets the tempo for the network's Ableton Link session.

  • link_tempo_set - Returns the tempo of the network's Ableton Link session.

  • link_beat_get - Returns the beat, phase, and current time of Ableton Link for this session for a given quantum.

  • link_metro - Returns a trigger that is 1 on the beat and 0 otherwise along with the beat, phase, and current time of Ableton Link for this session for a given quantum.

  • link_beat_request - Requests a beat with a specific number at a specific time at a given quantum.

  • link_beat_force - Forces the network Ableton Link session to adopt a beat with a specific number at a specific time at a given quantum.

  • link_peers - Returns the number of peers currently joined in the network Ableton Link session.