|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Note
Represents a musical Note and the operations that can be done on a Note.
| Constructor Summary | |
Note(int midiValue)
Constructs a Note from a MIDI value. |
|
Note(Note toCopy)
Copy constructor. |
|
Note(java.lang.String stdDes)
Constructs a Note from a string in standard designation. |
|
| Method Summary | |
boolean |
after(Note comp)
True if the standard designation value of caller is lower than that of comp; for Notes with modifications, version with the lower letter will be lower than its alternate. |
boolean |
before(Note comp)
True if the standard designation value of caller is lower than that of comp; for Notes with modifications, version with the lower letter will be lower than its alternate. |
boolean |
canTranspose(int steps,
Note min,
Note max)
True if the Note can be transposed without going out of the valid MIDI bounds. |
boolean |
equals(java.lang.Object comp)
True if the two Notes have the same MIDI value; they may have different standard designation representations. |
char |
getLetter()
Returns a char reprsenting the tone letter of the Note, .e.g. 'C' (even if the note is "C#"). |
int |
getMIDI()
Returns an integer representing the MIDI value of the Note. |
char |
getMod()
Returns a char representing the modification on the Note, e.g. '#'. |
int |
getOctave()
Returns an integer representing the octave of the Note. |
java.lang.String |
getStdDes()
Returns a string representing the Note in standard designation, e.g. , C#4. |
java.lang.String |
getTone()
Returns a string representing the tone of the Note, e.g. "C#". |
void |
toggle()
Toggles a Note to its alternate MIDI representation. If the Note does not have an alternate MIDI representation (D, G, A, or C-1) the standard designation value of the Note does not change. |
void |
transpose(int steps,
Note min,
Note max)
Transposes a Note steps number of half steps. If steps > 0, the Note is transposed up. If steps < 0, the Note is transposed down. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Note(int midiValue)
midiValue - A valid MIDI number.
java.lang.IllegalArgumentException - if the MIDI value is out of bounds.public Note(java.lang.String stdDes)
stdDes - Note value in standard designation, e.g., C#4.
java.lang.IllegalArgumentException - if the String is not a properly
formatted in standard designation.public Note(Note toCopy)
toCopy - Note that is to be duplicated.| Method Detail |
public boolean equals(java.lang.Object comp)
equals in class java.lang.Objectcomp - Note that is being compared to.public boolean before(Note comp)
comp - Note that is being compared to.public boolean after(Note comp)
comp - Note that is being compared to.public void toggle()
public boolean canTranspose(int steps,
Note min,
Note max)
steps - Number of half steps for the transposition.
positive if the Note is being transposed up; negative
if it is being transposed down.min - The lowest value a Note is allowed to take on.max - The highest value a Note is allowed to take on.
public void transpose(int steps,
Note min,
Note max)
steps - Number of half steps for the transposition.
positive if the Note is being transposed up; negative
if it is being transposed down.min - The lowest value a Note is allowed to take on.max - The highest value a Note is allowed to take on.
java.lang.IllegalArgumentException - if trying to tranpose Note out of
allowable boundspublic java.lang.String getStdDes()
public java.lang.String getTone()
public char getLetter()
public char getMod()
public int getOctave()
public int getMIDI()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||