Midi Sequencing in C