Quick Start

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

if you are starting a new project go to 1.1 bullet bellow.

if you are updating Midi Player ToolKit, some older classes will remain in the folders because Unity import won’t removed these files and you will get tricky issues. Consequently, please follow this steps:

  1. backup your project,
  2. remove the entire current version in the Unity Editor project panel (remove folder MidiPlayer).
  3. and go to 1.1 bullet below.

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) even with the free version 😉

Tips : Pro version comes with no SoundFont and no Midi file. See why here. 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:

  1. Create your assets apart of the MidiPlayer assets folder.
  2. Don’t change anything in MPTK scripts or hierarchy.
  3. Don’t change anything in Prefab.
  4. Use only documented API.

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

2 – Hierarchy

If you already have 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.

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

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

3 – From the MidiFilePlayer Inspector

3.1 – Firstly, select one MidiFilePlayer in the hierarchy, then look at the Inspector.

3.2.1 – Secondly, select the Midi File to play. But, if no Midi is available, see How to add Midi file.

3.2.2 – Most importantly, check ​that “Play At Startup” and “Send To Synth” are selected (default value).

3.2.3 – It’s over! Now you can run your Unity application, the Midi begins to play!

After that, you can play with the parameters available in the inspector. You can also going here to have a description of all parameters.