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 | |
MidiLoad | MPTK_Load () |
MidiLoad | MPTK_Load (string uri) |
void | MPTK_Next () |
MPTKEvent.EnumLength | MPTK_NoteLength (MPTKEvent note) |
void | MPTK_Pause (float timeToPauseMS=-1f) |
virtual void | MPTK_Play (bool alreadyLoaded=false) |
void | MPTK_Play (byte[] data) |
virtual void | MPTK_Play (float delayRampUp, float startDelay=0) |
void | MPTK_Play (MPTKWriter mfw2, float delayRampUp=0f, float fromPosition=0, float toPosition=0, long fromTick=0, long toTick=0, bool timePosition=true) |
void | MPTK_PlayNextOrPrevious (int offset) |
void | MPTK_Previous () |
List< MPTKEvent > | MPTK_ReadMidiEvents (long fromTicks=0, long toTicks=long.MaxValue) |
void | MPTK_RePlay () |
bool | MPTK_SearchMidiToPlay (string searchPartOfName) |
void | MPTK_SortEvents () |
void | MPTK_Stop (bool stopAllSound=true) |
virtual void | MPTK_Stop (float delayRampDown, float stopDelay=0) |
void | MPTK_SwitchMidiWithDelay (int index, string name, float volume, float delayToStopMillisecond, float delayToStartMillisecond) |
void | MPTK_UnPause () |
Public Member Functions inherited from MidiPlayerTK.MidiSynth | |
void | MPTK_ClearAllSound (bool destroyAudioSource=false, int _idSession=-1) |
void | MPTK_InitSynth (int channelCount=16, bool preserveChannelInfo=false) |
void | MPTK_ResetStat () |
void | MPTK_StartSequencerMidi () |
void | MPTK_StartSynth () |
void | MPTK_StopSynth () |
IEnumerator | MPTK_WaitAllNotesOff (int _idSession=-1) |
delegate void | OnAudioFrameStartHandler (double synthTime) |
Properties | |
new string | MPTK_MidiName [get, set] |
Properties inherited from MidiPlayerTK.MidiFilePlayer | |
MPTKChannels | MPTK_Channels [get] |
Description and list of MIDI Channels associated to the MIDI synth. Each MIDI synth has 16 channels that carry all the relevant MIDI information. More... | |
string | MPTK_Copyright [get] |
int | MPTK_DeltaTicksPerQuarterNote [get] |
TimeSpan | MPTK_Duration [get] |
float | MPTK_DurationMS [get] |
bool | MPTK_ExtendedText [get, set] |
bool | MPTK_IsPaused [get] |
bool | MPTK_IsPlaying [get] |
bool | MPTK_KeepEndTrack [get, set] |
bool | MPTK_KeepNoteOff [get, set] |
MPTKEvent | MPTK_LastEventPlayed [get] |
bool | MPTK_Loop [get, set] |
bool | MPTK_MidiAutoRestart [get, set] |
List< MPTKEvent > | MPTK_MidiEvents [get] |
int | MPTK_MidiIndex [get, set] |
MidiLoad | MPTK_MidiLoaded [get] |
virtual string | MPTK_MidiName [get, set] |
bool | MPTK_PlayOnStart [get, set] |
TimeSpan | MPTK_PlayTime [get] |
double | MPTK_Position [get, set] |
double | MPTK_PositionFirstNote [get] |
double | MPTK_PositionLastNote [get] |
string | MPTK_ProgramName [get] |
double | MPTK_Pulse [get] |
int | MPTK_Quantization [get, set] |
bool | MPTK_RawSeek [get, set] |
double | MPTK_RealTime [get] |
string | MPTK_SequenceTrackName [get] |
float | MPTK_Speed [get, set] |
double | MPTK_Tempo [get, set] |
string | MPTK_TextEvent [get] |
long | MPTK_TickCurrent [get, set] |
long | MPTK_TickFirstNote [get] |
long | MPTK_TickLast [get] |
long | MPTK_TickLastNote [get] |
int | MPTK_TrackCount [get] |
string | MPTK_TrackInstrumentName [get] |
Properties inherited from MidiPlayerTK.MidiSynth | |
int | MPTK_IndexSynthBuffSize [get, set] |
int | MPTK_IndexSynthRate [get, set] |
string | MPTK_InstrumentPlayed [get] |
bool | MPTK_IsSpatialSynthMaster [get] |
bool | MPTK_KeepPlayingNonLooped [get, set] |
float | MPTK_MaxDistance [get, set] |
bool | MPTK_PauseOnDistance [get, set] |
bool | MPTK_Spatialize [get, set] |
int | MPTK_SpatialSynthIndex [get] |
int | MPTK_SynthRate [get, set] |
int | MPTK_ThreadMidiPriority [get, set] |
string | MPTK_TrackName [get] |
int | MPTK_TransExcludedChannel [get, set] |
int | MPTK_Transpose [get, set] |
float | MPTK_Volume [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 |
Full path to Midi file or URL to play. Must start with file:// or http:// or https://.
Example: MPTK_MidiName="http://www.midiworld.com/midis/other/c2/bolero.mid";
See https://en.wikipedia.org/wiki/File_URI_scheme for example of URI file