Guild icon
Maestro - Midi Player Tool Kit
Salons textuels / midi-list-player-how-to
Avatar
MidiListPlayer is a Prefab, available with the Pro version, able to play Midi music from a list of Midi from your MPTK database in Unity. Furthermore, you can play part of a Midi files, overlap, loop. This Prefab is available with MPTK Pro. No line of script is necessary to use this Prefab. An API […]
❤️ 1
08:42
Look at the web site for more information on this component
08:43
See TestMidiListPlayer.cs for the whole example of an integration by script.
08:44
Declare a MidiListPlayer in your script:
08:44
/// <summary> /// MPTK component able to play a Midi list. This PreFab must be present in your scene. /// </summary> public MidiListPlayer midiListPlayer; (edited)
08:45
then search the prefab in the current scene
08:46
midiListPlayer = FindObjectOfType<MidiListPlayer>();
08:46
generraly do this in the Start() function
08:46
then you can add listener:
08:48
// Call when a MIDI is starting playing midiListPlayer.OnEventStartPlayMidi.AddListener(StartPlay); // Call when a MIDI is ending playing midiListPlayer.OnEventEndPlayMidi.AddListener(EndPlay); (edited)
08:49
public void StartPlay(string name) { Debug.Log("Start Play Midi '" + name); }
08:50
Want to create a new list ?
08:50
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; }
Avatar
Deleted User 29/07/2021 18:45
Hello! I am doing a project and I would like to know if I can choose a patch (0 to 127 from general midi instrument list) from a MIDI file to play only this instrument and how could I do it. I mean, for example, in a midi file I have a piano, a guitar and violin, etc. I can run the midi file with the MidiFilePlayer script, but could it be possible to separate this midi file (without preprocessing) and play only the part (patch) of the piano if the camera detects the piano?
Avatar
Avatar
Deleted User
Hello! I am doing a project and I would like to know if I can choose a patch (0 to 127 from general midi instrument list) from a MIDI file to play only this instrument and how could I do it. I mean, for example, in a midi file I have a piano, a guitar and violin, etc. I can run the midi file with the MidiFilePlayer script, but could it be possible to separate this midi file (without preprocessing) and play only the part (patch) of the piano if the camera detects the piano?
Hello Juan, yes you can if instruments are well defined by MIDI channel (it's the case generally). By script for each channels, you can "force" instrument, mute, set volume. I will make a short demo with a video. (edited)
Avatar
Deleted User 30/07/2021 18:16
Thank you very much! I will appreciate it
18:58
enjoy!
Avatar
Hello! I'm Varun, a VR Developer. Is anyone working with Maestro - Midi Player Tool Kit for Stand-Alone VR?
Exported 19 message(s)
Timezone: UTC+1