title: Reading midi-files
body: <p>I'm trying to help out a friend creating a program. And we need to read some midi-file data. I've searched for a good 2 hours now and I can't really seem to find any straight forward ways of doing it.</p>
  
  <p>I've downloaded and hopefully installed SDL_mixer correctly. And managed to play a song with this:</p>
  
  <pre><code>//Initialize sound
  SDL_Init(SDL_INIT_AUDIO);
  Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 1024);
  Mix_VolumeMusic(100);
  
  //Load song
  string midiFile = LIB_AUDIO + "redlottery.mid";
  Mix_Music *song = Mix_LoadMUS(midiFile.c_str());
  
  //Play song
  Mix_PlayMusic(song, 1);
  </code></pre>
  
  <p>So, what I'm wondering is... Is it possible to extract data using this?
  I need things like, note timings. I don't really know how they are structured, but I want to access data. How do you suggest I try doing that?</p>
  
  <p>Thanks!</p>