Singleton class to manage all global features of MPTK. More information here: https://paxstellar.fr/midiplayerglobal/
More...
Inherits MonoBehaviour, and MonoBehaviour.
|
static float | MPTK_DistanceToListener (Transform trf) |
| Calculate distance with the AudioListener. More...
|
|
static int | MPTK_FindMidi (string name) |
| Find index of a Midi by name. Use the exact name defined in Unity resources folder MidiDB without any path or extension. Tips: Add Midi files to your project with the Unity menu MPTK or add it directly in the ressource folder and open Midi File Setup to automatically integrate Midi in MPTK. More...
|
|
static bool | MPTK_IsReady (float delay=0.5f) |
| Check if SoudFont is loaded. Add a default wait time because Unity AudioSource need a delay to be really ready to play. More...
|
|
static bool | MPTK_LoadLiveSF (string pPathSF=null, int defaultBank=-1, int drumBank=-1, bool restartPlayer=true) |
| [MPTK PRO] - Load a SoundFont on the fly when application is running. SoundFont is loaded from a local file or from the web. If some Midis are playing they are restarted. Loading is done in background (coroutine), so method return immediately More...
|
|
static void | MPTK_Quit () |
| Stop all Midi Synthesizer dans Midi Sequencer and exit application More...
|
|
static void | MPTK_SelectBankDrum (int nbank) |
| Change current bank on fly More...
|
|
static void | MPTK_SelectBankInstrument (int nbank) |
| Change default current bank on fly More...
|
|
static void | MPTK_SelectSoundFont (string name, bool restartPlayer=true) |
| [MPTK PRO] - Changing the current Soundfont on fly. If some Midis are playing they are restarted. More...
|
|
static void | MPTK_Stop () |
| Stop all Midi Synthesizer dans Midi Sequencer More...
|
|
Singleton class to manage all global features of MPTK. More information here: https://paxstellar.fr/midiplayerglobal/
Singleton class to manage all global features of MPTK.
◆ MPTK_DistanceToListener()
static float MidiPlayerTK.MidiPlayerGlobal.MPTK_DistanceToListener |
( |
Transform |
trf | ) |
|
|
static |
Calculate distance with the AudioListener.
- Parameters
-
trf | Transform of the object to calculate the distance. |
- Returns
◆ MPTK_FindMidi()
static int MidiPlayerTK.MidiPlayerGlobal.MPTK_FindMidi |
( |
string |
name | ) |
|
|
static |
Find index of a Midi by name. Use the exact name defined in Unity resources folder MidiDB without any path or extension. Tips: Add Midi files to your project with the Unity menu MPTK or add it directly in the ressource folder and open Midi File Setup to automatically integrate Midi in MPTK.
- Parameters
-
name | name of the midi without path nor extension |
- Returns
- -1 if not found else return the index of the midi.
◆ MPTK_IsReady()
static bool MidiPlayerTK.MidiPlayerGlobal.MPTK_IsReady |
( |
float |
delay = 0.5f | ) |
|
|
static |
Check if SoudFont is loaded. Add a default wait time because Unity AudioSource need a delay to be really ready to play.
- Parameters
-
delay | Additional waiting time (second), default is 0.5 second. Could be equal to 0. |
- Returns
◆ MPTK_LoadLiveSF()
static bool MidiPlayerTK.MidiPlayerGlobal.MPTK_LoadLiveSF |
( |
string |
pPathSF = null , |
|
|
int |
defaultBank = -1 , |
|
|
int |
drumBank = -1 , |
|
|
bool |
restartPlayer = true |
|
) |
| |
|
static |
[MPTK PRO] - Load a SoundFont on the fly when application is running. SoundFont is loaded from a local file or from the web. If some Midis are playing they are restarted. Loading is done in background (coroutine), so method return immediately
- Parameters
-
pPathSF | Full path to SoudFont file. Must start with file:// for local desktop loading or with or http:// or https:// for loading from web resource. if null, use MPTK_LiveSoundFont |
defaultBank | default bank to use for instrument, default or -1 to select the first bank |
drumBank | bank to use for drum kit, default or -1 to select the last bank |
restartPlayer | Restart midi player if need, default is true |
- Returns
- true if loading is in progress, false if an error is detected in parameters
◆ MPTK_Quit()
static void MidiPlayerTK.MidiPlayerGlobal.MPTK_Quit |
( |
| ) |
|
|
static |
Stop all Midi Synthesizer dans Midi Sequencer and exit application
◆ MPTK_SelectBankDrum()
static void MidiPlayerTK.MidiPlayerGlobal.MPTK_SelectBankDrum |
( |
int |
nbank | ) |
|
|
static |
Change current bank on fly
- Parameters
-
nbank | Number of the SoundFont Bank to load for drum. |
◆ MPTK_SelectBankInstrument()
static void MidiPlayerTK.MidiPlayerGlobal.MPTK_SelectBankInstrument |
( |
int |
nbank | ) |
|
|
static |
Change default current bank on fly
- Parameters
-
nbank | Number of the SoundFont Bank to load for instrument. |
◆ MPTK_SelectSoundFont()
static void MidiPlayerTK.MidiPlayerGlobal.MPTK_SelectSoundFont |
( |
string |
name, |
|
|
bool |
restartPlayer = true |
|
) |
| |
|
static |
[MPTK PRO] - Changing the current Soundfont on fly. If some Midis are playing they are restarted.
- Parameters
-
name | SoundFont name |
restartPlayer | if a midi is playing, restart the current playing midi |
◆ MPTK_Stop()
static void MidiPlayerTK.MidiPlayerGlobal.MPTK_Stop |
( |
| ) |
|
|
static |
Stop all Midi Synthesizer dans Midi Sequencer
◆ MPTK_CountWaveLoaded
int MidiPlayerTK.MidiPlayerGlobal.MPTK_CountWaveLoaded |
|
static |
◆ MPTK_ListBank
List<MPTKListItem> MidiPlayerTK.MidiPlayerGlobal.MPTK_ListBank |
|
static |
Get the list of banks available
◆ MPTK_ListDrum
List<MPTKListItem> MidiPlayerTK.MidiPlayerGlobal.MPTK_ListDrum |
|
static |
Get the list of presets available
◆ MPTK_ListMidi
List<MPTKListItem> MidiPlayerTK.MidiPlayerGlobal.MPTK_ListMidi |
|
static |
List of midi(s) available
◆ MPTK_ListPreset
List<MPTKListItem> MidiPlayerTK.MidiPlayerGlobal.MPTK_ListPreset |
|
static |
List of presets (instrument) for the default or selected bank. The default bank can be changed with MPTK_SelectBankInstrument
◆ MPTK_ListPresetDrum
List<MPTKListItem> MidiPlayerTK.MidiPlayerGlobal.MPTK_ListPresetDrum |
|
static |
List of drum set for the default or selected bank. The default bank can be changed with MPTK_SelectBankDrum
◆ MPTK_LiveSoundFont
string MidiPlayerTK.MidiPlayerGlobal.MPTK_LiveSoundFont |
◆ MPTK_SoundFontLoaded
bool MidiPlayerTK.MidiPlayerGlobal.MPTK_SoundFontLoaded = false |
|
static |
True if soundfont is loaded
◆ MPTK_CountPresetLoaded
int MidiPlayerTK.MidiPlayerGlobal.MPTK_CountPresetLoaded |
|
staticget |
◆ MPTK_ListSoundFont
List<string> MidiPlayerTK.MidiPlayerGlobal.MPTK_ListSoundFont |
|
staticget |
List of Soundfont(s) available
◆ MPTK_LoadSoundFontAtStartup
bool? MidiPlayerTK.MidiPlayerGlobal.MPTK_LoadSoundFontAtStartup |
|
staticgetset |
If true load soundfont when startup
◆ MPTK_LoadWaveAtStartup
bool? MidiPlayerTK.MidiPlayerGlobal.MPTK_LoadWaveAtStartup |
|
staticgetset |
If true load all waves when application is started else load when need when playing (default)
◆ MPTK_PathToResources
string MidiPlayerTK.MidiPlayerGlobal.MPTK_PathToResources |
|
staticget |
This path could change depending your project. Change the path before any actions in MPTK. DEPRECATED, WILL BE REMOVED.
◆ MPTK_TimeToLoadSoundFont
TimeSpan MidiPlayerTK.MidiPlayerGlobal.MPTK_TimeToLoadSoundFont |
|
staticget |
Load time for the current SoundFont
◆ MPTK_TimeToLoadWave
TimeSpan MidiPlayerTK.MidiPlayerGlobal.MPTK_TimeToLoadWave |
|
staticget |
◆ OnEventPresetLoaded
UnityEvent? MidiPlayerTK.MidiPlayerGlobal.OnEventPresetLoaded |
|
staticgetset |
Event triggered at end of loading a soundfont. Warning: when defined by script, this event is not triggered at first load of MPTK because MidiPlayerGlobal is loaded before any other gamecomponent. Set this event in the Inspector of MidiPlayerGlobal to get at first load this information.