[linux-audio-dev] Some help with my BPM algorithm?

Jay Dolan jasonthomasdolan at yahoo.com
Tue Mar 23 03:49:49 UTC 2004


--- Simon Jenkins <sjenkins at blueyonder.co.uk> wrote:
> ok:
> 
> ~ Downsampling by 50???  That's *got* to require
> some
> filtering. In keeping with your need for speed - not
> to mention
> my lack of DSP guru-head - i've implemented the
> crudest
> imagineable.
> 
> ~ fseek()-ing the pipe wasn't working. I've removed
> the
> first fseek(), but that means that g_startTime is no
> longer
> honoured and must be left at zero. The (ahem)
> "filter" i
> added means the second fseek() is no longer
> required.
> 
> ~ A couple of math corrections.
> 
> ~ Widened expected bpm range: It now looks for 100 -
> 199 bpm.
> You should probably narrow that back down again if
> you know
> your source is in a narrower range.
> 
> I actually ran it a couple of times and it seems to
> produce plausible
> results now though i don't have the exact bpms for
> the mp3s i tried.
> Also, my test mp3s contained looped samples and/or
> programmed
> drum parts. I'm not sure this algorithm will work so
> well (or at
> all for that matter) on less regular material.
> 
> Simon Jenkins
> (Bristol, UK)
> 

Simon,

Thanks so much for lending a hand :)  I was working on
it too tonight, and received your email about 30
seconds after I got it working, hehe.  I found that
while it's not "supported", the fseek works fine for
me.  The man pages for fseek say that it can't be used
on pipes opened for /writing/.  Obviously we're just
reading from a pipe..and while errno is still set to
EPIPE, it works here.  However, I don't like hacks,
and so I'll replace all piping / reliance on mpg123
with calls to libmad.

You are dead on with the downsampling issue.  With a
downsampleFactor of 1 or 2 the program works great for
me now - 50 was way too high.  I know jack sh!t about
filtering..or PCM in general.  But the program, while
slower, is now at least as accurate as my Numark
CDN-88's Beatkeeper III.

Again, I'm really greatful for your help.  I'll attach
a completed version soon, hopefully.  Take care,


=====
Jay Dolan
Software Engineer, Systems Analyst
Windmill Cycles, Inc.
508.999.4000

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html



More information about the Linux-audio-dev mailing list