Experimental - Search a MIDI from a sequence of notes and calculate a score tempo.
More...
Inherits MonoBehaviour.
class inhiriting | |
class | FootPrint |
Contains detailed information about a MIDI footprint. More... | |
Public Member Functions | |
void | MPTK_AddMultiple (string filter=null) |
void | MPTK_AddOne (string name) |
void | MPTK_Clear () |
FootPrint | MPTK_Encode (List< MPTKEvent > sequence) |
List< FootPrint > | MPTK_Search (List< MPTKEvent > sequence, int countnote=-1, float tempoScore=-1f) |
Public Attributes | |
List< FootPrint > | MPTK_MidiLib |
bool | Verbose |
Properties | |
int | SettingCountNote [get, set] |
int | SettingFirstNote [get, set] |
int | SettingLastNote [get, set] |
uint | SettingShiftLeft [get, set] |
Experimental - Search a MIDI from a sequence of notes and calculate a score tempo.
These capabilities and API could evolve in time or ... disappear!
A footprint is calculated for each MIDI added in MPTK_MidiLib with MPTK_AddOne or MPTK_AddMultiple.
Then MPTK_Search can be used to find a list of MIDI with the same fooprint (or partial footprint) from a sequence of notes (List of MPTKEvent).
If notes in the sequence contains duration then a tempo score is given for each MIDI found.
Limitation: max of 8 first notes are used for calculating the footprint
void MidiPlayerTK.MPTKFootPrint.MPTK_AddMultiple | ( | string | filter = null | ) |
Add multiple MIDI to MPTK_MidiLib.
filter | Only add MIDI when name contains filter in parameter. No case sensitive. Add all MIDI DB if null or missing |
void MidiPlayerTK.MPTKFootPrint.MPTK_AddOne | ( | string | name | ) |
Add a MIDI to MPTK_MidiLib. Use the exact name defined in Unity resources folder MidiDB without any path or extension.
name |
void MidiPlayerTK.MPTKFootPrint.MPTK_Clear | ( | ) |
Clear MPTK_MidiLib.
Calculate the footprint from the sequence of MPTKEvent. Only noteon in the range defined in the Setting are used.
sequence |
List< FootPrint > MidiPlayerTK.MPTKFootPrint.MPTK_Search | ( | List< MPTKEvent > | sequence, |
int | countnote = -1 , |
||
float | tempoScore = -1f |
||
) |
Search in MPTK_MidiLib from the footprint (or partial footprint) from a sequence of notes.
If notes in the sequence contains duration then a tempo score is given for each MIDI found.
sequence | Sequence of MPTKEvent to search. Only the 8 first notes are used |
countnote | Number of notes to search. The count of notes in sequence must be equal to the count of note of the searched MIDI. Default= -1, for searching partial match. |
tempoScore | Only MIDI found with a score equal or greater are keep in the resulting list. Default = -1, keep all MIDI regardless the score. |
List<FootPrint> MidiPlayerTK.MPTKFootPrint.MPTK_MidiLib |
List of MIDI to search for a sequence of notes. MIDI can be added with MPTK_AddOne or MPTK_AddMultiple.
bool MidiPlayerTK.MPTKFootPrint.Verbose |
For debugging goal ...
|
getset |
Number of notes used to calculated the footprint. Default value = 8.
|
getset |
First note of the footprint range
|
getset |
Last note of the footprint range
|
getset |
Shift bit for the footprint builder. Default value = 8. Other value has not been tested.