Quick Start

How to add Midi musics in your application in a few steps.

Case 1: if you have a project with MPTK V1, please follow this tutorial to migrate from V1 to V2.

Case 2: if you are updating an existing project inside a V2, some older classes will remain in the MidiPlayer folders (Unity import won’t removed these files when importing the new version) and you will get tricky issues. Please follow this first steps:

  • backup your project,
  • remove the entire current version of MidiPlayer in the Unity Editor project panel.
  • go to 1.1 bullet below.

Case 3: if you are starting a new projet go to 1.1 bullet bellow.

1- Project

1.1 – Download Free Midi Player Tool Kit or download Pro Midi Player Tool Kit .

1.2 – Import Unity package in your Unity application, you will get something like this in your project:

Tips : Free version comes with a default SoundFont (GeneralUser_GS_SoftSynth_v144) and some examples of Midi files. However, you can delete all the Midi files and add your favorites (see Midi Player Tool Kit Setup below).

Tips : Pro version comes with no SoundFont and no Midi file. See why here. Please. Have a look to theses pages to understand How to add Midi file and How to add SoundFonts before beginning this quick start.

Recommendations: to ease installation of futures updates of MPTK (a lot of great functions are forecasted!), please follow these rules:

  • Create your assets apart of the MPTK assets.
  • Don’t change anything in MPTK scripts or hierarchy.
  • Don’t change anything in Prefab.
  • Use only documented API.

SoundFont(R) is a registered trademark of E-mu Systems, Inc.

2 – Hierarchy

If you already added Midi files and SoundFont in MPTK, you can continue with the actions below.

If not, have a look here how to  Add Midi files and  how to Add SoundFonts.

But if you have migrated from V1, SoundFont must be re-imported because the format is totally different.

2.1 – Add to your Unity hierarchy, one or more “MidiFilePlayer” Prefab from “Asset/MidiPlayer/Prefab”. Each one can plays a different Midi file.

2.2 – Check that you have an AudioListener component somewhere in your hierarchy, typically associated with the “Main Camera”.

3 – From the MidiFilePlayer Inspector

3.1 – Select one MidiFilePlayer in the hierarchy, then look at the Inspector:

3.2.1 – Select the Midi File to play. If no Midi is available, see How to add Midi file.

3.2.2 – Check ​”Play On Start”.

3.2.3 – It’s over! Run your Unity application, the Midi begins to play!

Play with the parameters available or go here to have a description of all parameters.