|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectutil.KeySignature
public class KeySignature
Utility class to simplify dealing with key signatures
Nested Class Summary | |
---|---|
private class |
KeySignature.KeyNote
Utility class to keep track of the position of notes |
Field Summary | |
---|---|
private static int[] |
_major
Half steps in a Major key |
private static int[] |
_minor
Half steps in a Minor key |
private java.util.Map<java.lang.Character,java.lang.Integer> |
keymap
Map of sharps/flats in the key signature |
private KeySignature.KeyNote[] |
notes
Ordering of notes (using only sharps) |
Constructor Summary | |
---|---|
KeySignature(java.lang.String key)
Generate a "Key" object that enables easy access to the key signature. |
Method Summary | |
---|---|
Note |
adjust(Note n)
Takes a note and returns the properly transposed note in this key signature |
private int |
map(java.lang.Character note)
Takes a note (with no accidentals) and returns the accidental for this key signature. |
void |
printmap()
Print the mapping for this key signature |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static int[] _major
private static int[] _minor
private java.util.Map<java.lang.Character,java.lang.Integer> keymap
private KeySignature.KeyNote[] notes
Constructor Detail |
---|
public KeySignature(java.lang.String key)
key
- - String indicating key (i.e., "C" or "D#m")Method Detail |
---|
private int map(java.lang.Character note)
note
- - in [A, B, C, D, E, F, G]
public Note adjust(Note n)
n
- - note to be adjustedpublic void printmap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |