Skip to content

beatsPerMeasure

The beatsPerMeasure property defines the number of beats in one measure, equivalent to the numerator of a time signature.

Default Value

javascript
new Fraction(4)  // 4 beats per measure (4/4 time)

Expression Examples

Common Time Signatures

javascript
new Fraction(4)  // 4/4 (common time)
new Fraction(3)  // 3/4 (waltz time)
new Fraction(2)  // 2/4 (march time)
new Fraction(6)  // 6/8 (compound duple)

Reference BaseNote

javascript
module.baseNote.getVariable('beatsPerMeasure')

How It Affects Measure Length

The measure length (in seconds) is calculated as:

javascript
measureLength = beatsPerMeasure / tempo * 60

// At 120 BPM with 4 beats per measure:
// 4 / 120 * 60 = 2 seconds

Access via:

javascript
module.findMeasureLength(module.baseNote)

Common Time Signatures

Time SignaturebeatsPerMeasureDescription
4/44Common time, most popular
3/43Waltz, minuet
2/42March, polka
6/86Compound duple (two groups of 3)
5/45Irregular meter
7/87Irregular meter

Measure-Relative Timing

Use beatsPerMeasure for measure-aligned timing:

javascript
// Start at measure 2
module.findMeasureLength(module.baseNote).mul(new Fraction(2))

// Duration of half a measure
module.findMeasureLength(module.baseNote).mul(new Fraction(1, 2))

Visualization

  • Vertical dashed lines on the workspace indicate measure boundaries
  • Measure lines are spaced according to the calculated measure length
  • The spacing changes if tempo or beatsPerMeasure changes

Changing Time Signature

To change the time signature for the composition:

  1. Click the BaseNote (orange circle)
  2. Find beatsPerMeasure in the Variable Widget
  3. Set the new value (e.g., new Fraction(3) for 3/4 time)

All measure-relative expressions will automatically update.

Mixed Meters

While most compositions use a single time signature, you can create meter changes by having certain notes define their own beatsPerMeasure. Notes referencing these will use the new meter.

See Also

Released under the RMT Personal Non-Commercial License