|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sky.monome.util.scale.MidiNote
public final class MidiNote
Midi note. This kind of note can return its Midi number. Note that Midi notes are immutable.
Nested Class Summary | |
---|---|
static class |
MidiNote.Note
Octave note. |
Field Summary | |
---|---|
static MidiNote |
C_1
Constant for the minimum possible note with the Midi protocol. |
static MidiNote |
C4
Constant for the default note with the Midi protocol. |
static MidiNote |
G9
Constant for the maximum possible note with the Midi protocol. |
Constructor Summary | |
---|---|
MidiNote(MidiNote.Note note,
int octave)
Constructs a Midi note with the specified octave note and the specified octave number. |
Method Summary | |
---|---|
int |
compareTo(MidiNote o)
Compares this Midi note to the specified Midi note. |
boolean |
equals(java.lang.Object o)
Says if this Midi note is equal to the specified object. |
int |
getMidiNoteNumber()
Returns the note number of this Midi note in the Midi protocol. |
MidiNote.Note |
getNote()
Returns the octave note of this Midi note. |
int |
getOctave()
Returns the number of the octave of this Midi note. |
MidiNote |
getOffsettedNote(int offset)
Returns the Midi note which is the result of the specified offset applied on this Midi note. |
int |
hashCode()
Returns the hashcode of this Midi note. |
java.lang.String |
toString()
Returns a string representation of this Midi note. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final MidiNote C_1
0
.
public static final MidiNote C4
public static final MidiNote G9
127
.
Constructor Detail |
---|
public MidiNote(MidiNote.Note note, int octave)
note
- Octave note.octave
- Number of the octave.Method Detail |
---|
public MidiNote.Note getNote()
public int getOctave()
public int getMidiNoteNumber()
public MidiNote getOffsettedNote(int offset)
offset
- Offset to apply to this Midi note.
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(MidiNote o)
compareTo
in interface java.lang.Comparable<MidiNote>
o
- Midi note to compare with.
0
when this Midi note is equivalent to the specified Midi note.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- Object to compare with.
false
if the specified object is in a wrong type.
Otherwise, returns true
if and only if the two Midi notes have the same octave note and the same octave number.public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |