|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectabc.notation.KeySignature
This class defines key signatures using modes definition like E major, G minor etc etc...
1 2 3 4 5 6 7 Major (Ionian, mode 1) D E F# G A B C# Dorian (mode 2) E F# G A B C# D Mixolydian (mode 5) A B C# D E F# G Aeolian (mode 6) B C# D E F# G AIf we consider the key namned "Ab aeolian", "A" is called the note of this key, "b" is called the key accidental and "aeolian" is called the mode.
Field Summary | |
static byte |
AEOLIAN
The aeolian mode type. |
static byte |
DORIAN
The dorian mode type. |
static byte |
IONIAN
The ionian mode type. |
static byte |
LOCRIAN
The locrian mode type. |
static byte |
LYDIAN
The lydian mode type. |
static byte |
MAJOR
The major mode type. |
static byte |
MINOR
The minor mode type. |
static byte |
MIXOLYDIAN
The mixolydian mode type. |
static byte |
OTHER
The "not standard" mode type. |
static byte |
PHRYGIAN
The phrygian mode type. |
Constructor Summary | |
KeySignature(byte[] accidentalsDefinition)
Creates a key signature with the specified accidentals. |
|
KeySignature(byte keyNoteType,
byte modeType)
Creates a new signature with the specified parameters. |
|
KeySignature(byte keyNoteType,
byte keyAccidental,
byte modeType)
Creates a new signature with the specified parameters. |
Method Summary | |
static byte |
convertToAccidentalType(java.lang.String accidental)
|
static byte |
convertToModeType(java.lang.String mode)
|
byte |
getAccidental()
Returns key accidental for this Key. |
byte |
getAccidentalFor(byte noteHeigth)
Returns accidental for the specified note heigth for this key. |
byte[] |
getAccidentals()
Returns accidentals of this key signature. |
byte |
getMode()
Returns the mode of this key. |
byte |
getNote()
Returns the note of the mode. |
void |
setAccidental(byte noteHeigth,
byte accidental)
Sets the accidental for the specified note. |
java.lang.String |
toLitteralNotation()
|
java.lang.String |
toString()
Returns a String representation of this key. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte AEOLIAN
public static final byte DORIAN
public static final byte IONIAN
public static final byte LOCRIAN
public static final byte LYDIAN
public static final byte MAJOR
public static final byte MINOR
public static final byte MIXOLYDIAN
public static final byte PHRYGIAN
public static final byte OTHER
Constructor Detail |
public KeySignature(byte keyNoteType, byte modeType)
keyNoteType
- The note of the mode. Possible values are
Note.A, Note.B, Note.C, Note.D,
Note.E, Note.F or Note.G.modeType
- The type of the mode. Possible values are
AEOLIAN, DORIAN, IONIAN, LOCRIAN, LYDIAN
MAJOR, MINOR, MIXOLYDIAN, PHRYGIAN or OTHER.public KeySignature(byte keyNoteType, byte keyAccidental, byte modeType)
keyNoteType
- The note of the mode. Possible values are
Note.A, Note.B, Note.C, Note.D,
Note.E, Note.F or Note.G.keyAccidental
- Accidental for the note mode. Possible values are
AccidentalType.SHARP, AccidentalType.NATURAL?
AccidentalType.NONE, or AccidentalType.FLAT.modeType
- The type of the mode. Possible values are
AEOLIAN, DORIAN, IONIAN, LOCRIAN,
LYDIAN, MAJOR, MINOR, MIXOLYDIAN,
PHRYGIAN or OTHER.
java.lang.IllegalArgumentException
- Thrown if keyAccidental or modeType
are out of the allowed values.public KeySignature(byte[] accidentalsDefinition)
accidentalsDefinition
- Accidental definition from note
C to B. Possible values for accidentals are :
AccidentalType.SHARP, AccidentalType.NATURAL
or AccidentalType.FLAT.Method Detail |
public byte getNote()
public byte getMode()
public byte getAccidental()
public byte[] getAccidentals()
public void setAccidental(byte noteHeigth, byte accidental) throws java.lang.IllegalArgumentException
noteHeigth
- The note heigth. Possible values are,
Note.A, Note.B, Note.C, Note.D,
Note.E, Note.F or Note.G.accidental
- The accidental to be set to the note. Possible values are :
AccidentalType.SHARP, AccidentalType.NATURAL
or AccidentalType.FLAT.
java.lang.IllegalArgumentException
- Thrown if an invalid note heigth or
accidental has been given.public byte getAccidentalFor(byte noteHeigth)
noteHeigth
- A note heigth among Note.C, Note.D,
Note.E, Note.F, Note.G, Note.A,
Note.B.
java.lang.IllegalArgumentException
- Thrown if the specified note heigth
is invalid.public java.lang.String toLitteralNotation()
public static byte convertToModeType(java.lang.String mode)
public static byte convertToAccidentalType(java.lang.String accidental) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |