I'm in a Music Theory class and for my final, I've decided to code a program that would output simple statistics about a given song. I was wondering, does anybody have any good libraries for such a task? I don't really like C++ or C, but if I'm forced to use them, I will.
I've tried MIT's Music21 for Python (I was excited, as I liked its features), but I never got it to work... Are there any libraries that can just give me raw data (frequencies plotted in time) of any given MP3 file? Thanks!
To find frequencies plotted in time with code you will probably have to do some frequency-domain transformations to obtain that, such as FFT or wavelets. What you obtain as raw data in an audio file is a discrete signal of time-varying voltage. Python has a built-in library for wav files, and with numpy you can do the FFT analysis on the signal. One suggestion I have is PureData (http://puredata.info/) , a visual programming environment for musical purposes. That software will help you a lot, and save you a lot of trouble with the DSP part of music software development. With PureData, you can use frequencies plotted in time easily. If the idea is to develop something for a music theory class, it is a great solution.
libsndfile for C/C++ is good, but maybe a bit low-level. What are you planning on doing with it?
You can look at javax.sound.sampled
for Java too.
Unless your are familiar with graphical programming languages (pd, max, reaktor) i'd recommend SuperCollider. It has an fft library, reasonable gui/graphics libraries, but its real strength lies in the SmallTalk language its based in, which provides rich Functional and Object Oriented facilities. I find this system a real joy to work with. It comes with an interactive interpreter which helps where development is more ad hoc than structured.
Try it, you might like it.
精彩评论