:see_also=index
The beat calculator is a tool to help you compute the
BPM (beats-per-minute) and starting beat of songs 
very accurately.  This will allow you to use GDAM to 
its fullest potential, because then it will be able 
to do most of the beat alignment for you.

First, load a song into the beat calculator.  Either 
drop a song onto the display panel, or use the "=>" 
button to import the currently selected song from the 
song selector.  The song will take a while to load,
as the entire song is cached onto disk.

The waveform should appear on the screen, along with 
the current beat information (if known.)  Once bpm and 
firstbeat values have been entered, beat lines will be 
drawn over the waveform where beats are predicted.  There 
is a zoom level (controlled by a vertical scrollbar to the
right of the drawing area) which allows users to
focus in on a section of the song.  The horizontal
scrollbar controls the position within the song.

There are two spin buttons which denote BPM and start 
beat.  When these values are changed, the locations of 
the predicted beat lines changes to reflect the new
values.  These values can also be adjusted by clicking
on the drawing area with the mouse.  A simple left click
will relocate the nearest beat to the location of the 
click by adjusting the bpm.  A shift-click causes the
nearest beat to be relocated by adjusting the first 
beat value.  In both of these cases, the click position
must be after the first beat position.  A control-click
will set the first beat position to the click location.

It is possible to describe multiple firstbeat locations,
either to handle songs which change tempo, or to mark index
points.  One beatinfo range is edited at a time.  Labels 
indicate the index of the beatinfo currently being 
edited, and the index of the last range.  To cycle the
range currently being edited, click the current range
label.  To add a new range, click on the maximum range 
label... the new range will be created with the bpm
and fb value of the current range.  If a range has a 
bpm value greater than zero, that bpm is effective 
in the range.  Otherwise the range is treated as an 
index point.  An index point denotes an approximate 
location within the song, but its firstbeat value need 
not describe the phase of the music.  To create a
new index point, you can click on the waveform display
with button three. 

All ranges can have a range start, a range end,
and a text description.  Ranges are automatically sorted
by firstbeat time, with one exception: the range with
index zero will not be sorted.  The bpm and firstbeat
values of range zero are the default values, displayed
and used when the complete description isn't handled.


The second mouse button selects a section of waveform.  
Buttons exist to zoom in to a selection, and to zoom 
out to view the entire song.  By clicking the middle 
button, the selection is disabled, and the selection 
marker is placed at the location of the click.

A section of the song can be played back, with an 
optional clicktrack, in order to orient oneself to the 
song and test the current beat info.  If a selection 
is active, that selection will be played.  If the 
selection marker is set, the song will be played from 
the marker location.  Otherwise, the portion of song
which is visible will be played.

If the beat information is changed while the song is 
playing, the clicktrack will update itself to reflect
the new values.

Clicking the 'tap' button regularly will yield an 
estimated tempo based on the average time between 
clicks.  To start over, click the 'reset' button.
The 't' and 'r' keys tap and reset the tapped estimate.
There is a button labelled 'run pitchtrack' which
calls the 'pitchtrack' program (which must be 
installed) to automatically generate a beat info
guess.  This is in development, dont use it.

Once the bpm and firstbeat values accurately describe 
the rhythm of the song, use the "update database" 
button to write the information into the database.  
Don't forget to save the database (in the song 
selector) before you quit.

