Skip to content

tempo

The tempo property defines the speed of the composition in beats per minute (BPM).

Default Value

60  // 60 BPM (one beat per second)

Expression Examples

Fixed Tempo

60    // 60 BPM (slow)
120   // 120 BPM (moderate)
180   // 180 BPM (fast)
Legacy JavaScript syntax
javascript
new Fraction(60)   // 60 BPM (slow)
new Fraction(120)  // 120 BPM (moderate)
new Fraction(180)  // 180 BPM (fast)

Reference BaseNote Tempo

tempo(base)
Legacy JavaScript syntax
javascript
module.baseNote.getVariable('tempo')

Most notes inherit tempo from the BaseNote rather than defining their own.

How Tempo Affects Duration

The tempo is used to calculate beat-relative durations:

// Duration of one beat in seconds
// At 60 BPM: 60/60 = 1 second
// At 120 BPM: 60/120 = 0.5 seconds
60 / tempo(base)
Legacy JavaScript syntax
javascript
// Duration of one beat in seconds
// At 60 BPM: 60/60 = 1 second
// At 120 BPM: 60/120 = 0.5 seconds
new Fraction(60).div(module.findTempo(module.baseNote))

Duration Examples at Different Tempos

NoteAt 60 BPMAt 120 BPMAt 90 BPM
Whole (4 beats)4s2s2.67s
Half (2 beats)2s1s1.33s
Quarter (1 beat)1s0.5s0.67s
Eighth (0.5 beats)0.5s0.25s0.33s

tempo() Function

The tempo() function walks up the inheritance chain to find the effective tempo:

tempo(base)  // Returns tempo from BaseNote
Legacy JavaScript syntax
javascript
module.findTempo(module.baseNote)  // Returns tempo as Fraction

This allows individual notes to override tempo for tempo changes mid-composition.

Measure Length Calculation

Tempo affects measure length:

// measureLength = beatsPerMeasure / tempo * 60
// At 120 BPM with 4/4 time: 4 / 120 * 60 = 2 seconds
measure(base)
Legacy JavaScript syntax
javascript
// measureLength = beatsPerMeasure / tempo * 60
// At 120 BPM with 4/4 time: 4 / 120 * 60 = 2 seconds
module.findMeasureLength(module.baseNote)

Changing Global Tempo

To change the tempo for the entire composition:

  1. Click the BaseNote (orange circle)
  2. Find the tempo property in the Variable Widget
  3. Change the value (e.g., 120)
  4. All tempo-relative durations automatically update

Tempo Changes Within a Composition

While most compositions use a single tempo, you can create tempo changes by having notes define their own tempo property. Notes that reference these will use the new tempo.

Visualization

Tempo affects the visual spacing of beat-relative notes:

  • At slower tempos, beat-relative notes appear wider (longer duration in seconds)
  • At faster tempos, beat-relative notes appear narrower

Common Tempo Values

DescriptionBPMDSL Expression
Largo40-6050
Adagio66-7670
Andante76-10890
Moderato108-120112
Allegro120-156140
Presto168-200180

See Also

Released under the RMT Personal Non-Commercial License