Need some background information on programming sound/music.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Need some background information on programming sound/music.
I'm curious, is it possible to use some library or command line tool to get beats per minute, pick out instruments, vocal tracks etc in a song? I listen to a lot of upbeat music and I've noticed certain kinds seem to appeal to me in different ways and I'd like to know how those songs are similar.
Surely some command line tool or scriptable software exists to do this kind of thing?
In sound studio multiple recorded tracks are mixed together, usually into stereo sound. You want a tool to "unmix" it? I have an exercise for you. Take two cans of different paint. Mix them. Done? Now unmix ...
Well, there is software to filter out sounds of interest from a recording, but this will not unmix the original mix.
In sound studio multiple recorded tracks are mixed together, usually into stereo sound. You want a tool to "unmix" it? I have an exercise for you. Take two cans of different paint. Mix them. Done? Now unmix ...
Well, there is software to filter out sounds of interest from a recording, but this will not unmix the original mix.
Not necessarily unmix them, but the filtering thing sounds accurate. Like I'd love to know how it gets bassy in the song, beats per minute, how many different patterns are in the song etc. Could that be done by analyzing the EQ output?
As for detecting the different instruments, well, that's similar to making a computer solve a captcha, when you think about it. Look at files you make in LMMS in audacity, even with computer generated instruments they mix like paint, as Emerson said.
Edit: there actually are claims of software that can do this online as well, but I wouldn't get my hopes up for one that works well, even if you pay for it.
Way back in college I had a homework assignment to make a python program that would generate midi songs from a text file that listed the chords, and then plot it in a graph. That was pretty fun, and easy, so if you're interested in that sort of thing I recommend looking at the source code for some of these projects: https://wiki.python.org/moin/PythonInMusic
Last edited by crazy-yiuf; 07-06-2016 at 09:34 AM.
As for detecting the different instruments, well, that's similar to making a computer solve a captcha, when you think about it. Look at files you make in LMMS in audacity, even with computer generated instruments they mix like paint, as Emerson said.
Edit: there actually are claims of software that can do this online as well, but I wouldn't get my hopes up for one that works well, even if you pay for it.
Way back in college I had a homework assignment to make a python program that would generate midi songs from a text file that listed the chords, and then plot it in a graph. That was pretty fun, and easy, so if you're interested in that sort of thing I recommend looking at the source code for some of these projects: https://wiki.python.org/moin/PythonInMusic
Most of the drum sounds are short and at specific frequencies. Although you would probably have to tune it for each song telling it 'this is a kick drum' then calculate the BPM from that.
Most of the drum sounds are short and at specific frequencies. Although you would probably have to tune it for each song telling it 'this is a kick drum' then calculate the BPM from that.
Time domain frequency analysis with discreet Fourier transform, but mainly the computationally efficient Fast Fourier Transform. They'll beat you over the head with this in second year electronics engineering math, not sure if it's taught in CS courses that are mainly focused on why GOTO is evil, and going insane with threads, and ....
Anyway plenty of C FFT implementations are googleable.
Hi wh33t, Sorry if my last post was a little facetious.
As I've been told many times by others - if you want good (relevant) answers then a little background regarding your level of ability would be adventitious to us trying to help. Because we do want to help.
The stack exchange link I provided seems to (and I'm no expert in the field) provide some really good tools and libraries.
At any rate (assuming your not wanting to do this in real time) it seems that getting the BPM from a track is par for the course by today's standards. The sound card itself is not going to do much for you as it is generally designed to output audio, I've never seen very good (or any) DSP on the input side. So this means you'll be doing your processing on the CPU.
Complicated time signature changes (that 99% of 'popular' music does not use) are going to be harder to get. If it's a standard 4/4 signature running through the song then it should be simple. But there are many nuances in music that make this hard for a computer.... consider a song that goes from 60 bpm in the verse to 120 bpm in the chorus, how does the computer know what element to look for.. RE: Nyquist sampling theorem
Hi wh33t, Sorry if my last post was a little facetious.
As I've been told many times by others - if you want good (relevant) answers then a little background regarding your level of ability would be adventitious to us trying to help. Because we do want to help.
The stack exchange link I provided seems to (and I'm no expert in the field) provide some really good tools and libraries.
At any rate (assuming your not wanting to do this in real time) it seems that getting the BPM from a track is par for the course by today's standards. The sound card itself is not going to do much for you as it is generally designed to output audio, I've never seen very good (or any) DSP on the input side. So this means you'll be doing your processing on the CPU.
Complicated time signature changes (that 99% of 'popular' music does not use) are going to be harder to get. If it's a standard 4/4 signature running through the song then it should be simple. But there are many nuances in music that make this hard for a computer.... consider a song that goes from 60 bpm in the verse to 120 bpm in the chorus, how does the computer know what element to look for.. RE: Nyquist sampling theorem
Where and what is the chorus? Many of the rhythmic changes are in the guitars rather then the drums... It's all over the place
That's such a dope song. Love me some Rage.
Mostly this music is just what I use to work out to (I break dance and nunchuk for fitness, used to be a teacher of it, now I'm old and just want to stay in shape and enjoy the passion) while my nerd career takes off. Most of the dancey music I'm listening to is the typical "rock'n'roll" 4/4 timing. My preferred style of dance tends to benefit from highly repetitive rhythms in order to make it predictable. I feel like because this kind of music is so simple (perhaps I'm being ignorant here) it should be fairly straight forward to create some kind of random groovy beat generator. I've got a few music friends who studied music in university and they seem to think if I had a bunch of sound files (specifically drum sounds) this shouldn't be too difficult.
My knowledge of Math stopped somewhere in high school shortly after learning about Quadratics. I'm not a Math pro at all, but I have written many thousands of lines of C-syntax like scripts. So I'm thinking Python might be a good place to start.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.