Struct VoiceNote
A note assigned to a specific voice.
public readonly record struct VoiceNote : IEquatable<VoiceNote>
- Implements
- Inherited Members
Properties
Duration
Duration in whole-note units.
public Rational Duration { get; init; }
Property Value
End
End time (Offset + Duration) in whole-note units.
public Rational End { get; }
Property Value
Offset
Onset time in whole-note units.
public Rational Offset { get; init; }
Property Value
OriginalIndex
Original index in the NoteBuffer.
public int OriginalIndex { get; init; }
Property Value
Pitch
MIDI pitch number (middle C = 60).
public int Pitch { get; init; }
Property Value
Velocity
Note velocity.
public float Velocity { get; init; }
Property Value
Methods
ToString()
Formats as note name, octave, and onset (e.g. C4 @ 0).
public override string ToString()
Returns
Remarks
Folded rather than %: C# keeps the sign, so a pitch below zero — which
Transpose(NoteBuffer, int) documents it can produce — indexed the
name table backwards and printing a separated voice threw IndexOutOfRangeException.
The octave is computed by flooring for the same reason, so B-1 does not print as B0.