PDA

View Full Version : Guessing musical genres algorithmically


Asher
12-11-2003, 08:58:01
http://members.shaw.ca/asher19/fft2.png
Explanation:
The "Time Domain" window at the top is the general form of the waveform. So large spikes either up or down are beats, etc.
The bottom window is the window that has the fast-fourier transform (1 dimension). It analyzes the waveform from above and breaks it down into frequency. So the X-axis is frequencies and the Y-axis is their occurance rate.

Since Techno is synthesized, it has very "clean" spikes in the FFT. That's its main charateristic.
Classical has a huge audible spectrum compared to Rock or Techno, due to the number instruments involved.
Rock has huge amounts of distortion (even the slower songs like "The World I Know" by Collective Soul that I tested). So the FFT is very very densely jagged.

The red dots on the FFT show the peaks we're looking at, which are automatically detected.

It's not even done yet, still got to do the waveform analysis tomorrow before it's due.

This is the product of only 3 days of work.

Is it not sexy?

It's even crazy-fast while being saddled by the Java demons.

Research projects are fun. :bouncmsk:

Asher
12-11-2003, 09:00:54
FFT computation benchmarks for a 100KB wav file:

IBM ThinkPad T40 (1.5GHz Pentium M): 30ms
(My partner's) new PowerBook 15" (1.25GHz G4): 450ms

Go Apple.

johngalt
12-11-2003, 23:40:49
lmfao - I'd love to take a whiff at this program.

I currently have 27 GB of music files , around 4500+ files, and lots of the techno section are actually continuous 1 or 2 hour live streams that have been posted to the newsgroups.

Asher
13-11-2003, 06:00:27
Bring it on, motherfucker.

Scabrous Birdseed
13-11-2003, 08:45:51
What if you plug a genre in there that's not on there? Say a hip-hop track.

Asher
13-11-2003, 08:48:04
You'd need to wait for version 2.0.

And I'd say it'd vary on the type of hip hop.

Funkodrom
13-11-2003, 08:59:33
Asher:

Algorhythmically.

How could you not use that?

Asher
13-11-2003, 09:01:37
The man invented the internet, leave him alone.

Scabrous Birdseed
13-11-2003, 09:05:00
Try Rhythm is Rhythm - Strings of Life (Classic techno track)

Asher
13-11-2003, 09:22:15
Yup, it's techno:
http://members.shaw.ca/davemilford/stringsoflife.png

Funkodrom
13-11-2003, 09:25:46
How does it classify hip hop?

Asher
13-11-2003, 09:28:42
It doesn't, yet.

And I haven't devised possible metrics for that, I don't listen to enough hip hop.

I reckon it'd be trickier.

These 3 genres were chosen because they are among the most basic to differentiate.

If there was more time we'd add more, but it was due 2.5 hours ago and it was mostly a proof of concept for a very general idea.

Asher
13-11-2003, 09:31:09
The assignment was basically to work with non-text data and extract information about it (images, audio, etc.). Everyone did something completely different and completely of their own idea (research proposal). The prof told us she didn't expect us to get anything actually working, just to try and most of our marks would be in a post-mortem explaining what what wrong and what we'd do differently next time.

I don't know what we'll do with a working program. :D

Funkodrom
13-11-2003, 09:45:08
Yeah, I get that, I was just wondering what it came up with without you programming it to recognise it.

Looks like you did a good program though. :)

johngalt
14-11-2003, 03:50:33
I wasn't trying to be a smartass - I was being dead serious. I have over 4500 music files, and it occupies 27 GB on my laptop (an old laptop so it has become a music server for me).

I was also being serious at attempting to run the program on random files in my collection - I listen to things like Evanescence, Linkin Park, Coal Chamber, Shakira, lots and lots and lots of techno, and other stuff.

I can provide files, but I need to know two things:


Does it required compressed files (.MP3, .wma, etc) or uncompressed ,raw files?
Can I try th e program, or do I have to provide you with the music files, or do I need to simply give you a name and let you find it?

johngalt
14-11-2003, 03:53:42
oh, and I have a P4 2.0(A) GHz Northwood (512 KB L2 cache) CPU on a TYAN s2266 mobo wit h 1.25 GB of PC 2100 RAM. I know I got specs enough to run the program, so that is not going to be a problem.

I initially laughed at the fact that a program could be written to do this in the first place - not laughed *at* it, but more so laughed at the idea that no one had thought of it previously at all.

Asher
14-11-2003, 04:10:06
Originally posted by johngalt
I wasn't trying to be a smartass - I was being dead serious. I have over 4500 music files, and it occupies 27 GB on my laptop (an old laptop so it has become a music server for me).

I was also being serious at attempting to run the program on random files in my collection - I listen to things like Evanescence, Linkin Park, Coal Chamber, Shakira, lots and lots and lots of techno, and other stuff.

I can provide files, but I need to know two things:


Does it required compressed files (.MP3, .wma, etc) or uncompressed ,raw files?
Can I try th e program, or do I have to provide you with the music files, or do I need to simply give you a name and let you find it?
That's where the limitations are right now. In order to make our lives easier, the program only deals with 8-bit mono .WAV files. :D

It would be perfectly possible to make it work with up to 24-bit/96KHz 5.1 sound, just need to write the routines to generate the array for that massive amount of data.

But because this was merely a proof of concept, that stuff isn't included.

It would be rather trivial to support more formats, just some busywork. Likewise for supporting WMA/MP3/AAC -- all it'd need to do is call a decoder to print the PCM .WAV and then work off that. Right now we just manually do this with Winamp's disk writer (.WAV).