Class TimeSignatureMap
- Namespace
- NAudio.Sequencing
- Assembly
- NAudio.Core.dll
An ordered set of time signature segments, used to convert canonical ticks to and from the human-facing bar/beat/tick view. The first segment must begin at tick 0; subsequent segment boundaries must fall on a bar line of the preceding signature.
public sealed class TimeSignatureMap
- Inheritance
-
TimeSignatureMap
- Inherited Members
Remarks
Mid-bar time signature changes are not supported — they are exceedingly rare in real scores and the bar-counting bookkeeping required to handle them is not worth the complexity in v1.
Constructors
TimeSignatureMap(TimeSignature)
Creates a map containing a single time signature in force from tick 0.
public TimeSignatureMap(TimeSignature signature)
Parameters
signatureTimeSignature
TimeSignatureMap(IEnumerable<(long StartTick, TimeSignature Signature)>)
Creates a map from an ordered set of (tick, signature) entries. The first must be at tick 0.
public TimeSignatureMap(IEnumerable<(long StartTick, TimeSignature Signature)> entries)
Parameters
entriesIEnumerable<(long StartTick, TimeSignature Signature)>
Methods
FromTicks(long)
Converts a tick position to a 1-based bar/beat/tick view.
public BarBeatTick FromTicks(long ticks)
Parameters
tickslong
Returns
SignatureAt(long)
The time signature in force at the given tick.
public TimeSignature SignatureAt(long ticks)
Parameters
tickslong
Returns
ToTicks(BarBeatTick)
Converts a 1-based bar/beat/tick position back to canonical ticks.
public long ToTicks(BarBeatTick position)
Parameters
positionBarBeatTick