Right now, I'm working on trying to figure out a song's patterns (rhythm) to represent them visually. So, for example, the main beat of a song (drums) would be a red square, the secondary beats (bass) blue circles, etc. So each of them shows up every time their respective beat sounds.
I know a song's could have a lot of patterns (beats), and that's the reason I'm having problems. Right now I'm trying to get only the main beats. I'm trying to solve it this way:
I'm using SoundMixer.computeSpectrum
to get a ByteArray
made up by a intensity/frequency spec. This ByteArray
is feed every 1/10 second. I'm trying to group similar intensity/freq data in Dictionaries to figure out the song's patterns.
I'm getting patterns by:
Do you know if there is a better way to figure out song's patterns (rythm) using AS3 SoundMixer.computeSpectrum
or any other object/framework/api?
PD: I have no music theory advanced acknowledgments.
Julapy posted a demo and code that detects some obvious beat. Julapy aggregates energy from computeSpectrum. Julapy aggregates over a broad frequency band, not co-ocurring narrow bands (family members): http://www.julapy.com/blog/2007/12/30/beat-detection-in-flash/
Honestly, I have never coded the algorithms below, yet page 2 of an article "Beat Detection Algorithms" suggests estimating beats per minute by estimating periods of the same frequency band. It sounds like you could augment Julapy's approach: http://archive.gamedev.net/archive/reference/programming/features/beatdetection/page2.html
By the way, the sound analyzer demo and code in the HYPE framework also visualizes computeSpectrum in novel ways. While not solving the same problem, the code related to computeSpectrum may be worth reading: http://www.hypeframework.org/02_examples/soundanalyzer/content/01_soundanalyzer/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With