|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel at.ofai.music.beatroot.BeatTrackDisplay
public class BeatTrackDisplay
Main panel of BeatRoot's GUI, which displays the audio and beat data and allows editing, scrolling, selecting, etc
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static double |
adjustment
for synchronising audio and graphics, a constant related to the size of the audio buffer in seconds |
static double |
allowedError
For evaluation of beat tracking results, the largest difference allowed between the computed and annotated beat times. |
(package private) static java.awt.Color |
AUDIO_COLOUR
the colour of the amplitude envelope |
(package private) double |
audioScale
Scaling factor for displaying the amplitude envelope |
(package private) static java.awt.Color |
BEAT_COLOUR
the colour of the lines marking the beats |
protected java.util.ListIterator<at.ofai.music.util.Event> |
beatPtr
location of selected beat (previous()) in the EventList beats |
protected at.ofai.music.util.EventList |
beats
beat data encoded as a list of Events |
static boolean |
centred
mode for scrolling the display: if true the cursor remains centred on the screen and the data scrolls; if false the cursor moves and the data is changed just before the cursor reaches the edge of the screen. |
protected java.awt.Rectangle |
clipRect
the clip rectangle for painting only those areas which have changed |
static java.awt.Color[] |
colour
colour map used in the spectrogram |
(package private) double |
currentTime
the current time of audio output (for cursor position) |
static boolean |
debug
Flag for enabling debugging output |
static int |
DEFAULT_MODE
the default display mode |
protected double |
endSelection
end of selected data region (may be < start) |
protected double[] |
env
the times corresponding to each point in the magnitudes array |
(package private) java.awt.Font |
font
font used for displaying text |
protected int |
fontSize
size of font for inter-beat intervals and axis labels |
protected java.awt.Graphics |
gImage
the Graphics object for drawing on img |
protected GUI |
gui
handle to the GUI (parent) object |
(package private) double |
hiThreshold
the threshold above which the maximum colour is used in the spectrogram |
protected java.awt.image.BufferedImage |
img
background image showing audio data but not beats |
(package private) double |
loThreshold
the threshold below which the minimum colour is used in the spectrogram |
protected int[] |
magnitudes
smoothed amplitude envelope of audio signal |
(package private) double |
maximumTime
the maximum time that might need to be displayed for this input file (seconds) |
(package private) java.awt.FontMetrics |
metrics
metrics for calculating the size of printed strings |
(package private) static java.awt.Color |
MIDI_COLOUR
the colour of the MIDI piano roll |
(package private) int |
midiMax
largest displayed midi pitch |
(package private) int |
midiMin
smallest displayed midi pitch |
(package private) double |
minimumTime
the minimum time that might need to be displayed for this input file (seconds) |
(package private) int |
mode
a bit string indicating what items are displayed on the main data panel |
protected double[] |
offsets
the times of offsets (in seconds) for MIDI data |
(package private) static java.awt.Color |
ONSET_COLOUR
the colour of the onset markers on the amplitude envelope |
protected at.ofai.music.util.EventList |
onsetList
a list of onset events for passing to the tempo induction and beat tracking methods |
protected double[] |
onsets
the times of onsets (in seconds) |
(package private) double |
overlap
the ratio of hop size to frame size (for aligning the spectrogram with the audio) |
protected int[] |
pitches
the pitches of MIDI notes |
protected boolean |
regionSelected
flag indicating whether a region is selected |
protected int |
scrollDirection
the direction of scrolling when dragging outside the displayed bounds |
protected at.ofai.music.util.Event |
selectedBeat
the current beat (in editing and annotation operations) |
protected double |
selectedBeatTime
time of selected beat (for undo) |
(package private) static java.awt.Color |
SELECTION_COLOUR
the background colour of a selected region |
static long |
serialVersionUID
avoid compiler warning |
static int |
SHOW_AUDIO
|
static int |
SHOW_BEATS
Constants defining the various elements that can be displayed on the main data panel |
static int |
SHOW_DATA
|
static int |
SHOW_IBI
|
static int |
SHOW_MIDI
|
static int |
SHOW_ONSETS
|
static int |
SHOW_SPECTRO
|
protected double[][] |
spectro
spectrogram data |
protected int |
spectroLength
number of frames of valid spectrogram data |
protected double |
startSelection
beginning of selected data region |
(package private) static java.awt.Color |
TEXT_COLOUR
the colour of the text (for IBIs and axes) |
protected double |
tInc
time interval between frames of spectrogram data (hop time) |
protected static double |
UNKNOWN
Constant representing an unknown relationship between metrical levels |
static boolean |
usePScore
For evaluation, select whether to use the P-score or T-score |
static boolean |
useRelativeError
For evaluation of beat tracking results, indicates whether allowedError
is interpreted as absolute (in seconds) or relative (0-1). |
(package private) double |
visibleTimeLength
the duration of the visible audio data (seconds) |
(package private) double |
visibleTimeStart
the time corresponding to the leftmost point on the panel (seconds) |
protected int |
x0
x-coordinate corresponding to time t = 0 (could be off-screen) |
protected int |
xSize
width in pixels of this panel |
protected int |
yBottom
y-coordinate of bottom of data area (position of x-axis) |
protected int |
yMid
y-coordinate of the bottom of the spectrogram and top of the amplitude envelope area |
protected int |
ySize
height in pixels of this panel |
protected int |
yTop
y-coordinate of top of data area |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
BeatTrackDisplay(GUI g,
at.ofai.music.util.EventList b)
Constructor: |
Method Summary | |
---|---|
void |
addAfterSelectedBeat()
Interpolates a new beat between the currently selected and the following beat |
void |
addBeat(double time)
Adds a beat at the given time. |
void |
addBeatNow()
Adds a beat at the current playback time, with an adjustment for audio latency. |
void |
beatTrack()
Performs automatic beat tracking and updates the GUI accordingly. |
static at.ofai.music.util.EventList |
beatTrack(at.ofai.music.util.EventList events)
Perform beat tracking where the GUI is not active; there is no selected region. |
static at.ofai.music.util.EventList |
beatTrack(at.ofai.music.util.EventList events,
at.ofai.music.util.EventList beats)
Perform beat tracking where the GUI is not active; there is no selected region. |
void |
clearBeats()
Clears all beats in the selected area and sets beatPtr to point between the beats surrounding the deleted area. |
protected void |
clearImage()
Clears the background image to white |
void |
ensureShowing(double time,
boolean isRunning)
Ensures that the given time is visible on the screen, by requesting a scroll if it is off the screen. |
void |
evaluate(java.lang.String beatsFile)
Evaluates a beat tracking solution against an annotation of the data. |
static void |
evaluate(java.lang.String beatsFile,
double[] beatsArr)
Evaluates a beat tracking solution against an annotation of the data. |
static void |
evaluate(java.lang.String beatsFile,
at.ofai.music.util.EventList beats)
Evaluates a beat tracking solution against an annotation of the data. |
static void |
evaluate(java.lang.String annotationFile,
java.lang.String testFile)
Evaluates a beat tracking solution against an annotation of the data. |
(package private) void |
findClosestBeat(int x,
boolean nextHighest)
Finds the closest beat to a given time. |
static double |
getAverageIBI(double[] d)
Finds the mean tempo (as inter-beat interval) from an array of beat times |
at.ofai.music.util.EventList |
getBeats()
|
(package private) java.awt.Color |
getColour(double c)
Maps a double to a colour for displaying the spectrogram |
int |
getMaximum()
|
static double |
getMedianIBI(double[] d)
Finds the median tempo (as inter-beat interval) from an array of beat times |
int |
getMinimum()
|
double[] |
getOffsets()
|
double[] |
getOnsets()
|
int[] |
getPitches()
|
static double |
getRhythmicLevel(double[] beats,
double[] correct)
Estimates the metrical relationship between two beat sequences. |
java.lang.String |
getSelectedRegion(java.lang.String prefix)
Gets the start ( selectedStart ) and length
(selectedLength ) of the region of audio which has been
selected (if any). |
int |
getValue()
Returns the time corresponding to the left edge of the display; used in scrolling |
int |
getVisibleAmount()
Gets the length of audio that is visible at any one time (i.e. |
void |
init(boolean resetSelection)
Initialises the panel after new data is loaded or preferences are changed. |
double |
locationToTime(int loc)
Finds the time corresponding to a given x-coordinate. |
void |
markMetricalLevel(int level,
int len,
int phase)
Marks (only) the selected metrical level as specified. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Ignore composite events (already processed as press/drag/release events) |
void |
mouseDragged(java.awt.event.MouseEvent e)
Called when the mouse is moved with a button down; if a beat is selected, it is moved under the cursor, and if a region is selected it is expanded or shrunk under the cursor. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Request focus for key events whenever the mouse enters the window. |
void |
mouseExited(java.awt.event.MouseEvent e)
Ignore mouse exit events |
void |
mouseMoved(java.awt.event.MouseEvent e)
Ignore mouse movement with no button pressed |
void |
mousePressed(java.awt.event.MouseEvent e)
A mouse button press can be used to move (left button), add (middle button), or delete (right button) a beat, or to select or deselect a region, by clicking on the axis. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Called when the mouse button is released, to finalise move/add/delete operations. |
void |
moveBeat(double t1,
double t2)
Changes the time of a beat, and re-sorts the list. |
static at.ofai.music.util.Event |
newBeat(double time,
int beatNum)
Creates a new Event object representing a beat. |
void |
paint(java.awt.Graphics g)
Renders the panel. |
protected void |
paintAudioData(java.awt.Graphics g)
Paints the audio amplitude envelope and onset markers. |
protected void |
paintAxes(java.awt.Graphics g)
Paints the time axis and labels |
protected void |
paintBackground(java.awt.Graphics g)
Paints the background of the spectrogram and selected area (if any). |
protected void |
paintBeats(java.awt.Graphics g)
Paints the beats and inter-baet intervals |
protected void |
paintMidiData(java.awt.Graphics g)
Paints MIDI data in piano-roll notation. |
protected void |
paintSpectroData(java.awt.Graphics g)
Paints the spectrogram data. |
void |
removeBeat(double time)
Deletes a beat. |
void |
removeSelectedBeat()
Deletes the currently selected beat |
void |
reorderBeats()
The current beat (pointed to by beatPtr ) is moved
to its correct place in the otherwise sorted list of beats. |
protected void |
repaintImage()
Updates the background image, after creating it if necessary |
void |
scrollTo(double time,
boolean isRunning)
Updates the screen to show data for the current time, by scrolling and/or moving the cursor. |
void |
selectBeat(int x,
int err)
Selects the nearest beat to a given x-coordinate. |
void |
selectFirstBeat()
Selects the first beat |
void |
selectLastBeat()
Selects the last beat |
void |
selectNextBeat()
Selects the beat after the currently selected beat |
void |
selectPreviousBeat()
Selects the beat before the currently selected beat |
void |
setBeats(at.ofai.music.util.EventList b)
Sets the list of beats. |
void |
setEnvTimes(double[] envTimes)
Sets the array of times of amplitude envelope points, for displaying. |
void |
setMagnitudes(int[] mag)
Sets the array of magnitude values, for displaying. |
void |
setMetricalLevel(int x)
Marks the selected beat with all metrical levels up to and including x. |
void |
setMode(int on,
int off)
Changes the display mode (which elements are displayed on the panel). |
void |
setOffsets(double[] off)
Sets the array of offset times, for displaying MIDI input data. |
void |
setOnsetList(at.ofai.music.util.EventList on)
Sets the onset times as a list of Events, for use by the beat tracking methods. |
void |
setOnsets(double[] on)
Sets the array of onset times, for displaying MIDI or audio input data. |
void |
setPitches(int[] p)
Sets the array of pitch values, for displaying MIDI input data. |
void |
setSpectro(double[][] spec,
int len,
double inc,
double lap)
Sets the data for the spectrogram. |
void |
setValue(int value)
Scrolls the data so that the left edge of the panel corresponds to the given time. |
void |
setVisibleAmount(int msec)
Sets the length of audio that is visible at any one time (i.e. |
int |
timeToLocation(double time)
Finds the x-coordinate corresponding to the given time. |
void |
toggleAnnotateMode()
Turns keyboard annotation of metrical levels on and off |
void |
update(java.awt.Graphics g)
Don't clear before repainting |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long serialVersionUID
protected GUI gui
protected int xSize
protected int ySize
protected java.awt.image.BufferedImage img
protected java.awt.Graphics gImage
img
protected java.awt.Rectangle clipRect
protected int x0
protected int yTop
protected int yMid
protected int yBottom
protected int fontSize
protected at.ofai.music.util.EventList beats
protected at.ofai.music.util.Event selectedBeat
protected java.util.ListIterator<at.ofai.music.util.Event> beatPtr
beats
protected double selectedBeatTime
protected double startSelection
protected double endSelection
protected boolean regionSelected
protected int scrollDirection
protected at.ofai.music.util.EventList onsetList
protected double[] onsets
protected double[] offsets
protected int[] pitches
protected double[] env
magnitudes
array
protected int[] magnitudes
protected double tInc
protected double[][] spectro
protected int spectroLength
public static final java.awt.Color[] colour
static java.awt.Color AUDIO_COLOUR
static java.awt.Color MIDI_COLOUR
static java.awt.Color ONSET_COLOUR
static java.awt.Color BEAT_COLOUR
static java.awt.Color TEXT_COLOUR
static java.awt.Color SELECTION_COLOUR
double loThreshold
double hiThreshold
double overlap
double audioScale
double minimumTime
double maximumTime
double visibleTimeStart
double visibleTimeLength
double currentTime
int midiMin
int midiMax
java.awt.Font font
java.awt.FontMetrics metrics
public static final int SHOW_BEATS
public static final int SHOW_IBI
public static final int SHOW_DATA
public static final int SHOW_ONSETS
public static final int SHOW_AUDIO
public static final int SHOW_SPECTRO
public static final int SHOW_MIDI
public static final int DEFAULT_MODE
int mode
public static double adjustment
public static double allowedError
public static boolean useRelativeError
allowedError
is interpreted as absolute (in seconds) or relative (0-1).
public static boolean usePScore
public static boolean centred
public static boolean debug
protected static final double UNKNOWN
Constructor Detail |
---|
public BeatTrackDisplay(GUI g, at.ofai.music.util.EventList b)
g
- A handle to the parent GUI objectb
- The list of beatsMethod Detail |
---|
java.awt.Color getColour(double c)
c
- The energy value
public void init(boolean resetSelection)
resetSelection
- Indicates whether the selected region should be clearedpublic void setMode(int on, int off)
on
- A bit string indicating the elements that should be switched onoff
- A bit string indicating the elements that should be switched offpublic int getMinimum()
public int getMaximum()
public int getValue()
public void setValue(int value)
value
- The given time in millisecondspublic void ensureShowing(double time, boolean isRunning)
time
- The current time of audio output in secondsisRunning
- Flag indicating whether audio output is activepublic void scrollTo(double time, boolean isRunning)
time
- The current time of audio output in secondsisRunning
- Flag indicating whether audio output is activepublic java.lang.String getSelectedRegion(java.lang.String prefix)
selectedStart
) and length
(selectedLength
) of the region of audio which has been
selected (if any). The result is returned as a String containing
a list of attribute-value pairs, where the attribute and value
are separated by '=' and the pairs are separated by a space.
prefix
- Other attribute-value pairs
public int getVisibleAmount()
public void setVisibleAmount(int msec)
msec
- Length in millisecondspublic void update(java.awt.Graphics g)
update
in class javax.swing.JComponent
public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
g
- The Graphics object for painting on this panel.protected void clearImage()
protected void repaintImage()
protected void paintBackground(java.awt.Graphics g)
g
- The Graphics object to paint to (i.e. img
)protected void paintAxes(java.awt.Graphics g)
g
- The Graphics object to paint toprotected void paintBeats(java.awt.Graphics g)
g
- The Graphics object to paint toprotected void paintMidiData(java.awt.Graphics g)
g
- The Graphics object to paint to (i.e. img
)protected void paintAudioData(java.awt.Graphics g)
g
- The Graphics object to paint to (i.e. img
)protected void paintSpectroData(java.awt.Graphics g)
g
- The Graphics object to paint to (i.e. img
)public int timeToLocation(double time)
time
- Time in seconds
public double locationToTime(int loc)
loc
- The given x-coordinate
void findClosestBeat(int x, boolean nextHighest)
x
- The horizontal location on the panel representing the time to search aroundnextHighest
- If true, the returned beat must occur after the given timepublic void toggleAnnotateMode()
public void selectFirstBeat()
public void selectLastBeat()
public void selectNextBeat()
public void selectPreviousBeat()
public void removeSelectedBeat()
public void addAfterSelectedBeat()
public void setMetricalLevel(int x)
x
- The given highest metrical levelpublic void markMetricalLevel(int level, int len, int phase)
level
- The given metrical levellen
- The number of lowest-level beats in one unit of this metrical levelphase
- The position of the first lowest-level beat relative to the
boundaries of this metrical level, where 0 means it is alignedpublic void selectBeat(int x, int err)
x
- The x-coordinate (e.g. of a mouse-click) near which a beat is soughterr
- The allowed error in the beat location: if negative, no limit is
imposed on the beat, otherwise the beat must be within err
pixels
of x
. If no suitable beat is found, there is no selected beat.public static at.ofai.music.util.Event newBeat(double time, int beatNum)
time
- The time of the beat in secondsbeatNum
- The index of the beat
public void addBeatNow()
public void addBeat(double time)
time
- Time in seconds of the new beatpublic void moveBeat(double t1, double t2)
t1
- The original time of the beatt2
- The new time of the beatpublic void removeBeat(double time)
time
- The time of the beat (in seconds)public void clearBeats()
public void reorderBeats()
beatPtr
) is moved
to its correct place in the otherwise sorted list of beats.
public static at.ofai.music.util.EventList beatTrack(at.ofai.music.util.EventList events)
events
- The onsets or peaks in a feature list
public static at.ofai.music.util.EventList beatTrack(at.ofai.music.util.EventList events, at.ofai.music.util.EventList beats)
events
- The onsets or peaks in a feature listbeats
- The initial beats which are given, if any
public void beatTrack()
public static double getAverageIBI(double[] d)
d
- An array of beat times
public static double getMedianIBI(double[] d)
d
- An array of beat times
public static double getRhythmicLevel(double[] beats, double[] correct)
beats
- The system's beat timescorrect
- The annotated beat times
public void evaluate(java.lang.String beatsFile)
beatsFile
- The file name of the annotation datapublic static void evaluate(java.lang.String beatsFile, at.ofai.music.util.EventList beats)
beatsFile
- The file name of the annotation databeats
- The list of beats to be evaluatedpublic static void evaluate(java.lang.String annotationFile, java.lang.String testFile)
annotationFile
- The file name of the annotation datatestFile
- The file name containing the beat times (as text) to be evaluatedpublic static void evaluate(java.lang.String beatsFile, double[] beatsArr)
beatsFile
- The file name of the annotation databeatsArr
- The array of beat times to be evaluatedpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- The object describing the event that occurredpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public at.ofai.music.util.EventList getBeats()
public double[] getOnsets()
public double[] getOffsets()
public int[] getPitches()
public void setOnsetList(at.ofai.music.util.EventList on)
on
- The times of onsets in secondspublic void setOnsets(double[] on)
on
- The times of onsets in secondspublic void setOffsets(double[] off)
off
- The array of MIDI offset timespublic void setEnvTimes(double[] envTimes)
envTimes
- The array of times in seconds corresponding to the values in magnitudes
public void setMagnitudes(int[] mag)
mag
- The array of amplitude envelope valuespublic void setPitches(int[] p)
p
- The array of MIDI pitch valuespublic void setBeats(at.ofai.music.util.EventList b)
b
- The list of beatspublic void setSpectro(double[][] spec, int len, double inc, double lap)
spec
- The spectrogram data, indexed by time and frequencylen
- The number of frames of spectrogram datainc
- The time interval between frames of spectrogram datalap
- The ratio between hop size and frame size
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |