- Home /
Parse music files for specific notes (DDR-style game)
Hello all!
I'm making an interactive display for my college in which people walk in front of an Xbox Kinect attached to a projector and play a music sequence one note at a time by hitting the onscreen notes with their hands. The requirement for the project is to have 10 songs to play, and while I could hard code in the note sequence, I wanted to know if there was any package that could parse an .mp3 or a .wav and pull out basic notes. Something that would be useful in making a Dance Dance Revolution or Guitar Hero style game.
This would really help if we wanted to add more songs to the display later, or if we wanted to change the theme of the songs for holidays.
Thanks!
Answer by DaveA · Nov 21, 2012 at 01:44 AM
Deconstructing music from a music file is hard stuff. Attempts have been made, google it (you would not find it in Unity). Unity does have an audio spectrum analysis API but it would only work for the simplest songs (a single flute playing a melody, MAYBE).
I would suggest looking at MIDI files. They should be easy to find or create. Then you can sync the MIDI performance more easily to what's on screen. If the MIDI file is a very good reproduction of the MP3 or Wav rendition, you could start both at the same time (MIDI would be silent, the other would play out loud) use the MIDI data as the notes you're looking to hit.
Answer by ShawnFeatherly · Jan 12, 2015 at 10:42 PM
I agree MIDI is the way to go. To parse the MIDI file you can either:
Do it yourself using the spec: http://faydoc.tripod.com/formats/mid.htm
Try to find a library that handles midi file parsing. Here's one, but I haven't tested it: https://github.com/tebjan/Sanford.Multimedia.Midi
Your answer
