Play a Local MIDI file or from a Web site. This class must be used with the prefab MidiExternalPlayer
More...
Public Member Functions | |
| override void | MPTK_Play (bool alreadyLoaded=false) |
| Play the midi file defined with MPTK_MidiName or MPTK_MidiIndex. More... | |
Public Member Functions inherited from MidiPlayerTK.MidiFilePlayer | |
| void | MPTK_Stop () |
| void | MPTK_Stop (bool stopAllSound=true, float wait=-1f) |
| void | MPTK_RePlay () |
| void | MPTK_Pause (float timeToPauseMS=-1f) |
| void | MPTK_UnPause () |
| void | MPTK_Next () |
| void | MPTK_Previous () |
| bool | MPTK_SearchMidiToPlay (string searchPartOfName) |
| void | MPTK_PlayNextOrPrevious (int offset) |
| void | MPTK_SwitchMidiWithDelay (int index, string name, float volume, float delayToStopMillisecond, float delayToStartMillisecond) |
| virtual void | MPTK_Play (float delayRampUp, float startDelay=0) |
| void | MPTK_Play (byte[] data) |
| void | MPTK_Play (MPTKWriter mfw2, float delayRampUp=0f, float fromPosition=0, float toPosition=0, long fromTick=0, long toTick=0, bool timePosition=true) |
| virtual void | MPTK_Stop (float delayRampDown, float stopDelay=0) |
| void | MPTK_ResetTranspose () |
| MPTKEvent.EnumLength | MPTK_NoteLength (MPTKEvent note) |
| MidiLoad | MPTK_Load () |
| List< MPTKEvent > | MPTK_ReadMidiEvents (long fromTicks=0, long toTicks=long.MaxValue) |
| void | MPTK_SortEvents () |
| MidiLoad | MPTK_Load (string uri) |
Public Member Functions inherited from MidiPlayerTK.MidiSynth | |
| void | MPTK_InitSynth (int channelCount=16, bool preserveChannelInfo=false, bool preserveActivVoice=true) |
| void | MPTK_InitModulators () |
| void | MPTK_ClearAllSound (bool destroyAudioSource=false, int _idSession=-1) |
| void | MPTK_DebugActiveVoice () |
| void | MPTK_DebugFreeVoice () |
| void | MPTK_ResetStat () |
| delegate void | OnAudioFrameStartHandler (double synthTime) |
| void | MPTK_StartSequencerMidi () |
| void | MPTK_StartSynth () |
| void | MPTK_StopSynth () |
| IEnumerator | MPTK_WaitAllNotesOff (int _idSession=-1) |
| void | MPTK_PlayDirectEvent (MPTKEvent midiEvent, bool playNoteOff=true) |
| void | MPTK_StopDirectEvent (MPTKEvent midiEvent) |
| void | MPTK_PauseVoices (float transitionDuration=30f) |
| void | MPTK_ResumeVoices (float transitionDuration=30f) |
Play and Stop MIDI | |
| new string | MPTK_MidiName [get, set] |
Play a Local MIDI file or from a Web site. This class must be used with the prefab MidiExternalPlayer
There is no need to writing a script. For a simple usage, all the job can be done in the prefab inspector.
But a set of methods are available in this class to drive the music from your script.
This class inherits from MidiFilePlayer and MidiSynth, so all properties, event, methods from MidiFilePlayer and MidiSynth are available in this class.
More information here: https://paxstellar.fr/midi-external-player-v2/
Exemple for loading and playing a MIDI file from a web site.
|
virtual |
Play the midi file defined with MPTK_MidiName or MPTK_MidiIndex.
| alreadyLoaded | true: the MIDI has already been loaded (see MPTK_Load() v2.9.0 |
Reimplemented from MidiPlayerTK.MidiFilePlayer.
|
getset |
Set the full path to a MIDI file to a local file with file:// or http:// to a MIDI file on a Web site. The MIDI file will be loaded and played.
See https://en.wikipedia.org/wiki/File_URI_scheme for example of URI file