I am integrating FMOD in a game (Sansar). Currently I can play a midi file which I assumes is playing the midi file using a DLS instrument. A few questions before I dive into the low level programming:
- Can you load your own DLS (For example a custom SF2 file of mine converted to DLS)?
- If you can load that, how do you point the MIDI file being played to that DLS instrument instead of the default one?
- Can you play a note from the DLS instrument directly in code rather than bringing in a precanned midi file?
That being said, what I am trying to do is build an instrument in the game. I have it working and it plays a sample with an offset for an instrument (say a piano). The problem I have since it is just playing the sample it only plays for the length of the sample (i.e. it doesn’t play the loopable portion that is available by looking in the WAV file and playing it like a DLS or SF2 instrument. So, I am looking for a way that the sound will keep playing as long as I am pressing the key down on my keyboard and when I release it will stop playing the loopable portion of the WAV file. So, I am hoping to somehow get at the DLS instrument directly with code commands instead of it just being a simple midi player.