public class Beat extends java.lang.Object implements java.lang.Comparable<Beat>
Beat
represents a single MIDI beat. It stores information about the onset
time and tick number of the beat, and the beat number (in 32nd notes). Beats are Comparable
and their natural ordering uses only beat
, not any absolute timing information.Modifier and Type | Field and Description |
---|---|
private int |
beat
The beat number on which this Beat lies (measured in 32nd notes)
|
private int |
measure
The measure number on which this Beat lies.
|
private long |
tick
The tick at which this Beat lies.
|
private long |
time
The time in microseconds at which this Beat lies.
|
Constructor and Description |
---|
Beat()
Create a new default Beat, at time, tick, and measure 0 and beat 0.
|
Beat(int measure,
int beat,
long time,
long tick)
Standard constructor for all fields.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Beat o) |
boolean |
equals(java.lang.Object other) |
int |
getBeat()
Get this Beat's beat number.
|
int |
getMeasure()
Get this Beat's measure number.
|
long |
getTick()
Get this Beat's tick.
|
long |
getTime()
Get this Beat's time.
|
int |
hashCode() |
Beat |
shallowCopy()
Return a shallow copy of this Beat.
|
java.lang.String |
toString() |
private final int beat
private final int measure
private final long time
private final long tick
public Beat()
public Beat shallowCopy()
beat
, time
, and tick
values.public int getMeasure()
measure
public int getBeat()
beat
public long getTime()
time
public long getTick()
tick
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object