Class Triad

    • Method Detail

      • values

        public static Triad[] values()
        All possible triads.
        Returns:
        triads
      • 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 interface Chord
        Parameters:
        chromagram - chromagram
        Returns:
        correlation coefficient
      • getCorrelatingChord

        public static Triad getCorrelatingChord​(float[] chromagram,
                                                Tone baseTone)
        Computes the triad with the highest correlation to the given chromagram.
        Parameters:
        chromagram - chromagram
        baseTone - base tone of the chromagram
        Returns:
        triad 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 triad. The array may contain more than necessary tones.
        Specified by:
        canBeFormedFrom in interface Chord
        Parameters:
        tones - tones
        length - number of tones of the given tone array to take into account
        Returns:
        true, if this triad can be formed from the given array of tones
      • contains

        public boolean contains​(Tone tone)
        Specified by:
        contains in interface Chord
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object