[LAU] Q: HOWTO: extract the beat times from an audio track

Robin Gareus robin at gareus.org
Sat May 29 23:37:39 UTC 2010


On 05/30/2010 12:39 AM, Jeremy Henty wrote:
> 
> I want  to create an  animation for a  track my band recorded  and I'm
> wondering how  to get it  in sync.  It's  a straight 4/4 piece  but we
> weren't playing to  a click track so the  tempo varies slightly.  Most
> of the advice  I get is "Open it in Audacity  (or similar) and eyeball
> the beats from the waveform" but it would be very cool if there was an
> app that could read the audio and spit out the beat times.  Is there?

likely even more than one :)

Ardour has the "Rhythm Ferret" (Menu -> Window -> Rhythm Ferret) which
can split a track into pieces on Note or Percussive onset.

There's also an option to set the tempo-map (instead of splitting the
track) but I never go this to work.. AFAIK the RF is still work in progress.

To 'spit out' the times: I dunno if ardour can do that these days. But
you can always save the ardour session and extract the start-time of
each region with something alike this:

cat /path/to/session.ardour \
| grep "<Region " \
| grep "Audio 1" \
| sed 's/^.* start="\([0-9]*\)".*$/\1/' \
| awk '//{print $0/44100.0;}' \
| awk '//{printf "%02i:%02i:%02i:%02i\n", \
          $0/3600, ($0/60)%60, $0%60, ($0*25)%25;}'
> /tmp/beattimes.txt

Replace the 44100.0 with your sample-rate (48000?), 25 with your
video-fps. and "Audio 1" with the track-name.. In principle this could
be an awk one-liner; but the above is a bit more readable.. (-;

robin


> Regards, 
> 
> Jeremy Henty
> --
> The music business is a cruel and shallow money trench, a long plastic
> hallway where thieves and pimps run free, and good men die like dogs.
> There's also a negative side.
>  -- Hunter S. Thompson 
> _______________________________________________
> Linux-audio-user mailing list
> Linux-audio-user at lists.linuxaudio.org
> http://lists.linuxaudio.org/listinfo/linux-audio-user


More information about the Linux-audio-user mailing list