Package com.tagtraum.audiokern.key
Enum KeyProfile
- java.lang.Object
-
- java.lang.Enum<KeyProfile>
-
- com.tagtraum.audiokern.key.KeyProfile
-
- All Implemented Interfaces:
Serializable
,Comparable<KeyProfile>
public enum KeyProfile extends Enum<KeyProfile>
Key profile.- Author:
- Hendrik Schreiber
- See Also:
- Humdrum keycor manpage
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KeyProfile.KeyCorrelation
-
Enum Constant Summary
Enum Constants Enum Constant Description AARDEN_ESSEN
BELLMAN_BUDGE
KRUMHANSL_KESSLER
SIMPLE
TEMPERLEY_KOSTKA_PAYNE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Key
getCorrelatingKey(float[] chromagram, Tone baseTone)
Computes the key with the highest correlation to the given chromagram using the given profile.KeyProfile.KeyCorrelation[]
getCorrelatingKeys(float[] chromagram, Tone baseTone)
Computes the correlations to all (regular) keys.float
majorCorrelation(float[] chromagram)
Calculates the correlation coefficient between the given chromagram and this profile.float
minorCorrelation(float[] chromagram)
Calculates the correlation coefficient between the given and this profile.static KeyProfile
valueOf(String name)
Returns the enum constant of this type with the specified name.static KeyProfile[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
KRUMHANSL_KESSLER
public static final KeyProfile KRUMHANSL_KESSLER
-
AARDEN_ESSEN
public static final KeyProfile AARDEN_ESSEN
-
SIMPLE
public static final KeyProfile SIMPLE
-
BELLMAN_BUDGE
public static final KeyProfile BELLMAN_BUDGE
-
TEMPERLEY_KOSTKA_PAYNE
public static final KeyProfile TEMPERLEY_KOSTKA_PAYNE
-
-
Method Detail
-
values
public static KeyProfile[] 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 (KeyProfile c : KeyProfile.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static KeyProfile 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
-
majorCorrelation
public float majorCorrelation(float[] chromagram)
Calculates the correlation coefficient between the given chromagram and this profile.- Parameters:
chromagram
- chromagram- Returns:
- correlation coefficient
-
minorCorrelation
public float minorCorrelation(float[] chromagram)
Calculates the correlation coefficient between the given and this profile.- Parameters:
chromagram
- chromagram- Returns:
- correlation coefficient
-
getCorrelatingKey
public Key getCorrelatingKey(float[] chromagram, Tone baseTone)
Computes the key with the highest correlation to the given chromagram using the given profile.- Parameters:
chromagram
- chromagrambaseTone
- base tone of the chromagram- Returns:
- key with the highest correlation coefficient
-
getCorrelatingKeys
public KeyProfile.KeyCorrelation[] getCorrelatingKeys(float[] chromagram, Tone baseTone)
Computes the correlations to all (regular) keys. Results are ordered by correlation in ascending order.- Parameters:
chromagram
- chromagrambaseTone
- base tone of the chromagram- Returns:
- correlations
-
-