Contains information about signature change.
More...
Contains information about signature change.
- Version
- Maestro 2.10.0
- Note
- The signature map is automaticalled build when a MIDI file is loaded from the MIDI DB, from an external MIDI or from a MIDI Writer instance.
- The signature map must be run by script on your MIDI events when created with MidiFileWriter2 with:
MPTK_CalculateMap and MPTK_CalculateMeasureBoundaries
- Each segments defined the tick start/end, the measure start/end.
◆ MPTKSignature()
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
- Parameters
-
index | |
fromTick | default 0 |
toTick | default ong.MaxValue |
numberBeatsMeasure | default 4 |
numberQuarterBeat | default 4 |
◆ MPTK_CalculateBeat()
int MidiPlayerTK.MPTKSignature.MPTK_CalculateBeat |
( |
long |
tick, |
|
|
int |
measure |
|
) |
| |
Calculate beat for this tick and measure position in this segment.
- Parameters
-
tick | tick to search in this segemnt map |
measure | measure to search in this segemnt map |
- Returns
- Beat position (between 1 and NumberBeatsMeasure)
◆ MPTK_CalculateMap()
static void MidiPlayerTK.MPTKSignature.MPTK_CalculateMap |
( |
int |
deltaTicksPerQuarterNote, |
|
|
List< MPTKEvent > |
mptkEvents, |
|
|
List< MPTKSignature > |
signaturesMap |
|
) |
| |
|
static |
Create a signature map from a MIDI events list with time signature.
- an allocated tempo map must be defined in parameter but the content will be cleared.
- a default time signature 4/4 is created if no time signature event found
- Version
- 2.10.0
mfw.MPTK_StableSortEvents();
mfw.MPTK_CalculateTiming(logDebug: true, logPerf: true);
mfw.MPTK_Debug();
- Parameters
-
deltaTicksPerQuarterNote | |
mptkEvents | |
signaturesMap | |
◆ MPTK_CalculateMeasureBoundaries()
static void MidiPlayerTK.MPTKSignature.MPTK_CalculateMeasureBoundaries |
( |
List< MPTKSignature > |
signaturesMap | ) |
|
|
static |
Calculate FromMeasure and ToMeasure for all segments in the signature map.
mfw.MPTK_StableSortEvents();
mfw.MPTK_CalculateTiming(logDebug: true, logPerf: true);
mfw.MPTK_Debug();
- Parameters
-
◆ MPTK_FindSegment()
static int MidiPlayerTK.MPTKSignature.MPTK_FindSegment |
( |
List< MPTKSignature > |
signMap, |
|
|
long |
tickSearch, |
|
|
int |
fromIndex = 0 |
|
) |
| |
|
static |
Find a signature change from a tick position in the tempo map.
- Parameters
-
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) |
- Returns
◆ MPTK_MeasureToTick()
static long MidiPlayerTK.MPTKSignature.MPTK_MeasureToTick |
( |
List< MPTKSignature > |
temposMap, |
|
|
int |
measure |
|
) |
| |
|
static |
Search a tick position from a measure tempo map.
- Note
- MPTK_CalculateMeasureBoundaries must be applied to the tempo map before this call.
- Parameters
-
temposMap | List of tempo maps |
measure | measure to search (start at 1) |
- Returns
- tick position found, value will be between FromTick and ToTick.
◆ MPTK_TickToMeasure()
int MidiPlayerTK.MPTKSignature.MPTK_TickToMeasure |
( |
long |
tick | ) |
|
Search a measure from a tick in this segment map.
- Parameters
-
- Returns
◆ ToString()
override string MidiPlayerTK.MPTKSignature.ToString |
( |
| ) |
|
String description of this segment
- Returns
◆ DeltaTicksPerQuarterNote
int MidiPlayerTK.MPTKSignature.DeltaTicksPerQuarterNote |
|
static |
This information is mandatory to calculate start/end measure and beat.
◆ FromMeasure
int MidiPlayerTK.MPTKSignature.FromMeasure |
Start measure of this segment of event
◆ FromTick
long MidiPlayerTK.MPTKSignature.FromTick |
Tick start of this segment
◆ Index
int MidiPlayerTK.MPTKSignature.Index |
Index of this segment if added to a list of tempo map with #MPTK_CalculateTempoMap
◆ NumberBeatsMeasure
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/
◆ NumberQuarterBeat
int MidiPlayerTK.MPTKSignature.NumberQuarterBeat |
◆ ToMeasure
int MidiPlayerTK.MPTKSignature.ToMeasure |
End measure of this segment of event
◆ ToTick
long MidiPlayerTK.MPTKSignature.ToTick |