2

I'm creating a simple midi based game in C and I am wondering if there are any libraries to load a midi file, play and also manipulate it by getting the note values.

Thanks in advance!

3 Answers 3

1

Check SDL. More especifically, SDL_mixer.

Description: SDL_mixer is a sample multi-channel audio mixer library. It supports any number of simultaneously playing channels of 16 bit stereo audio, plus a single channel of music, mixed by the popular MikMod MOD, Timidity MIDI, Ogg Vorbis, and SMPEG MP3 libraries.

1
  • Thanks, I've used SDL_Mixer in the past just not realised it has support for MIDI as well.
    – Tom Leese
    Jun 16, 2011 at 16:12
1

If you want to manipulate the MIDI and process its contents yourself rather than just playing it, SDL_Mixer might not be what you want. In this case I would just read the spec and write your own code. MIDI is an extremely simple format and you can probably write whatever code you need in 15 minutes or so... :-)

1
  • 1
    Yes - but how to generate the sound after parsing events :)
    – paulm
    Apr 16, 2015 at 21:50
0

I realize this question has already been answered, but I would have to agree with @R.. in that SDL is probably overkill for what you are trying to do. You should also take a look at jdksmidi, a much smaller MIDI library written in C++.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.