Midi Player Tool Kit is a package for Unity able to play music from Midi files or Midi Stream in your application. There is no need of external component or device.
Thank to SoundFont for adding hundred sounds of instruments for playing Midi files.
Please, visit also the Unity store:
- Play music from Midi files in your Unity application without any C# or JS scripting. Specific inspectors defined all your needs directly in Unity editor.
- Play generated music in your Unity application and reuse hundreds wave from Soundfont.
- Add Midi Audio Source Prefab in your scene as much as you want.
- Add Midi files (from the web or from your composition) as much as you want.
- Play / Paused automatically based on distance.
- A component is able to write Midi file [Pro]. From your Midi stream, Midi player, …
- Midi File Player
- Midi Stream Player
- Midi Play List [Pro]
- Unity Events to process Midi Events:
- Start playing Midi file
- New notes available from Midi file playing
- End playing Midi file
- An API is available to integrate MPTK in your application for more complex interactions.
Many examples are available in the package:
- TestMidiFilePlayerSimple: a very simple example with only one MidiFilePlayer prefab to play Midi music. An example of integration without any scripting.
- TestMidiFilePlayerMulti: four MidiFilePlayer prefabs on a scene with the camera moving on each to experiments the « Playing on distance » function.
- TestMidiFilePlayerWithScript: how to integrate MPTK by script in your application. Use of the MPTK API.
- TestMidiStreamSimple: how to generate music without any Midi files in a few lines of code.
- CatchMusic: music comes from a MidiFilePlayer but is delayed in time. Could become a game !
- InfinityMusic: music is generated with simple algorithm. Could become a more complex application to generate music.
- TestMidiPlayList: demonstration of the prefab able to play a list of Midi files [Pro]
- TestMidiWriter: demonstration of four methods how writing Midi files with MPTK [Pro]
MPTK is designed to be used for gaming with weak devices which implied some choices.
- Some instruments in SoundFont, are using more of one waves to play one midi event. MPTK will plays all the waves associated to the note or only the first found. A parameter lets you make your choice.
- Panoramic sounds are defined in SoundFont and in Midi files. For some games it’s better to manage right/left (for example to localize an object). A parameter lets you make your choice.
- Complex SoundFont effect are not yet implemented (reverb, chorus …) to avoid high CPU impact. Could be added in a future version. Have your say!