POV-Ray : Newsgroups : povray.off-topic : BPM : Re: BPM Server Time
4 Sep 2024 01:21:53 EDT (-0400)
  Re: BPM  
From: Invisible
Date: 7 Jun 2010 10:55:16
Message: <4c0d0854$1@news.povray.org>
Invisible wrote:

> Now I'm wondering if I can come up with something a little more 
> accurate. (Although, obviously, accuracy is ultimately determined by how 
> good your coordination and sense of rhythm are!)

See attached. Press any key rhythmically to send "taps". The reset 
button... uh... resets the stats.

It works by recording the amount of time between consecutive taps. As it 
happens, taking the arithmetic mean of these numbers produces an 
identical result to just taking the duration between first and last tap 
and dividing by the number of taps. However, by storing the actual 
times, I can also take the standard deviation.

(There's probably some way to compute the SD incrimentally. But, as it 
happens, even after several hundred taps, there's no noticable problem 
recomputing all the stats from scratch. Firefox uses about 0.5% CPU 
while doing this. Which is impressive for a trivial scripting language. 
I guess computers are just really, really fast these days!)

In my experiments, the error is always about +/- 4% or so. For fast 
tracks there's less timing jitter, but greater timing precision is 
required to get an accurate BPM reading, so the error is still about 4%. 
(The "error" I'm quoting is just the size of one standard deviation. 
ASSUMING A NORMAL DISTRIBUTION, this equates to 68% certainty.)

My next idea is to try generating a series of perfectly-spaced beats and 
optimise for the best possible fit to all the taps...


Post a reply to this message


Attachments:
Download 'us-ascii' (4 KB)

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.