• Beat Detection [Custom MP3]
    39 replies, posted
Could anyone see if this works for them? Just click anywhere and choose an mp3 to listen to. The coloured bars should flash with any noticeable beat (bass is left, middle is middle, highs are right). [url]http://www.newgrounds.com/dump/item/e8c4f6926e6118e59401e60cf6314c2d[/url] If anyone has any ideas how to improve it/any suggestions they are loved <3
works like a charm. [editline]6th May 2011[/editline] it can even distinguish between the different bass tracks, great work.
Just tried it on "Through the Fire and Flames". It did rather poorly, although that's probably to be expected on that song. It did marginally better on "Fight Fire With Fire", and it better still on "For Whom the Bell Tolls" (it was probably thrown off by the leading bass on that). Figuring it just wasn't designed for metal, I plugged in some stuff from the FF7: Advent Children OST. Still didn't work well. It'll pick up some beats, but it'll flicker on some, and then totally ignore what should be obvious beats. Still, that's better audio-processing than I've ever done, so it's not a complete waste - it just needs some tuning. What kind of songs were you using to test it? I'm willing to bet it's just not tested on anything I put in.
I would love if you could tell me how you did this.
It did poorly on still alive
Decided to try it again, after some thought. First idea was to try more drum-heavy songs. Skyrim Theme worked pretty well - it still missed a few, but it did OK. Next idea was to try simpler music. Original NES Super Mario Bros. Theme was probably the best it's done for me. It actually flashed on every low beat, which was good. It didn't quite hit the high beats, and it barely paid attention to the backing beats, but it still did much better than anything before.
[QUOTE=gman003-main;29660658]It'll pick up some beats, but it'll flicker on some, and then totally ignore what should be obvious beats.[/QUOTE] Pretty much this with every song. [editline]7th May 2011[/editline] [QUOTE=gman003-main;29661253]Next idea was to try simpler music. Original NES Super Mario Bros. Theme was probably the best it's done for me. It actually flashed on every low beat, which was good. It didn't quite hit the high beats, and it barely paid attention to the backing beats, but it still did much better than anything before.[/QUOTE] Wait, yeah. I'll try something without a crazy number of guitars. :v: [editline]7th May 2011[/editline] It doesn't seem to like pianos. :frown: Worked pretty well on the Final Fantasy 1 OST, tho.
It didn't do too badly with 960 BPM Speedcore which was quite suprising.
Works great, nice work!
Works well on Brodyquest... :v:
[QUOTE=Moustach3;29661022]I would love if you could tell me how you did this.[/QUOTE] I basically split the data from the bytearray (which produces the line at the bottom) into 3 parts, took an average reading of each part, and compared it every frame to check for any noticeable rise in activity. [QUOTE=gman003-main;29660658]Just tried it on "Through the Fire and Flames". It did rather poorly, although that's probably to be expected on that song. It did marginally better on "Fight Fire With Fire", and it better still on "For Whom the Bell Tolls" (it was probably thrown off by the leading bass on that). Figuring it just wasn't designed for metal, I plugged in some stuff from the FF7: Advent Children OST. Still didn't work well. It'll pick up some beats, but it'll flicker on some, and then totally ignore what should be obvious beats. Still, that's better audio-processing than I've ever done, so it's not a complete waste - it just needs some tuning. What kind of songs were you using to test it? I'm willing to bet it's just not tested on anything I put in.[/QUOTE] Useful information, thanks a lot. Yeah i'm gonna try using a floating point value to see if that helps, at the moment it just checks if the delta is over a certain constant. Ta. [b]Anymore useful advice? Awesome so far guys.[/b]
Tested it with some dubstep, works pretty nicely. Especially snares/claps work perfectly.
[QUOTE=Occlusion;29672032]I basically split the data from the bytearray (which produces the line at the bottom) into 3 parts, took an average reading of each part, and compared it every frame to check for any noticeable rise in activity. Useful information, thanks a lot. Yeah i'm gonna try using a floating point value to see if that helps, at the moment it just checks if the delta is over a certain constant. Ta. [b]Anymore useful advice? Awesome so far guys.[/b][/QUOTE] I've been thinking about it, and I think you could probably solve a lot of the problem by sampling over more subdivisions (instead of just three). A lot of the missed beats were ones that spiked in only half of one region (especially too low). While you could try to figure out how to detect local maxima, it would probably be easier to just make more possible regions to hit.
Might try this then, though the boundaries with more than 3 regions get a little fuzzy, because a bass beat can carry into the mids etc Thanks though, very useful stuff.
This thing absolutely hates E.S. Posthumus.
[b][highlight]UPDATE[/b][/highlight] Here's what i've done with the algorithm so far, just a menu, but it's pretty neat i think. (May take a while to load, 5mb and no loader atm) Custom music too :smug: [url]http://www.newgrounds.com/dump/item/3bfd306ec67c93e28892f8c1eb84d964[/url] [img]http://www.newgrounds.com/dump/draw/e1a36a4432129af2d224f4b1f5b20681.jpg[/img] [QUOTE=gerbile5;29935120]sorry, didnt completely understand your post a second read shows me you know this[/QUOTE] huh?
sorry, didnt completely understand your post a second read shows me you know this
I wanted to try a few different kinds of music. First I went with Rammstein, it did not fare very well. The flicker everyone mentioned was there, and especially the bass seemed somewhat random, still it wasn't very bad. (The songs were Ich Will and Benzin). Next I tried Frank Sinatra. It missed a lot of beats in Fly Me to the Moon, especially in the beginning and the end, but was better in the mid sections, still occasionally missing a few beats. It seemed like when it missed a beat it took a while for it to pull back together. I then tried All of Me, and it was much better, apart from the flicker and few random missing beats there were very little errors. Then I tried Johnny Cash, and it was great, there were a few notes missing but nothing extreme in Ring of Fire and Man in Black. It also did separate between bass and high quite well. Finally I tried Bach's Toccata and Fugue (in d minor) and it did not do very well missed a lot of beats and added some of its own. I was just having fun at this point and this wasn't really an important part of my review. All in all, it is great. With some tweaking etc... it would be even better but it is still awesome. [editline]20th May 2011[/editline] And now I read about the part saying you were done with the algorithm *sigh*. Can you give some info on the implementation though? Did you use a library etc... or what resources did you use on writing the algorithm? I was planning on making a basic visualizer, and any information on pointing me in the right direction would be appreciated.
[QUOTE=Fetret;29944677][editline]20th May 2011[/editline] And now I read about the part saying you were done with the algorithm *sigh*. Can you give some info on the implementation though? Did you use a library etc... or what resources did you use on writing the algorithm? I was planning on making a basic visualizer, and any information on pointing me in the right direction would be appreciated.[/QUOTE] Don't remember ever saying i was done with it. It's just a class so i can improve it over time, i'm just implementing it fully atm. Yeah it took me a while to work out the best method of beat detection, i'll post all the links i used in 2 secs. The beat detection is in a seperate .AS file which i call from an .fla, it then returns if there's an beat in the lows, mids or highs, or an average beat over all of them. edit: [url]http://stackoverflow.com/questions/3267055/help-needed-with-as3-sound-extract[/url] [url]http://www.fourier-series.com/f-transform/index.html[/url] [url]http://www.julapy.com/blog/2007/12/30/beat-detection-in-flash/[/url] (VERY VERY GOOD) [url]http://blog.andrevenancio.com/2010/01/06/beat-detection/[/url] [url]http://code.google.com/p/in-spirit/wiki/ASFFT[/url] [url]http://www.bit-101.com/blog/?p=2660[/url] [url]http://summitprojectsflashblog.wordpress.com/2008/08/19/wave-theory-in-actionscript-3-part-5/[/url]
Doesn't really work well with Beth Ditto - I Wrote The Book. It flashes up randomly but not to the beat. Also with Jennifer Lopez - On the Floor. Always flashing to music and vocals but not to the beat. Then I tried White Stripes - Seven Nation Army and it worked quite well when there was not much background music. I assume you do a FFT and look for spikes in a specific spectrum range, right?
[QUOTE=aVoN;29949714]I assume you do a FFT and look for spikes in a specific spectrum range, right?[/QUOTE] Yeah exactly that. You're a smart guy avon, any suggestions on how to improve it? [b]Also, any suggestions for the menu? In terms of design etc[/b]
I loaded a song, and it played, but the screen was black. It only showed the filename and length.
[QUOTE=no-named;29951405]I loaded a song, and it played, but the screen was black. It only showed the filename and length.[/QUOTE] You must have an old version of flash player, or the .mp3 is corrupted.
That was awesome.
[QUOTE=BummieHEad;29988872]That was awesome.[/QUOTE] Thanks, i'm working on a better algorithm atm, i'll post a new trial once it's done. Thanks for all your input everyone, this is why i love this forum <3
I know absolutely nothing about this, but could you predict when a beat will be based on the beats before it, then increase the range of frequencies that the program will accept for a beat in a time period around that? Not a massive increase, but enough to perhaps be more consistent I haven't actually tried yours, its a little too late over here to be playing loud music :v:
Tried a couple songs, it struggled a bit with Justice.
[QUOTE=Icedshot;30016045]I know absolutely nothing about this, but could you predict when a beat will be based on the beats before it, then increase the range of frequencies that the program will accept for a beat in a time period around that? Not a massive increase, but enough to perhaps be more consistent I haven't actually tried yours, its a little too late over here to be playing loud music :v:[/QUOTE] Yeah i thought about this but if you're going to predict when beats occur based on predictions of what has come before it somewhat defeats the point of the detection in the first place. However if i checked for a constant beat at a certain interval and then checked at that interval within a range that could work, good idea :) And get some headphones :P
[url=http://filesmelt.com/dl/ritualz_-_ghetto_ass_witch_-_03_ghetto_ass_witch_feat._gvcci-hvcci_.mp3]Try this one.[/url] I swear to god it works [B]SO GOOD[/b].
[QUOTE=Anthophobian;30068086][url=http://filesmelt.com/dl/ritualz_-_ghetto_ass_witch_-_03_ghetto_ass_witch_feat._gvcci-hvcci_.mp3]Try this one.[/url] I swear to god it works [B]SO GOOD[/b].[/QUOTE] Yeah it does. Now just to get metal/rock songs working :P Anymore opinions or advice?
Sorry, you need to Log In to post a reply to this thread.