Contains information about signature change.
More...
Public Member Functions | |
MPTKSignature (int index, long fromTick=0, long toTick=long.MaxValue, int numberBeatsMeasure=4, int numberQuarterBeat=4) | |
Create a signtaure segment with default value More... | |
int | CalculateBeat (long tick, int measure) |
int | TickToMeasure (long tick) |
override string | ToString () |
Static Public Member Functions | |
static void | CalculateMap (int deltaTicksPerQuarterNote, List< MPTKEvent > mptkEvents, List< MPTKSignature > signaturesMap) |
static void | CalculateMeasureBoundaries (List< MPTKSignature > signaturesMap) |
static int | FindSegment (List< MPTKSignature > signMap, long tickSearch, int fromIndex=0) |
static long | MeasureToTick (List< MPTKSignature > temposMap, int measure) |
Public Attributes | |
int | FromMeasure |
long | FromTick |
int | Index |
int | NumberBeatsMeasure |
int | NumberQuarterBeat |
int | ToMeasure |
long | ToTick |
Static Public Attributes | |
static int | DeltaTicksPerQuarterNote |
Contains information about signature change.
MidiPlayerTK.MPTKSignature.MPTKSignature | ( | int | index, |
long | fromTick = 0 , |
||
long | toTick = long.MaxValue , |
||
int | numberBeatsMeasure = 4 , |
||
int | numberQuarterBeat = 4 |
||
) |
Create a signtaure segment with default value
index | |
fromTick | default 0 |
toTick | default ong.MaxValue |
numberBeatsMeasure | default 4 |
numberQuarterBeat | default 4 |
int MidiPlayerTK.MPTKSignature.CalculateBeat | ( | long | tick, |
int | measure | ||
) |
Calculate beat for this tick and measure position in this segment.
tick | tick to search in this segemnt map |
measure | measure to search in this segemnt map |
|
static |
Create a signature map from a MIDI events list with time signature.
deltaTicksPerQuarterNote | |
mptkEvents | |
signaturesMap |
|
static |
Calculate FromMeasure and ToMeasure for all segments in the signature map.
signaturesMap |
|
static |
Find a signature change from a tick position in the tempo map.
signMap | List of tempo map build with MPTK_CalculateTempoMap |
tickSearch | search from this tick value |
fromIndex | search from this index position in the list (for optimazation) |
|
static |
Search a tick position from a measure tempo map.
temposMap | List of tempo maps |
measure | measure to search (start at 1) |
int MidiPlayerTK.MPTKSignature.TickToMeasure | ( | long | tick | ) |
Search a measure from a tick in this segment map.
tick |
override string MidiPlayerTK.MPTKSignature.ToString | ( | ) |
String description of this segment
|
static |
This information is mandatory to calculate start/end measure and beat.
int MidiPlayerTK.MPTKSignature.FromMeasure |
Start measure of this segment of event
long MidiPlayerTK.MPTKSignature.FromTick |
Tick start of this segment
int MidiPlayerTK.MPTKSignature.Index |
Index of this segment if added to a list of tempo map with #MPTK_CalculateTempoMap
int MidiPlayerTK.MPTKSignature.NumberBeatsMeasure |
From TimeSignature event: The numerator counts the number of beats in a mesure.
For example a numerator of 4 means that each bar contains four beats.
This is important knowing this value because usually the first beat of each bar has extra emphasis.
https://paxstellar.fr/2020/09/11/midi-timing/
int MidiPlayerTK.MPTKSignature.NumberQuarterBeat |
From TimeSignature event: Describes of what note value a beat is.
int MidiPlayerTK.MPTKSignature.ToMeasure |
End measure of this segment of event
long MidiPlayerTK.MPTKSignature.ToTick |
Tick end of this segment