Click here to Skip to main content
15,914,016 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
Hey guys,

I have this question about creating an application that would map the melodies in a music audio file to notes such as (C,D,E,...).

The problem is like this, mostly when you learn to play a certain musical instrument you are expected to hear a certain song or tune and you try to play that song on your instrument.

To achieve this you need to train your ears to recognize the notes being played; but this takes hours of practice and patience.
What i am looking for is how can one write a program that would take a recorded audio file and produce the notes being played in the file accordingly.

Here is what i am thinking
1.one can take samples of the audio
2.Compute the FFT of the signal
3.Perform time Vs frequency analysis so that we can know which note was played at a particular time
4.And finally convert the frequencies to musical notes representation.

So how can one do this using C# or is there a better approach to achieving this; if you can direct me to links which might be helpful i will be most grateful!

cheers

heleiance
Posted
Updated 7-Mar-11 21:11pm
v2
Comments
Dalek Dave 8-Mar-11 3:11am    
Edited for Grammar and Readability.
(Also, a good question!)

1 solution

This is quite a difficult project, because usually the spectrum of the voice of real-life instrument is full of noise and main tone if floating. So, it will not be just "frequency analysis", it will be real image recognition task, pretty hard to solve. I'm familiar with existing musical applications doing that: the quality of recognition is quite poor in all products I know (my very modest musical hearing is orders of magnitude better :-)). One of the biggest problems is the fast change in spectrum in comparably short periods of time.

There are a number of good works on separate components like FFT (which in not the hardest part), such as this: http://www.extremeoptimization.com/solutions/FastFourierTransformsFft.aspx[^]. I also know a short CodeProject article: How to implement the FFT algorithm[^].

So idea is generally good, but — no offence — I'm quite a bit skeptical about your prospect to make a big success.

—SA
 
Share this answer
 
v2
Comments
Dalek Dave 8-Mar-11 3:13am    
Sage advice and a good answer.
There is far more to music than just the notes.
There is pitch, sustain, duration, timbre, beat etc.

This is why musicians take so long to get any good.
Sergey Alexandrovich Kryukov 8-Mar-11 3:23am    
Thank you, Dalek.
You're right, but the idea is not to support all aspects of music, but recognize just the pitches abstracted for everything else. And this is already very difficult, something like recognizing a tiger behind bamboo. Quite a while ago I tried to use the help of such applications to study musical... how to call it? well, harmonic and melodic patterns... or try to record and later analyze improvisation, results were frustrating. Technology is not actively developed in this direction...
--SA
phil.o 3-Dec-15 16:14pm    
That reminds me of a youtube video I once saw; someone made a robot play some Coltrane's song from a transcription. That was awful ^^ Robots should not play John Coltrane's tracks...
Sergey Alexandrovich Kryukov 3-Dec-15 16:29pm    
:-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900