Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Music Transcription of Wav files in Java [closed]

I have project about music transcription using Java, the thing is,, I have created an applet that records sound and saves it into a WAV file, the player should only play the piece he/she would like to transcribe, after that I am stuck at the point were I have to get information from the saved WAV file and use this information to create a MIDI file,, and after creating the MIDI file I have to generate a Musical Score for it (Sheet Music) and all these must be done in Java.

I searched everywhere for a clear explanation on how these stuff can be done, but I did not find anything direct :( since I am new to Java, I would like anybody to help me with this please, the topics that I am having trouble programming are:

  1. Getting information about notes being played in the WAV file.
  2. Knowing the Notes.
  3. Creating a MIDI file equivalent to the WAV file.
  4. Generate a SCORE from the MIDI file.

I have also tried Fast Fourier Transform after performing Segmentation on the data being read, but I think that went absolutely in the wrong direction :(

Please if anybody can help me on the topics specified above, and how to program these only in Java, it would be really highly appreciated :)

By the way, the project is:
Player plays notes on Piano >> Records his playing >> Player gets the SCORE of his playing.

like image 346
Xtremeaiy Avatar asked Feb 07 '11 08:02

Xtremeaiy


2 Answers

I am by no means an expert in this area, so I apologise in advance if this is all rubbish.

To get the notes from the file, I think you need to do an FFT (Fast Fourier Transform) on the WAV file, but with only like 10ms of sound at a time. Then you find the highest peak on the FFT for that time frame, and move on to the next "frame" of 10ms, or whatever. You do the FFT again, and if the highest peak is a different frequency to the previous peak, then it will say it's a new note. To see how long the notes are, count the number of peaks within a certain threshold of each other and multiply them by the time you are using for each frame (10ms, etc)

I will say again, I am not expert and there are probably other ways of doing it.

That aside, I hope this helps... even a little.

like image 78
Bojangles Avatar answered Nov 10 '22 04:11

Bojangles


I am not an expert in that area but once I was playing a little bit with Xuggler (java ffmpeg wrapper). This library was able to extract lots of interesting data from the media file, allows file transcoding and many other cool features. Here is the link: http://www.xuggle.com/xuggler/

like image 29
Marcin Michalski Avatar answered Nov 10 '22 02:11

Marcin Michalski