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:
gui
- the graphical user interface object, which
displays the audio and beat data and processes mouse and key events;
audioPlayer
- the object which deals with audio output,
playing the audio data with or without percussion sounds marking the beats;
audioProcessor
- processes audio to find onsets, and calls
the tempo induction and beat tracking methods
Field Summary |
protected String | argsFile Input file for batch processing where each line contains a list of arguments for a BeatRoot run |
protected 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. that the program exits after processing the command line |
protected String | beatsFile Input file name for annotated beat times (for evaluating BeatRoot) |
protected String | beatsIn Input file name of beat times in TMF format (instead of automatic beat tracking) |
protected 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 BufferedReader | reader For reading argsFile |
protected boolean | silentFlag Flag for suppressing messages to standard output |
protected 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.
(e.g. n==1 determines the initial phase only; n==2 determines the initial phase and tempo) |
Method Summary |
static void | error(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 void | main(String[] args) Entry point for BeatRoot application. |
void | processArgs(String[] args) Process command line arguments.
|
static void | quit() Open an exit dialog. |
static String[] | stringToArgs(String s) |
static void | warning(String message) Print a warning message.
|
protected String argsFile
Input file for batch processing where each line contains a list of arguments for a BeatRoot run
protected String audioIn
File name of audio input file
The object that deals with audio output
The object that deals with processing the audio data
protected boolean batchMode
Flag indicating that no GUI input is expected, i.e. that the program exits after processing the command line
protected String beatsFile
Input file name for annotated beat times (for evaluating BeatRoot)
protected String beatsIn
Input file name of beat times in TMF format (instead of automatic beat tracking)
protected String featureFile
Input file name for (onset) feature file, instead of audio input, for ICASSP'07 paper
The dialog window for selecting files for opening and saving data
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 BufferedReader reader
For reading argsFile
protected boolean silentFlag
Flag for suppressing messages to standard output
protected 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.
(e.g. n==1 determines the initial phase only; n==2 determines the initial phase and tempo)
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[])
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
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[]
public static void main(String[] args)
Entry point for BeatRoot application.
Parameters: args Optional command line arguments (see constructor for details)
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
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.
public static String[] stringToArgs(String s)
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