public class Note
extends java.lang.Object
MidiBus
,
ObjectMidiListener
,
ControlChange
Modifier and Type | Field and Description |
---|---|
java.lang.String |
bus_name |
int |
channel |
int |
pitch |
long |
ticks |
long |
timestamp |
int |
velocity |
Constructor and Description |
---|
Note(int channel,
int pitch,
int velocity)
Constructs a Note object
|
Note(int channel,
int pitch,
int velocity,
int ticks)
Constructs a Note object
|
Note(int channel,
int pitch,
int velocity,
int ticks,
long timestamp,
java.lang.String bus_name)
Constructs a Note object
|
Note(int channel,
int pitch,
int velocity,
long timestamp,
java.lang.String bus_name)
Constructs a Note object
|
Modifier and Type | Method and Description |
---|---|
int |
channel()
Return the channel of the Note
|
boolean |
equals(java.lang.Object obj)
Check if all fields are equal.
|
java.lang.String |
name()
Return the name of the note, e.g.
|
int |
octave()
Return the octave of the Note.
|
int |
pitch()
Return the pitch of the Note
|
int |
relativePitch()
Return the pitch of the Note relative to C.
|
void |
setChannel(int channel)
Set channel of the Note
|
void |
setPitch(int pitch)
Set pitch of the Note
|
void |
setTicks(int ticks)
Set length in ticks of the Note
|
void |
setVelocity(int velocity)
Set velocity of the Note
|
long |
ticks()
Return the length in ticks of the Note
|
java.lang.String |
toString()
Returns a string in the format [Note Name, c:channel, p:pitch, v:velocity, t:ticks, ts:timestamp, b:bus_name] e.g "[C, c:0, p:65, v:123, t:0, ts:1234, b:bus123]".
|
int |
velocity()
Return the velocity of the Note
|
public int channel
public int pitch
public int velocity
public long ticks
public long timestamp
public java.lang.String bus_name
public Note(int channel, int pitch, int velocity)
channel
- the channel of the Notepitch
- the pitch of the Notevelocity
- the velocity of the Notepublic Note(int channel, int pitch, int velocity, int ticks)
channel
- the channel of the Notepitch
- the pitch of the Notevelocity
- the velocity of the Noteticks
- the length in ticks of the Notepublic Note(int channel, int pitch, int velocity, long timestamp, java.lang.String bus_name)
channel
- the channel of the Notepitch
- the pitch of the Notevelocity
- the velocity of the Notetimestamp
- the timestamp of the Notebus_name
- the name of MidiBus associated with the Notepublic Note(int channel, int pitch, int velocity, int ticks, long timestamp, java.lang.String bus_name)
channel
- the channel of the Notepitch
- the pitch of the Notevelocity
- the velocity of the Noteticks
- the length in ticks of the Notetimestamp
- the timestamp of the Notebus_name
- the name of MidiBus associated with the Notepublic void setChannel(int channel)
channel
- the channel to setpublic int channel()
public void setPitch(int pitch)
pitch
- the pitch to setpublic int pitch()
public int relativePitch()
public int octave()
public java.lang.String name()
public void setVelocity(int velocity)
velocity
- the velocity to setpublic int velocity()
public void setTicks(int ticks)
ticks
- the ticks value to setpublic long ticks()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object