at.ofai.music.beatroot

Class BeatRoot

public class BeatRoot extends Object

The main class of the BeatRoot application. Processes the command line arguments (see processArgs()) and creates the three main objects:
Field Summary
protected StringargsFile
Input file for batch processing where each line contains a list of arguments for a BeatRoot run
protected StringaudioIn
File name of audio input file
protected AudioPlayeraudioPlayer
The object that deals with audio output
protected AudioProcessoraudioProcessor
The object that deals with processing the audio data
protected booleanbatchMode
Flag indicating that no GUI input is expected, i.e. that the program exits after processing the command line
protected StringbeatsFile
Input file name for annotated beat times (for evaluating BeatRoot)
protected StringbeatsIn
Input file name of beat times in TMF format (instead of automatic beat tracking)
protected StringfeatureFile
Input file name for (onset) feature file, instead of audio input, for ICASSP'07 paper
protected ChooserfileChooser
The dialog window for selecting files for opening and saving data
protected GUIgui
The graphical user interface (frame) object
protected static booleanignoreWarnings
Flag indicating whether warning messages should be ignored or displayed
protected booleanonsetOnly
Flag to load/save onsets
protected booleanplayWithBeats
Flag indicating whether audio with beats should be played after processing is complete
protected BufferedReaderreader
For reading argsFile
protected booleansilentFlag
Flag for suppressing messages to standard output
protected StringtextOutputFile
Output file name for saving the beat times in text format, one to a line
protected intuseAnnotation
For beat tracking with the first n notes given, this is the value of n. (e.g. n==1 determines the initial phase only; n==2 determines the initial phase and tempo)
Constructor Summary
BeatRoot(String[] args)
Constructor.
Method Summary
static voiderror(String message)
Print an error message and opens an exit dialog.
protected String[]getArgs()
Reads a line from the arguments file argsFile, and converts it into an array of Strings, allowing for quoted strings.
static voidmain(String[] args)
Entry point for BeatRoot application.
voidprocessArgs(String[] args)
Process command line arguments.
static voidquit()
Open an exit dialog.
static String[]stringToArgs(String s)
static voidwarning(String message)
Print a warning message.

Field Detail

argsFile

protected String argsFile
Input file for batch processing where each line contains a list of arguments for a BeatRoot run

audioIn

protected String audioIn
File name of audio input file

audioPlayer

protected AudioPlayer audioPlayer
The object that deals with audio output

audioProcessor

protected AudioProcessor audioProcessor
The object that deals with processing the audio data

batchMode

protected boolean batchMode
Flag indicating that no GUI input is expected, i.e. that the program exits after processing the command line

beatsFile

protected String beatsFile
Input file name for annotated beat times (for evaluating BeatRoot)

beatsIn

protected String beatsIn
Input file name of beat times in TMF format (instead of automatic beat tracking)

featureFile

protected String featureFile
Input file name for (onset) feature file, instead of audio input, for ICASSP'07 paper

fileChooser

protected Chooser fileChooser
The dialog window for selecting files for opening and saving data

gui

protected GUI gui
The graphical user interface (frame) object

ignoreWarnings

protected static boolean ignoreWarnings
Flag indicating whether warning messages should be ignored or displayed

onsetOnly

protected boolean onsetOnly
Flag to load/save onsets

playWithBeats

protected boolean playWithBeats
Flag indicating whether audio with beats should be played after processing is complete

reader

protected BufferedReader reader
For reading argsFile

silentFlag

protected boolean silentFlag
Flag for suppressing messages to standard output

textOutputFile

protected String textOutputFile
Output file name for saving the beat times in text format, one to a line

useAnnotation

protected int useAnnotation
For beat tracking with the first n notes given, this is the value of n. (e.g. n==1 determines the initial phase only; n==2 determines the initial phase and tempo)

Constructor Detail

BeatRoot

public BeatRoot(String[] args)
Constructor. Initialises the BeatRoot application, including the GUI, and processes any command line arguments.

Parameters: args Optional command line arguments.

See Also: (String[])

Method Detail

error

public static void error(String message)
Print an error message and opens an exit dialog. Generally better than an immediate exit, since the user might want to save some data before exiting.

Parameters: message The error message

getArgs

protected String[] getArgs()
Reads a line from the arguments file argsFile, and converts it into an array of Strings, allowing for quoted strings.

Returns: The next line of arguments as a String[]

main

public static void main(String[] args)
Entry point for BeatRoot application.

Parameters: args Optional command line arguments (see constructor for details)

processArgs

public void processArgs(String[] args)
Process command line arguments. Arguments are: [option]* [audioFile], where audioFile is the file name of the audio input file containing WAV format data. The option arguments can be any of the following (in any order):
  • -m argsFile File name of text file containing lines of arguments for batch processing
  • -a beatFile File name of text file containing annotated beat times for evaluation
  • -i beatFile File name of TMF file containing beat times for editing
  • -b Process in batch mode (save results and exit immediately after processing)
  • -f featureFile Feature file on which to perform beat tracking (for ICASSP'07 paper)
  • -h highThreshold Spectrogram energy threshold corresponding to maximum value in colour map
  • -l lowThreshold Spectrogram energy threshold corresponding to minimum value in colour map
  • -o outputFile Save output to this file (implies -b)
  • -O Output the times of onsets, not beats, and exit (use -o flag to specify the output file; implies batch mode)
  • -p Play audio with beats as soon as processing is completed
  • -q Suppress output of warnings (TODO)
  • -s audioScaleFactor Constant for scaling amplitude envelope display
  • -t hopTime spacing of audio frames (in seconds, default 0.01)
  • -T frameTime size of FFT (in seconds, default 0.01161)
  • -w live input (not used)
  • -c cursor is always at centre; data scrolls past it
  • -e allowedError allowed error in beat position for evaluation
  • -E allowedRelativeError allowed relative error (0-1) in beat position for evaluation
  • quit

    public static void quit()
    Open an exit dialog. Protects against inadvertant presses of the exit button. Could be extended to save settings and data automatically.

    stringToArgs

    public static String[] stringToArgs(String s)

    warning

    public static void warning(String message)
    Print a warning message. Could be extended to save warning messages to a log file.

    Parameters: message The warning message