Maestro - Midi Player Tool Kit for Unity Version 2.18.2
Loading...
Searching...
No Matches
MIDI Selection

Select which MIDI file will be played. More...

Play and Stop MIDI

virtual string MidiPlayerTK.MidiFilePlayer.MPTK_MidiName [get, set]
 Select a MIDI from the MIDIDB to play by its name.
Use the exact name as seen in the MIDI setup windows (Unity menu MPTK/ without any path or extension.
Tips: Add MIDI files to your project with the Unity menu MPTK.
int MidiPlayerTK.MidiFilePlayer.MPTK_MidiIndex [get, set]
 Select a MIDI file to play by its Index from the MIDIDB.
The Index of a MIDI file is displayed in the popup from the MidiFilePlayer inspector and in the window "Midi File Setup" from the MPTK menu in the editor.
.
bool MidiPlayerTK.MidiFilePlayer.MPTK_SearchMidiToPlay (string searchPartOfName)
 Finds a MIDI in the Unity Resources folder MidiDB whose name contains searchPartOfName (case-sensitive).
Sets MPTK_MidiIndex and MPTK_MidiName if the MIDI is found.

Detailed Description

Select which MIDI file will be played.

Function Documentation

◆ MPTK_SearchMidiToPlay()

bool MidiPlayerTK.MidiFilePlayer.MPTK_SearchMidiToPlay ( string searchPartOfName)

Finds a MIDI in the Unity Resources folder MidiDB whose name contains searchPartOfName (case-sensitive).
Sets MPTK_MidiIndex and MPTK_MidiName if the MIDI is found.

Note
  • Add Midi files to your project with the Unity menu Maestro.
Version
Maestro Pro
// Find the first MIDI file name in MidiDB that contains "Adagio" in its name
if (midiFilePlayer.MPTK_SearchMidiToPlay("Adagio"))
{
Debug.Log($"MPTK_SearchMidiToPlay: {MPTK_MidiIndex} {MPTK_MidiName}");
// And play it
midiFilePlayer.MPTK_Play();
}
Parameters
searchPartOfNamePart of the MIDI name to search for in the MIDI list (case-sensitive).
Returns
True if found; otherwise, false.

Properties

◆ MPTK_MidiName

virtual string MidiPlayerTK.MidiFilePlayer.MPTK_MidiName
getset

Select a MIDI from the MIDIDB to play by its name.
Use the exact name as seen in the MIDI setup windows (Unity menu MPTK/ without any path or extension.
Tips: Add MIDI files to your project with the Unity menu MPTK.

// Play the MIDI "Albinoni - Adagio"
midiFilePlayer.MPTK_MidiName = "Albinoni - Adagio";
midiFilePlayer.MPTK_Play();

◆ MPTK_MidiIndex

int MidiPlayerTK.MidiFilePlayer.MPTK_MidiIndex
getset

Select a MIDI file to play by its Index from the MIDIDB.
The Index of a MIDI file is displayed in the popup from the MidiFilePlayer inspector and in the window "Midi File Setup" from the MPTK menu in the editor.
.

// Play the MIDI index 33
midiFilePlayer.MPTK_MidiIndex = 33;
midiFilePlayer.MPTK_Play();
Parameters
indexIndex of the MIDI, start from 0