How to load MIDI file and retrieve played notes

So my question is divided in 2 groups
First one is kinda noob, but it’s because i’ve been using FMOD just for a few days and spent on research for this issue:

  1. How can I load a MIDI file in FMod? I just can’t drag it into the audio track. I researched a little bit and maybe i need to load first a custom sound bank such as gm.dls?
  2. Once the MIDI file is played, is there a way to retrieve the information of the played notes and store them in variables?

Hi Kamal,

If you are using an FMOD Studio project, you will need to use a Programmer Instrument in the timeline and then add the MIDI file into your game code where FMOD::Sound would normally be loaded. Take a look in the Studio API example Visual Studio project (available in downloads) at the programmer_sounds project. There currently isn’t a way to add a MIDI file directly into an FMOD Studio project.

If you are using the low-level API you can simply load the MIDI file into an FMOD::Sound and it will work there.

https://www.fmod.com/resources/documentation-api?page=content/generated/FMOD_System_CreateSound.html#/

FMOD can only read and playback MIDI files so the only function available to get information is just about how long the MIDI file is:

https://www.fmod.com/resources/documentation-api?page=content/generated/FMOD_Sound_GetLength.html#/

You would need either a custom script or third party program to provide you with information on what notes are being played.

Thanks,
Richard