Package com.tagtraum.audiokern.key
Class SeventhChord
- java.lang.Object
-
- com.tagtraum.audiokern.key.SeventhChord
-
- All Implemented Interfaces:
Chord
public class SeventhChord extends Object implements Chord
Seventh Chord.- Author:
- Hendrik Schreiber
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tagtraum.audiokern.key.Chord
Chord.Type
-
-
Constructor Summary
Constructors Constructor Description SeventhChord(Tone[] tones)
SeventhChord(Tone root, Chord.Type type)
SeventhChord(Tone t1, Tone t2, Tone t3, Tone t4)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeFormedFrom(Tone[] tones, int length)
Indicates whether an array of tones contains all the necessary tones to form this seventh chord.boolean
contains(Tone tone)
boolean
equals(Object o)
static SeventhChord
getCorrelatingChord(float[] chromagram, Tone baseTone)
Computes the seventh chord with the highest correlation to the given chromagram.float
getCorrelation(float[] chromagram, Tone chromagramBase)
Computes the correlation of this chord (and type) to a chromagram with the given base tone.Tone
getRoot()
Tone[]
getTones()
Chord.Type
getType()
int
hashCode()
String
toString()
static SeventhChord[]
values()
All possible seventh chords.
-
-
-
Method Detail
-
values
public static SeventhChord[] values()
All possible seventh chords.- Returns:
- seventh chords
-
getType
public Chord.Type getType()
-
getCorrelation
public float getCorrelation(float[] chromagram, Tone chromagramBase)
Description copied from interface:Chord
Computes the correlation of this chord (and type) to a chromagram with the given base tone.- Specified by:
getCorrelation
in interfaceChord
- Parameters:
chromagram
- chromagram- Returns:
- correlation coefficient
-
getCorrelatingChord
public static SeventhChord getCorrelatingChord(float[] chromagram, Tone baseTone)
Computes the seventh chord with the highest correlation to the given chromagram.- Parameters:
chromagram
- chromagrambaseTone
- base tone of the chromagram- Returns:
- seventh chord with the highest correlation coefficient
-
canBeFormedFrom
public boolean canBeFormedFrom(Tone[] tones, int length)
Indicates whether an array of tones contains all the necessary tones to form this seventh chord. The array may contain more than necessary tones.- Specified by:
canBeFormedFrom
in interfaceChord
- Parameters:
tones
- toneslength
- number of tones of the given tone array to take into account- Returns:
- true, if this seventh chord can be formed from the given array of tones
-
-