Question

I want to learn how to program a music application that will analyze songs.

How would I get started in this and is there a library for analyzing soundwaves?

I know C, C++, Java, Python, some assembly, and some Perl.

Related question: Algorithm for music imitation

Was it helpful?

Solution

Composition and analysis of music by computer is a huge field. There are two basic areas in this type of work, which overlap somewhat.

Many, many libraries, tools and specialised programming languages exist which can help with different parts of these problems. Here's a list of music-related programs and libraries for Python. There is a lot of technology available; you should be able to find something that will do the brunt of the work for you. Reimplementing a 'musical parser' through very low-level frequency analysis tools such as Fourier Transforms, as other answers have suggested, while possible, will be quite difficult and is almost certainly unnecessary.

For further advice and specific questions, the International Society for Music Information Retrieval has a mailing list which you would probably find very helpful.

OTHER TIPS

Once you get past the FFT stuff that Lennart mentioned, you might want to have a look at Markov chains for analyzing intervals between notes, and aggregated patterns.

This is kind of treaded ground, but Markov chains have been used in the past to build a kind of statistical model of melodies from various songs which can be used to generate new melodies. Markov chains can do the same with written english sentences. For an example of how that looks, have a play with the megahal chatterbot to see how markov chains can produce mangled output that statistically looks like its input (in megahal's case, it looks like english sentences)

You could concievably mash up the top 100, and have a markov chain generator blast out the next big hit.

On the other hand, you may want to consider the possibility that it is not any quality of the music itself that makes a song popular. Or perhaps it is a quality of music issue combined with marketing.

To analyze soundwaves you need some sort of fourier transformation (fft), so you can split the song up into it's frequencies and how they change over time. There exists fft support in numpy, I haven't used it, so I don't know if it's any good. But it would be a great place to start.

After that you then need to make some sort of statistical analysis on frequencies and patterns, and then I no longer have any clue what I'm talking about.

Cool stuff though, go for it!

You may like to start by looking at the MIDI format, it's reasonable simple compared to the compressed formats, and you can generate some nice things in it.

Depends what you want to do really.

There's the Echo Nest remix API that lets you analyze and manipulate music in Python. Some examples here: Where's the pow and here: You make me quantized miss lizzie. There's a nifty tutorial here: An overview of the Echo Nest API

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top