Package com.tagtraum.audiokern.key
Enum MinorKey
- java.lang.Object
-
- java.lang.Enum<MinorKey>
-
- com.tagtraum.audiokern.key.MinorKey
-
- All Implemented Interfaces:
Key,Serializable,Comparable<MinorKey>,org.json.simple.JSONAware
public enum MinorKey extends Enum<MinorKey> implements Key, Serializable, org.json.simple.JSONAware
Minor keys.- Author:
- Hendrik Schreiber
-
-
Enum Constant Summary
Enum Constants Enum Constant Description A_FLAT_MINORAb minor.A_MINORA minor.B_FLAT_MINORBb minor.B_MINORB minor.C_MINORC minor.D_FLAT_MINORDb minor.D_MINORD minor.E_FLAT_MINOREb minor.E_MINORE minor.F_MINORF minor.F_SHARP_MINORF# minor.G_MINORG minor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetCorrelation(KeyProfile profile, float[] chromagram, Tone chromagramBase)Calculates the Pearson correlation coefficient between this key and the given chromagram using the provided profile.KeygetDiagonal()If major, this returns theKey.getTonicParallel()of theKey.getDominant().KeygetDominant()Dominant.SeventhChordgetDominantSeventh()StringgetKeyCode()Key code.ColorgetKeyCodeColor()Key code color.intgetKeyCodeNumeral()Key code numeral.StringgetOpenKeyCode()Open key code, followed by either d (German dur, Latin durus, Engl.intgetOpenKeyCodeNumeral()Position on the circle of fifths, clockwise, starting with C major = 1 for major keys and A minor = 1 for minor keys.KeygetSubdominant()Subdominant.StringgetTKey()Id3 representation of this key.Tone[]getTones()Tones in this key.TonegetTonic()Tonic of this key.StringgetTonicName()Tonic name, guaranteed to be the "typical" name (as in Circle of fifths) for the key.KeygetTonicParallel()Tonic parallel, i.e.TriadgetTriad()Triad for this key.intgetWallClockCodeNumeral()Wall clock position in the circle of fifths (C Major at 12 o'clock).StringgetWallClockKeyCode()Wall clock key code.Keyinc(int fifths)Increase key by the given number of fifths.KeyincBySemitones(int semitones)Return the key that would result in shifting all tones in this key by' the given number of semitones.booleanisCompatible(Key key)Indicates whether the given key is compatible to this key in the sense that one is either the sub/dominant or tonic parallel of the other.booleanisMajor()Is this a major key?booleanisMinor()Is this a minor key?intnegativeDistance(Key nextKey)Negative distance in semitones from this key to the given, next key.intpositiveDistance(Key nextKey)Positive distance in semitones from this key to the given, next key.StringtoJSONString()StringtoString()static MinorKeyvalueOf(String name)Returns the enum constant of this type with the specified name.static MinorKey[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
A_MINOR
public static final MinorKey A_MINOR
A minor.
-
E_MINOR
public static final MinorKey E_MINOR
E minor.
-
B_MINOR
public static final MinorKey B_MINOR
B minor.
-
F_SHARP_MINOR
public static final MinorKey F_SHARP_MINOR
F# minor.
-
D_FLAT_MINOR
public static final MinorKey D_FLAT_MINOR
Db minor.
-
A_FLAT_MINOR
public static final MinorKey A_FLAT_MINOR
Ab minor.
-
E_FLAT_MINOR
public static final MinorKey E_FLAT_MINOR
Eb minor.
-
B_FLAT_MINOR
public static final MinorKey B_FLAT_MINOR
Bb minor.
-
F_MINOR
public static final MinorKey F_MINOR
F minor.
-
C_MINOR
public static final MinorKey C_MINOR
C minor.
-
G_MINOR
public static final MinorKey G_MINOR
G minor.
-
D_MINOR
public static final MinorKey D_MINOR
D minor.
-
-
Method Detail
-
values
public static MinorKey[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MinorKey c : MinorKey.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MinorKey valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getTonic
public Tone getTonic()
Description copied from interface:KeyTonic of this key.- Specified by:
getTonicin interfaceKey- Returns:
- tonic
- See Also:
Key.getTonicName(),Key.getDominant(),Key.getSubdominant()
-
getTonicName
public String getTonicName()
Description copied from interface:KeyTonic name, guaranteed to be the "typical" name (as in Circle of fifths) for the key.- Specified by:
getTonicNamein interfaceKey- Returns:
- tonic name
- See Also:
Key.getTonic()
-
getDominantSeventh
public SeventhChord getDominantSeventh()
- Specified by:
getDominantSeventhin interfaceKey- Returns:
- dominant seventh
-
isCompatible
public boolean isCompatible(Key key)
Description copied from interface:KeyIndicates whether the given key is compatible to this key in the sense that one is either the sub/dominant or tonic parallel of the other.- Specified by:
isCompatiblein interfaceKey- Returns:
- true or false
- See Also:
Key.getDominant(),Key.getSubdominant(),Key.getTonicParallel()
-
positiveDistance
public int positiveDistance(Key nextKey)
Description copied from interface:KeyPositive distance in semitones from this key to the given, next key.- Specified by:
positiveDistancein interfaceKey- Parameters:
nextKey- next key- Returns:
- distance in semitones
- See Also:
Tone.positiveDistance(Tone)
-
negativeDistance
public int negativeDistance(Key nextKey)
Description copied from interface:KeyNegative distance in semitones from this key to the given, next key.- Specified by:
negativeDistancein interfaceKey- Parameters:
nextKey- next key- Returns:
- distance in semitones
- See Also:
Tone.negativeDistance(Tone)
-
isMajor
public boolean isMajor()
Description copied from interface:KeyIs this a major key?
-
isMinor
public boolean isMinor()
Description copied from interface:KeyIs this a minor key?
-
getSubdominant
public Key getSubdominant()
Description copied from interface:KeySubdominant.- Specified by:
getSubdominantin interfaceKey- Returns:
- subdominant
- See Also:
Key.inc(int)
-
getDominant
public Key getDominant()
Description copied from interface:KeyDominant.- Specified by:
getDominantin interfaceKey- Returns:
- dominant
- See Also:
Key.inc(int)
-
inc
public Key inc(int fifths)
Description copied from interface:KeyIncrease key by the given number of fifths. This allows to travel easily around the circle of fifths.Key.getDominant()is the same asinc(1).Key.getSubdominant()is the same asinc(-1).
-
incBySemitones
public Key incBySemitones(int semitones)
Description copied from interface:KeyReturn the key that would result in shifting all tones in this key by' the given number of semitones. Such a shift may result, when the audio is played back at a higher or lower speed.- Specified by:
incBySemitonesin interfaceKey- Parameters:
semitones- number of semitones- Returns:
- shifted key
- See Also:
Tempo.incBySemitones(int)
-
getTonicParallel
public Key getTonicParallel()
Description copied from interface:KeyTonic parallel, i.e. major to minor or vice versa.- Specified by:
getTonicParallelin interfaceKey- Returns:
- tonic parallel
-
getDiagonal
public Key getDiagonal()
Description copied from interface:KeyIf major, this returns theKey.getTonicParallel()of theKey.getDominant(). If minor, this returns theKey.getTonicParallel()of theKey.getSubdominant(). On the circle of fifths this is an harmonic diagonal transition.- Specified by:
getDiagonalin interfaceKey- Returns:
- diagonal key
-
getWallClockCodeNumeral
public int getWallClockCodeNumeral()
Description copied from interface:KeyWall clock position in the circle of fifths (C Major at 12 o'clock).- Specified by:
getWallClockCodeNumeralin interfaceKey- Returns:
- key code numeral (1-12)
- See Also:
Key.getWallClockKeyCode()
-
getCorrelation
public float getCorrelation(KeyProfile profile, float[] chromagram, Tone chromagramBase)
Description copied from interface:KeyCalculates the Pearson correlation coefficient between this key and the given chromagram using the provided profile.- Specified by:
getCorrelationin interfaceKey- Parameters:
profile- key profilechromagram- chromagramchromagramBase- tone/pitch of the first chromagram bin- Returns:
- correlation coefficient
-
getKeyCodeNumeral
public int getKeyCodeNumeral()
Description copied from interface:KeyKey code numeral.- Specified by:
getKeyCodeNumeralin interfaceKey- Returns:
- key code numeral (1-12)
-
getOpenKeyCodeNumeral
public int getOpenKeyCodeNumeral()
Description copied from interface:KeyPosition on the circle of fifths, clockwise, starting with C major = 1 for major keys and A minor = 1 for minor keys.- Specified by:
getOpenKeyCodeNumeralin interfaceKey- Returns:
- open key code numeral (1-12)
- See Also:
Key.getOpenKeyCode()
-
getKeyCode
public String getKeyCode()
Description copied from interface:KeyKey code.- Specified by:
getKeyCodein interfaceKey- Returns:
- key code 1-12[A|B]
-
getWallClockKeyCode
public String getWallClockKeyCode()
Description copied from interface:KeyWall clock key code.- Specified by:
getWallClockKeyCodein interfaceKey- Returns:
- key code 1-12[M|m]
-
getOpenKeyCode
public String getOpenKeyCode()
Description copied from interface:KeyOpen key code, followed by either d (German dur, Latin durus, Engl. major) or m (German moll, Latin mollis, Engl. minor).- Specified by:
getOpenKeyCodein interfaceKey- Returns:
- open key code 1-12[d|m]
- See Also:
Key.getOpenKeyCodeNumeral()
-
getKeyCodeColor
public Color getKeyCodeColor()
Description copied from interface:KeyKey code color.- Specified by:
getKeyCodeColorin interfaceKey- Returns:
- key code color
-
getTKey
public String getTKey()
Description copied from interface:KeyId3 representation of this key.
-
toJSONString
public String toJSONString()
- Specified by:
toJSONStringin interfaceorg.json.simple.JSONAware
-
-