Old 25th January 2009, 12:05   #1
ShadowHarlequin
Senior Member
 
ShadowHarlequin's Avatar
 
Join Date: Sep 2004
Posts: 171
bass detection hack?

has anyone managed to code a line to actually detect goa bass beats yet?

if so can you post it here please, ive only ever really used treb since that seems to pick out frequencies that stand out best

if not then if someones willing to change the frequency detection code in the source version im pretty sure using a hex editor you could pick out the changes in code and add it into the latest dll (keeping a few copies open to compare the differences and help pic down the frequency detection part)

"human is the music, natural is the static..." - john updike
[Set Zero] [themilkFACTORY]
ShadowHarlequin is offline   Reply With Quote
Old 29th January 2009, 21:49   #2
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi

spent over 2 hours on it ...to then finally switch back to geiss' original code.
but i added some new features:
+ bpm limitation: no more nasty double detections
+ distinguishing between bass/mid/treb beats
+ optional synchronizing of bpm limitation

now let me see my what i have built this for
Attached Files
File Type: milk flexi + geiss - refined beat detection.milk (9.8 KB, 430 views)

Last edited by Flexi; 29th January 2009 at 22:10.
Flexi is offline   Reply With Quote
Old 25th February 2009, 16:29   #3
ShadowHarlequin
Senior Member
 
ShadowHarlequin's Avatar
 
Join Date: Sep 2004
Posts: 171
thanks!

ive been playing around with it (sorry for the late reply) can it not find the bass beat and treb beat at the same time? (only shows one circle per beat, i assume bass mid and treb)

"human is the music, natural is the static..." - john updike
[Set Zero] [themilkFACTORY]
ShadowHarlequin is offline   Reply With Quote
Old 25th February 2009, 17:19   #4
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,058
Send a message via ICQ to Flexi
code:
// Geiss' custom beat detection code: (fps-independent; quiet songs don't freak out)
decay_rate = pow(0.993, fps); // lower # = more hasty to declare a beat
min_att = 2.5; // lower # = quieter songs can declare beats
decay_to = 1.0; // lower # = more hasty to declare a beat
beat = bass/max(min_att,bass_att);
beat = max(beat, mid /max(min_att,mid_att ));
beat = max(beat, treb/max(min_att,treb_att));
beat = max( beat, (prev_beat-decay_to)*decay_rate + decay_to );
beat_level = (beat - prev_beat - 0.0)*24;
is_beat = above(beat_level, 0.5);
prev_beat = beat;

// Flexis separation and limitation code

max_bpm = 180;
sync = 1; // 1 - enable; 0 - disable

mx = max(bass_att,max(treb_att,mid_att));
mn = min(bass_att,min(treb_att,mid_att));
isbass = equal((bass_att-mn)/(mx-mn),1);
ismid = equal((mid_att-mn)/(mx-mn),1);
istreb = equal((treb_att-mn)/(mx-mn),1);

res = max(0, min(1,max(res,is_beat*below(res,0))));
bassres = max(0, min(if(sync,res,1),max(bassres,isbass*is_beat*below(bassres,0))));
midres = max(0, min(if(sync,res,1),max(midres,ismid*is_beat*below(midres,0))));
trebres = max(0, min(if(sync,res,1),max(trebres,istreb*is_beat*below(trebres,0))));

q8 = equal(bassres,1)*isbass; // is bass beat
q7 = equal(midres,1)*ismid; // is mid beat
q6 = equal(trebres,1)*istreb; // is treb beat
q3 = equal(res,1);

res = res - max_bpm/(60*fps);
bassres = bassres - max_bpm/(60*fps);
midres = midres - max_bpm/(60*fps);
trebres = trebres - max_bpm/(60*fps);



Flexi is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > MilkDrop

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump