Prefab MidiListPlayer

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 exists for a more complex integration in your application.
  • See an example with source code at the end of this page.

Inspector parameters

Overlap time in milliseconds of overlap between two Midi. The end of the current Midi gently overlaps the start of the next Midi.

Play On Start if checked, start playing when your application start.

Loop on the List if checked, restart playing automatically at the first when the end of the Midi list is reached.

Add a new entry to the list
Remove the selected entry
Move Up the selected entry
Move Down the selected entry

When running:

Integrated MidiFilePlayer

In the MidiListPlayer, select MidiFilePlayer_1, the classical MidiFilePlayer Inspector is displayed.

See here for the description of each attributes and folders.

Integration of MidiListPlayer in your script

See TestMidiListPlayer.cs and events associated in the canvas gameobjects of TestListMidiPlay scene for the whole example.

using MidiPlayerTK;
...
// MPTK component able to play a Midi list. 
// This PreFab must be present in your scene.
/// </summary>
public MidiListPlayer midiListPlayer;
...
private void Start()
{
   if (!HelperDemo.CheckSFExists()) return;
 // Find the Midi external component 
    if (midiListPlayer == null)
    {
       Debug.Log("No MidiListPlayer defined with the editor inspector, try to find one");
       MidiListPlayer fp = FindFirstObjectByType<MidiListPlayer>();
       if (fp == null)
          Debug.Log("Can't find a MidiListPlayer in the Hierarchy. No music will be played");
       else
          midiListPlayer = fp;
}

// This method is fired from button
public void Next()
{
   midiListPlayer.MPTK_Next();
}

Get Creative Tools from the Unity store

If you enjoy these creative tools, please leave a review on the Unity Asset Store! Your feedback and support motivate me to keep improving them and creating new features.

Skills for AI assistants

Maestro MPTK now includes AI Skills to help your favorite AI assistant build projects with Maestro! Don’t miss this detailed guide.

AI Skills for Creature Kit are in development.

Note: The custom MPTK LLM has been deprecated.

Contact

If you have questions, please don’t hesitate to contact us via the dedicated Unity forum or our Discord  channel.

Reach the Discord archive by topic.

We are always happy to discuss your projects!

Creature Kit – Wild Beasts Demo

Creature Kit – Beast Generator – Creating a Beast in Unity

Add MIDI Music With 3 Clicks for Free

Midi Synth : Real Time Voice Effect Change

Sound Spatialisation, MPTK is ready for Virtual Reality [Pro]

Euclidean Rhythm demo

Demo on itch!