at.ofai.music.beatroot
Class BeatRoot

java.lang.Object
  extended by at.ofai.music.beatroot.BeatRoot

public class BeatRoot
extends java.lang.Object

The main class of the BeatRoot application. Processes the command line arguments (see processArgs()) and creates the three main objects:


Field Summary
protected  java.lang.String argsFile
          Input file for batch processing where each line contains a list of arguments for a BeatRoot run
protected  java.lang.String audioIn
          File name of audio input file
protected  AudioPlayer audioPlayer
          The object that deals with audio output
protected  AudioProcessor audioProcessor
          The object that deals with processing the audio data
protected  boolean batchMode
          Flag indicating that no GUI input is expected, i.e.
protected  java.lang.String beatsFile
          Input file name for annotated beat times (for evaluating BeatRoot)
protected  java.lang.String beatsIn
          Input file name of beat times in TMF format (instead of automatic beat tracking)
protected  java.lang.String featureFile
          Input file name for (onset) feature file, instead of audio input, for ICASSP'07 paper
protected  Chooser fileChooser
          The dialog window for selecting files for opening and saving data
protected  GUI gui
          The graphical user interface (frame) object
protected static boolean ignoreWarnings
          Flag indicating whether warning messages should be ignored or displayed
protected  boolean onsetOnly
          Flag to load/save onsets
protected  boolean playWithBeats
          Flag indicating whether audio with beats should be played after processing is complete
protected  java.io.BufferedReader reader
          For reading argsFile
protected  boolean silentFlag
          Flag for suppressing messages to standard output
protected  java.lang.String textOutputFile
          Output file name for saving the beat times in text format, one to a line
protected  int useAnnotation
          For beat tracking with the first n notes given, this is the value of n.
 
Constructor Summary
BeatRoot(java.lang.String[] args)
          Constructor.
 
Method Summary
static void error(java.lang.String message)
          Print an error message and opens an exit dialog.
protected  java.lang.String[] getArgs()
          Reads a line from the arguments file argsFile, and converts it into an array of Strings, allowing for quoted strings.
static void main(java.lang.String[] args)
          Entry point for BeatRoot application.
 void processArgs(java.lang.String[] args)
          Process command line arguments.
static void quit()
          Open an exit dialog.
static java.lang.String[] stringToArgs(java.lang.String s)
           
static void warning(java.lang.String message)
          Print a warning message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gui

protected GUI gui
The graphical user interface (frame) object


audioPlayer

protected AudioPlayer audioPlayer
The object that deals with audio output


audioProcessor

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


fileChooser

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


audioIn

protected java.lang.String audioIn
File name of audio input file


textOutputFile

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


beatsIn

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


beatsFile

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


featureFile

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


argsFile

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


onsetOnly

protected boolean onsetOnly
Flag to load/save onsets


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)


reader

protected java.io.BufferedReader reader
For reading argsFile


playWithBeats

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


batchMode

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


silentFlag

protected boolean silentFlag
Flag for suppressing messages to standard output


ignoreWarnings

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

Constructor Detail

BeatRoot

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

Parameters:
args - Optional command line arguments.
See Also:
processArgs(String[])
Method Detail

processArgs

public void processArgs(java.lang.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

  • getArgs

    protected java.lang.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[]

    stringToArgs

    public static java.lang.String[] stringToArgs(java.lang.String s)

    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.


    warning

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

    Parameters:
    message - The warning message

    error

    public static void error(java.lang.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

    main

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

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