[linux-audio-dev] Some help with my BPM algorithm?
jasonthomasdolan at yahoo.com
Mon Mar 22 22:49:49 EST 2004
--- Simon Jenkins <sjenkins at blueyonder.co.uk> wrote:
> ~ Downsampling by 50??? That's *got* to require
> filtering. In keeping with your need for speed - not
> to mention
> my lack of DSP guru-head - i've implemented the
> ~ fseek()-ing the pipe wasn't working. I've removed
> first fseek(), but that means that g_startTime is no
> honoured and must be left at zero. The (ahem)
> "filter" i
> added means the second fseek() is no longer
> ~ 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
> 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)
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,
Software Engineer, Systems Analyst
Windmill Cycles, Inc.
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
More information about the linux-audio-dev