ListeningClock:
Filter:
ListeningClocks (extension) | Clocks

ListeningClock
ExtensionExtension

a clock that listens to other clocks

Description

ListeningClock implements phase and frequency adjustment to a number of other clocks. This can be useful to synchronise ensembles in a fluent way. Together, they behave like cartoonified musicians who entrain to each other.

It takes inspiration from the intricate improvisation practice of Javanese and Balinese Gamelan playing and was developed for the project Virtual Gamelan Graz by Rainer Schütz, Alberto de Campo, and Julian Rohrhuber.

Creation / Class Methods

all

Like TempoClock, ListeningClock keeps track of its instances so that they may be stopped globally. To keep a clock running, set permanent = true. To remove a permanent clock, use the message stop.

new

Creates a new instance with the given tempo and starting times. If not supplied, tempo defaults to 1.0, beats defaults to 0.0 and seconds defaults to the current elapsed time since SuperCollider startup. The default queueSize is 256, see queue (see TempoClock).

Instance Methods

others

An array of other clocks which this clock listens to.

weights

An array of degrees which determines how much this clock listens to each other clock (0.0..1.0)

setClocks(clocks, argWeights, start)

Determine the other clocks and their weights. If start is true (default: true), listening begins immediately.

startListen

Start to listen to the clocks in others.

stopListen

Stop listening. The clock continues to work, but without interaction to the others.

isListening

Returns true if clock is listening

verbose

If verbose is set to true, clock posts a lot of information on its current state.

dt(val = 0.1)

Time difference between adjustments, at which the clock tempo and phase are updated

NOTE: Empathy and Confidence

Two parameters are responsible for the clock's adaptive behavior: empathy and confidence. Empathy is related to the degree of phase adjustment: If empathy is high, the clock remains tight in phase with the others. Confidence, on the other hand, is connected with tempo (frequency): If confidence is high, the clock keeps its own tempo, if it is low, it quickly adjusts to the other tempi. Basis for these adjustments is the weighted average of phase and tempo of the other clocks.

empathy

Set the degree of empathy within a range between 0 (no empathy) and 1 (total empathy). Default: 0.5.

confidence

Set the degree of confidence within a range between 0 (zero confidence) and 1 (total self confidence). Default: 0.5.

tempo

Get Tempo, and set tempo immediately.

A ListeningClock also implements slow direct tempo adjustments.

fadeTempo(newTempo, dur, warp, clock)

Move to new tempo over a given time (dur - default: 1.0) and in a given transition shape (warp - default: \cos). This transition normally happens within the frame of reference of SystemClock (seconds), however a different clock may be passed in the clock argument.

warpTempo(frac, beats, warp)

Modify the tempo to a fraction (frac) of the current tempo over a given duration (beats - default: 1.0) and with a given shape (warp - default: \cos). The time base is the clock itself.

pause(dur)

Set the tempo to zero over dur (default: immediately)

rateOfChange

Returns the current change rate.

beatWrap

If nBeats is given, the clock will not catch up with the absolute phase of the others, but only within the given number of beat cycles. This is useful to avoid confusion after fast tempo changes given that the music has a circular event structure where absolute phase does not matter.

Examples