Play MIDI files and synchronize time with visual effects using WPF

I am writing an application using the C # / Windows Presentation Foundation. He visualizes dance steps with leg shapes. I am currently playing music as a WAV file and setting steps using a timer.

Due to the bumps in the timer, the music does not sync with the steps. I need some synchronization , so I wanted to use MIDI files .

To synchronize the steps, I need an event for each time in the music, and then display the next step. In this case, I will no longer use the Timer.

I already looked at NAudio . I found tutorials for playing MP3 files that don't help me. I created a MidiFile object , but I do not know how to play it. I know that a MIDI file contains information on how to play music (for synthesizers), but I do not want to implement my own player.

  • What is an easy way to play a MIDI file using NAudio?

  • How can I receive events at every moment of music?

  • Is there an alternative for NAudio that can help me better?

  • Is there an alternative to MIDI that can sync with my visualization?

I am grateful for any help. I have been looking for some time and I think that I may be looking in the wrong direction.

+4
source share
1 answer

If you want to get deeper into midi, it would look like a pretty cool library and source code to learn.

http://code.google.com/p/midi-dot-net/

+1
source

All Articles