Constructor and Description |
---|
NoteEvent(int key,
boolean on,
long time)
Constructs a new
NoteEvent with the specified data. |
Modifier and Type | Method and Description |
---|---|
NoteEvent |
createOff(long offTime)
Creates a new off event of the same type and slot with the specified
timestamp.
|
int |
getKey()
Returns the note number associated with this event.
|
Slot |
getSlot()
Gets a slot that uniquely identifies which interval events belong to.
|
int |
getVelocity()
Returns the velocity associated with this event.
|
boolean |
isOn()
Gets if this event is an off to on transition.
|
boolean |
isSharp()
Returns if this note is considered sharp or not.
|
getChannel, getTime, toString
public NoteEvent(int key, boolean on, long time)
NoteEvent
with the specified data.
The channel will be 0 and velocity will be 127.
key
- the raw MIDI key (note) for this event, between 0 and 127
inclusiveon
- true
if this event is a note on event, otherwise
false
time
- the time that this event occurs, in microsecondspublic int getKey()
MIDI note numbers range from 0 to 127, inclusive. Note C4 is number 60.
public int getVelocity()
Velocity ranges from 0 to 127, inclusive.
public boolean isSharp()
true
if this note event is a sharp note, false
otherwise.public boolean isOn()
Event
Note that an event can transition from off to on multiple times before an on to off transition occurs.
public Slot getSlot()
Event
Equal slots are events occurring for the same channel and key.
Copyright © 2015 Kreatious LLC. All rights reserved.