|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectabc.notation.NoteAbstract
abc.notation.Note
This class defines a (single) Note : heigth, rhythm, part of tuplet, rest etc...
Field Summary | |
static byte |
a
The a note heigth type. |
static byte |
A
The A note heigth type : A404 |
static byte |
b
The b note heigth type. |
static byte |
B
The B note heigth type. |
static byte |
c
The c note heigth type. |
static byte |
C
The C note heigth type. |
static byte |
d
The d note heigth type. |
static byte |
D
The D note heigth type. |
static short |
DOTTED_EIGHTH
The DOTTED_EIGHTH length type. |
static short |
DOTTED_HALF
The DOTTED_HALF length type. |
static short |
DOTTED_QUARTER
The DOTTED_QUARTER length type. |
static short |
DOTTED_SIXTEENTH
The DOTTED_SIXTEENTH length type. |
static short |
DOTTED_SIXTY_FOURTH
The DOTTED_SIXTY_FOURTH length type. |
static short |
DOTTED_THIRTY_SECOND
The DOTTED_THIRTY_SECOND length type. |
static short |
DOTTED_WHOLE
The DOTTED_WHOLE length type. |
static byte |
e
The e note heigth type. |
static byte |
E
The E note heigth type. |
static short |
EIGHTH
The EIGHTH length type. |
static byte |
f
The f note heigth type. |
static byte |
F
The F note heigth type. |
static byte |
g
The g note heigth type. |
static byte |
G
The G note heigth type. |
static short |
HALF
The HALF length type. |
static short |
QUARTER
The QUARTER length type. |
static byte |
REST
The REST heigth type. |
static short |
SIXTEENTH
The SIXTEENTH length type. |
static short |
SIXTY_FOURTH
The SIXTY_FOURTH length type. |
static short |
THIRTY_SECOND
The THIRTY_SECOND length type. |
static short |
WHOLE
The WHOLE length type. |
Fields inherited from class abc.notation.NoteAbstract |
DOWN, NONE, UP |
Constructor Summary | |
Note(byte heigthValue,
byte accidentalValue)
Creates an abc note with the specified heigth and accidental. |
|
Note(byte heigthValue,
byte accidentalValue,
byte octaveTranspositionValue)
Creates an abc note with the specified heigth, accidental and octave transposition. |
Method Summary | |
static byte |
convertToAccidentalType(java.lang.String accidental)
|
static short |
convertToNoteLengthStrict(int num,
int denom)
|
static byte |
convertToNoteType(java.lang.String note)
|
byte |
getAccidental()
Returns accidental for this note if any. |
short |
getDuration()
Returns the relative length of this note. |
byte |
getHeigth()
Returns this note absolute height. |
byte |
getOctaveTransposition()
Returns the octave transposition for this note. |
boolean |
isRest()
Returns true if this note is a rest |
boolean |
isTied()
Returns true if this note is tied. |
void |
setAccidental(byte accidentalValue)
Sets the accidental for this note. |
void |
setHeigth(byte heigthValue)
Sets the heigth of this note. |
void |
setIsTied(boolean isTied)
Sets if this note is tied, wheter or not. |
void |
setLength(short length)
|
void |
setOctaveTransposition(byte octaveTranspositionValue)
Sets the octave transposition for this note. |
byte |
toRootOctaveHeigth()
Returns the heigth of this note on the first octave. |
java.lang.String |
toString()
Returns a String representation of this Object. |
Methods inherited from class abc.notation.NoteAbstract |
getBow, getChordName, getDotted, getGracingNotes, getGracingNotesLength, getTuplet, hasGeneralGracing, hasGracingNotes, hasStaccato, isPartOfSlur, isPartOfTuplet, setBow, setChordName, setDotted, setGeneralGracing, setGracingNotes, setPartOfSlur, setStaccato |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte C
public static final byte D
public static final byte E
public static final byte F
public static final byte G
public static final byte A
public static final byte B
public static final byte c
public static final byte d
public static final byte e
public static final byte f
public static final byte g
public static final byte a
public static final byte b
public static final byte REST
public static final short DOTTED_WHOLE
public static final short WHOLE
public static final short DOTTED_HALF
public static final short HALF
public static final short DOTTED_QUARTER
public static final short QUARTER
public static final short DOTTED_EIGHTH
public static final short EIGHTH
public static final short DOTTED_SIXTEENTH
public static final short SIXTEENTH
public static final short DOTTED_THIRTY_SECOND
public static final short THIRTY_SECOND
public static final short DOTTED_SIXTY_FOURTH
public static final short SIXTY_FOURTH
Constructor Detail |
public Note(byte heigthValue, byte accidentalValue)
heigthValue
- The heigth of the note.accidentalValue
- The accidental of the note.public Note(byte heigthValue, byte accidentalValue, byte octaveTranspositionValue)
heigthValue
- accidentalValue
- Method Detail |
public void setHeigth(byte heigthValue)
heigthValue
- The heigth of this note. The heigth is REST if
this note is a rest.setHeigth(byte)
public byte getHeigth()
public byte toRootOctaveHeigth()
public void setOctaveTransposition(byte octaveTranspositionValue)
octaveTranspositionValue
- The octave transposition for this note :
1, 2 or 3 means "1, 2 or 3 octave(s) higher than the reference octave" and
-1, -2 or -3 means "1, 2 or 3 octave(s) less than the reference octave".public byte getOctaveTransposition()
public void setLength(short length)
public short getDuration()
public void setAccidental(byte accidentalValue)
accidentalValue
- Accidental for this note. Possible values are
NATURAL, SHARP (#) or FLAT (b).public byte getAccidental()
setAccidental(byte)
public void setIsTied(boolean isTied)
isTied
- true if this note is tied, false otherwise.public boolean isTied()
public boolean isRest()
public static byte convertToNoteType(java.lang.String note)
public static short convertToNoteLengthStrict(int num, int denom) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static byte convertToAccidentalType(java.lang.String accidental) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public java.lang.String toString()
NoteAbstract
toString
in class NoteAbstract
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |