/// <summary>
/// MPTK component able to play a Midi list. This PreFab must be present in your scene.
/// </summary>
public MidiListPlayer midiListPlayer;
(edited)midiListPlayer = FindObjectOfType<MidiListPlayer>();
// Call when a MIDI is starting playing
midiListPlayer.OnEventStartPlayMidi.AddListener(StartPlay);
// Call when a MIDI is ending playing
midiListPlayer.OnEventEndPlayMidi.AddListener(EndPlay);
(edited) public void StartPlay(string name)
{
Debug.Log("Start Play Midi '" + name);
}
public void CreateList()
{
midiListPlayer.MPTK_Stop();
midiListPlayer.MPTK_NewList();
midiListPlayer.MPTK_OverlayTimeMS = 1000f;
midiListPlayer.MPTK_AddMidi("Baez Joan - Plaisir D'Amour", 10000, 20000);
midiListPlayer.MPTK_AddMidi("Bach - Fugue", 25000, 35000);
midiListPlayer.MPTK_PlayIndex = 0;
}