Hi Enr(r)y, Without actually knowing the Nyquist language, I think what this code is doing is: - Downsampling to 1000 Hz (the Nyquist frequency is then 500 Hz, and there's tons of aliasing introduced probably. I think aliasing is the right term to use...?) - applying a low-pass filter (so that you just get the bassy beat, probably kills the aliasing caused by the downsampling) - If signal > threshold, we've found a peak
I wouldn't be surprised if there was some other stuff going on in this code, but it's not immediately obvious that there is. The algorithm I extracted above would be pretty easy to write in C++ if someone is bored and wants to play around with it. It could be the start of a new BPM detection algorithm even* (that's optimistic though). :) Thanks, Albert * If someone wants to hack a new algorithm in, look at bpmdetector.cpp and just hack a new BPM detection function in there. You'll see two existing functions in there for doing BPM detection, so you'd just add another. On 7-Jan-09, at 2:23 AM, [email protected] wrote: > Hi all, this is enrry. > > I have seen a nice feature of Audacity software: it's "beat finder", > you can try from analysis tab, it is not perfect and maybe a little > trivial, but looks to work rather well and I think it could be > someway integrated to make Mixxx beat pattern manage to be > synchronized with the first beat of a track. > > In Audacity user can set threshold parameter and select a part of > audio file to be analyzed; here in Mixxx i think that it would be > enough to analyze the first 10-20 s of the track. > > Here is the source code of beat finder written in Nyquist language: > do someone know it and would be interested to convert in C++ and > integrate into bpm and pattern algorhitms? > > ;nyquist plug-in > ;version 1 > ;type analyze > ;categories "http://audacityteam.org/namespace#OnsetDetector" > ;n! ame "Beat Finder..." > ;action "Finding beats..." > ;info "Released under terms of the GNU General Public License > version 2" > > ;control thresval "Threshold Percentage" int "" 65 5 100 > (setf s1 (if (arrayp s) (snd-add (aref s 0) (aref s 1)) s)) > (defun signal () (force-srate 1000 (lp (snd-follow (lp s1 50) 0.001 > 0.01 0.1 512) 10))) > (setq max (peak (signal) NY:ALL)) > (setq thres (* (/ thresval 100.0) max)) > (setq s2 (signal)) > (do ((c 0.0) (l NIL) (p T) (v (snd-fetch s2))) ((not v) l) > (if (and p (> v thres)) (setq l (cons (list c "B") l))) > (setq p (< v thres)) > (setq c (+ c 0.001)) > (setq v (snd-fetch s2))) > > ; arch-tag: 2204686b-2dcc-4891-964a-2749ac30661b > > ---------------------------------------------------------------------------- > Vuoi essere presente online? > Vuoi dare voce alla tua attivita`? > Acquista un dominio su domini.interfree.it. > A partire da 18,59 euro > ---------------------------------------------------------------------------- > ------------------------------------------------------------------------------ > Check out the new SourceForge.net Marketplace. > It is the best place to buy or sell services for > just about anything Open Source. > http://p.sf.net/sfu/Xq1LFB_______________________________________________ > Mixxx-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mixxx-devel ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Mixxx-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mixxx-devel
