Class TempoBpmDirective
BPM (beats per minute) directive with optional ramp/transition.
Examples: @bpm 120, @bpm 120 -> 140 /2 (ramp from 120 to 140 across a half note),
@bpm 120 -> 60 /1~/1 (ramp down across two whole notes).
public sealed record TempoBpmDirective : NotationDirective, IEquatable<NotationDirective>, IEquatable<TempoBpmDirective>
- Inheritance
-
TempoBpmDirective
- Implements
- Inherited Members
Properties
Bpm
Starting BPM value.
public required int Bpm { get; init; }
Property Value
RampDuration
Duration of tempo ramp (in whole-note units).
Only meaningful if TargetBpm is set.
In the notation it is written as one note value, /2 or /4., or as several
tied together the way a held note is, /1~/1 for two whole notes and /1~/4
for five quarters; the reader sums the pieces.
public Rational? RampDuration { get; init; }
Property Value
Remarks
The notation used to allow one note value only, so a ramp that is not one — two whole
notes, but also five quarters or seven eighths — could be held here but not written
down: the writer fell back to the rational, /2/1, and the parser refused to read it.
TargetBpm
Optional target BPM for gradual tempo change (ramp/accelerando/ritardando). If null, tempo is constant at Bpm.
public int? TargetBpm { get; init; }
Property Value
- int?
Methods
ToString()
Returns a readable form such as "@bpm 120 at 0", "@bpm 120 -> 140 /2 at 0" or "@bpm 120 -> 60 /1~/1 at 0" — the ramp length spelled as the notation writes it.
public override string ToString()