tags:

views:

222

answers:

4

Are there any modules in Python that help us to construct or obtain the musical notes and octaves from a given original song?

Thanks for the help

+2  A: 

This question has far too few details to give any kind of meaningful answers.

Questions:

  • By song file, do you mean like an MP3?
  • Is it a "song" or a "instrumental"? I would gather trying to decipher notes behind a voice would be harder
  • Is it a simple song, like a single voice played on a simple instrument, like a piano or a flute? Or is it a complex one, like any of the latest hits played on the radio?

I would think that trying to get a good output from such a program would be extremely hard for anything but the simplest of things.

Having said that, look at the Fast Fourier Transform, it can give you a frequency spectrum of things played, but it'll be hard trying to determine what is what from that.

Lasse V. Karlsen
Yes, use FFT to obtain the frequencies for a given window of the audio file and then compare them to a list of notes. For example, according to wikipedia the note C (middle C) has a frequency of 261.626 hertz. I wouldn't expect great results from a complex sound file though
Dan
+2  A: 

As lassevk mentioned, this is a complex topic - a bit like reconstructing C code from assembly, in a way. That being said, a nice framework to play with audio stuff is CLAM:

http://clam.iua.upf.edu/

It is an open source C++ framework for music/audio algorithms prototyping, but there are python wrappers, and graphical tools for prototyping.

David Cournapeau
+2  A: 

I think what you are interested in is still topic of research. You won't find any module ready that will do that for you.

Besides it is not clear what you mean with "notes and octaves"? What information exaclty would you like to extract?

0xA3
A: 

There are some libraries for Python. Start with this FSF listing for Audio Misc.

There are, however, excellent products: See Transcribe! and TwelveKeys. Also see Transcribe Software List.

S.Lott