Package org.jfugue.provider
Interface KeyProvider
- All Known Implementing Classes:
SignatureSubparser
public interface KeyProvider
This interface must be implemented by the parser responsible for Staccato strings.
-
Method Summary
Modifier and TypeMethodDescriptionbyte
convertAccidentalCountToKeyRootPositionInOctave
(int accidentalCount, byte scale) Turns number of accidentals (negative for flats, positive for sharps) to a key and returns the key's root note's position in the octavebyte
convertKeyToByte
(Key key) Converts the given Key to a byte value, from -7 for Cb major or Ab major to +7 for C# minor or A# minor, with 0 being C major or A minorGiven a key signature, like "Cmaj" or "Kbbbb", return the corresponding KeycreateKeyString
(byte notePositionInOctave, byte scale) Creates a key name, like Cmaj, given the root note's position in an octave (e.g., 0 for C) and a major or minor indicator - @see Scale MAJOR_SCALE_INDICATOR and MINOR_SCALE_INDICATOR
-
Method Details
-
createKey
Given a key signature, like "Cmaj" or "Kbbbb", return the corresponding Key -
createKeyString
Creates a key name, like Cmaj, given the root note's position in an octave (e.g., 0 for C) and a major or minor indicator - @see Scale MAJOR_SCALE_INDICATOR and MINOR_SCALE_INDICATOR -
convertAccidentalCountToKeyRootPositionInOctave
byte convertAccidentalCountToKeyRootPositionInOctave(int accidentalCount, byte scale) Turns number of accidentals (negative for flats, positive for sharps) to a key and returns the key's root note's position in the octave -
convertKeyToByte
Converts the given Key to a byte value, from -7 for Cb major or Ab major to +7 for C# minor or A# minor, with 0 being C major or A minor
-