Midi Player Tool Kit for Unity  Version 2.881
Add Midi Music to your Unity App, Build Rhytm Game, Create Music Generator ... see how here.
Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
[detail level 123]
 CMidiPlayerTK.HelperNoteLabelClass contains some static methods about notes helper
 CMidiPlayerTK.MidiFileLoaderThis class, associated to the prefab MidiFileLoader is usefull to load all or a part of the Midi events from a Midi file.
No sequencer, no synthetizer, no music playing capabilities, just loading and decoding a Midi file to the more easy class MPTKEvent.
Midi can be loaded from the MidiDB list (see Unity menu MPTK / Midi Player Setup) or from a folder on the desktop (Pro)
 CMidiPlayerTK.MidiFileWriter2[MPTK PRO] - Write a midi file from differents sources based on NAudio frawemork.
See full example TestMidiWriter.cs with a light sequencer.
This class replaced MidiFileWriter with these changes: channel start at 0, new specfic event, better control.
More information here: https://paxstellar.fr/class-midifilewriter2/
 CMidiPlayerTK.MidiKeyboard[MPTK PRO] - BAse class to send and receive Midi Message from a Midi keyboard connected to the device
More information here https://paxstellar.fr/class-midikeyboard/
 CMidiPlayerTK.MidiListPlayer[MPTK PRO] - Script for the prefab MidiListPlayer.
Play a list of pre-selected midi file from the dedicated inspector.
List of Midi files must exists in MidiDB. See Midi Player Setup (Unity menu MPTK)
 CMidiPlayerTK.MidiListPlayer.MPTK_MidiPlayItemDefine a midi to be added in the list
 CMidiPlayerTK.MidiLoadBase class for loading a Midi file.
Internal used by MidiFilePlayer, MidiListPlayer, MidiFileWrite2, MidiFileLoader.
It is better to use the prefab and class MidiFileLoader if you want to only load a Midi file
 CMidiPlayerTK.MidiPlayerGlobalSingleton class to manage all global features of MPTK. More information here: https://paxstellar.fr/midiplayerglobal/
 CMidiPlayerTK.MidiSynthContains all the functions to build a wave table synth: load SoundFont and samples, process midi event, play voices, controllers, generators ...
This class is inherited by others class to build these prefabs: MidiStreamPlayer, MidiFilePlayer, MidiInReader.
It is not recommended to instanciate directly this class, rather add prefabs to the hierarchy of your scene
 CMidiPlayerTK.MidiFilePlayerThis class, associated to the prefab MidiFilePlayer, is able to play music from Midi file.
Midi files must be added from the Unity menu MPTK in the Unity editor.
There is no need to writing a script. For a simple usage, all the job can be done in the prefab inspector.
For more information see here https://paxstellar.fr/midi-file-player-detailed-view-2/
But to more specific interaction, this class can be useful. See example below wich select randomly a Midi to play
 CMidiPlayerTK.MidiExternalPlayer[MPTK PRO] - Script associated to the prefab MidiExternalPlayer.
Play a midi file from a path on the local deskop or from a web site.
There is no need to writing a script. For a simple usage, all the job can be done in the prefab inspector.
 CMidiPlayerTK.MidiSpatializer[MPTK PRO] - Script associated to the prefab MidiSpatializer.
It's quite light because the major job is done with MidiSynth There is no specific API for this prefab.
Scripting is necessary to defined position of channel or instrument in your 3D env
 CMidiPlayerTK.MidiFilePlayerThis class, associated to the prefab MidiFilePlayer, is able to play music from Midi file.
Midi files must be added from the Unity menu MPTK in the Unity editor.
There is no need to writing a script. For a simple usage, all the job can be done in the prefab inspector.
For more information see here https://paxstellar.fr/midi-file-player-detailed-view-2/
But to more specific interaction, this class can be useful. See example below wich select randomly a Midi to play
 CMidiPlayerTK.MidiInReader[MPTK PRO] - Script associated to the prefab MidiInReader.
Read Midi events from a Midi keyboard connected your device (Windows 10 or MacOS). See example of use in TestMidiInputScripting.cs
There is no need to writing a script. For a simple usage, all the job can be done in the prefab inspector.
 CMidiPlayerTK.MidiStreamPlayerThe prefab MidiStreamPlayer is useful to play real time music in relation with user actions.
Any Midi file is necessary, the notes are generated by your scripts from your own algorithm. Thank to the API of this class.
The main function MPTK_PlayEvent() and the class MPTKEvent are able to create all kind of midi events as note-on.
All the values must be set in MPTKEvent, command, note value, duration ... for more details look at the class MPTKEvent.
A note-on must also stopped: if duration = -1 the note is infinite, it's the goal of MPTK_StopEvent() to stop the note with a note-off.
On top of that, the Pro version adds playing chords with MPTK_PlayChordFromRange() and MPTK_PlayChordFromLib().
For playing scales, have a look to the class MPTKRangeLib
For more information see here https://paxstellar.fr/midi-file-player-detailed-view-2-2/
Also look at the demo TestMidiStream and the code source TestMidiStream.cs
 CMidiPlayerTK.MidiStreamPlayerThe prefab MidiStreamPlayer is useful to play real time music in relation with user actions.
Any Midi file is necessary, the notes are generated by your scripts from your own algorithm. Thank to the API of this class.
The main function MPTK_PlayEvent() and the class MPTKEvent are able to create all kind of midi events as note-on.
All the values must be set in MPTKEvent, command, note value, duration ... for more details look at the class MPTKEvent.
A note-on must also stopped: if duration = -1 the note is infinite, it's the goal of MPTK_StopEvent() to stop the note with a note-off.
On top of that, the Pro version adds playing chords with MPTK_PlayChordFromRange() and MPTK_PlayChordFromLib().
For playing scales, have a look to the class MPTKRangeLib
For more information see here https://paxstellar.fr/midi-file-player-detailed-view-2-2/
Also look at the demo TestMidiStream and the code source TestMidiStream.cs
 CMidiPlayerTK.MPTKChordBuilder[MPTK PRO] Chord builder class for MPTK. Usefull to generate Midi Music with MidiStreamPlayer - V2.82 See example in TestMidiStream.cs and ExtStreamPlayerPro.cs
 CMidiPlayerTK.MPTKChordLib[MPTK PRO] - Load library of chord from ChordLib.csv in folder Resources/GeneratorTemplate.csv - V2.82 new
 CMidiPlayerTK.MPTKEventMidi Event class for MPTK. This class is very more simple to use that the standard Midi structure.
With this class, you can: play and stop a note, change instrument (preset, patch, ...), change some control as modulation (Pro) ...
Use this class in relation with these classes:
 CMidiPlayerTK.MPTKRangeLib[MPTK PRO] - Load library of scale from GammeDefinition.csv in folder Resources/GeneratorTemplate.csv
For more information see here https://paxstellar.fr/midi-file-player-detailed-view-2-2/