Enum Class Degree

java.lang.Object
java.lang.Enum<Degree>
org.jjazz.harmony.api.Degree
All Implemented Interfaces:
Serializable, Comparable<Degree>, Constable

public enum Degree extends Enum<Degree>
The possible degrees that make a chord.
  • Enum Constant Details

    • ROOT

      public static final Degree ROOT
    • NINTH_FLAT

      public static final Degree NINTH_FLAT
    • NINTH

      public static final Degree NINTH
    • NINTH_SHARP

      public static final Degree NINTH_SHARP
    • THIRD_FLAT

      public static final Degree THIRD_FLAT
    • THIRD

      public static final Degree THIRD
    • FOURTH_OR_ELEVENTH

      public static final Degree FOURTH_OR_ELEVENTH
    • ELEVENTH_SHARP

      public static final Degree ELEVENTH_SHARP
    • FIFTH_FLAT

      public static final Degree FIFTH_FLAT
    • FIFTH

      public static final Degree FIFTH
    • FIFTH_SHARP

      public static final Degree FIFTH_SHARP
    • THIRTEENTH_FLAT

      public static final Degree THIRTEENTH_FLAT
    • SIXTH_OR_THIRTEENTH

      public static final Degree SIXTH_OR_THIRTEENTH
    • SEVENTH_FLAT

      public static final Degree SEVENTH_FLAT
    • SEVENTH

      public static final Degree SEVENTH
  • Method Details

    • values

      public static Degree[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Degree valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getPitch

      public int getPitch()
      The relative pitch of the degree
      Returns:
      [0-11]
    • getNatural

      public Degree.Natural getNatural()
    • getAlteration

      public int getAlteration()
      Returns:
      -1, 0 or 1. For ex. -1 for b9.
    • toStringShort

      public String toStringShort()
      Returns:
      "0", "3", "b9", "#11", etc
    • getDegree

      public static Degree getDegree(Degree.Natural n, int alt)
      Example: n=NINTH, alt=+1, return NINTH_SHARP
      Parameters:
      n -
      alt -
      Returns:
      A ChordDegree or null if no degree match
    • getDegrees

      public static List<Degree> getDegrees(int relPitch)
      The degrees who match the relative pitch. Ex. relPitch=4 => THIRD Ex. relPitch=3 => NINTH_SHARP and THIRD_FLAT
      Parameters:
      relPitch -
      Returns:
      A Degree list with 1 or 2 degrees.
    • getDegreeMostProbable

      public static Degree getDegreeMostProbable(int relPitch)
      Provide the "most probable" degree for the specified relpitch.

      Ex: relPitch=3 (Eb) => return THIRD_MINOR rather than NINTH_SHARP.

      Parameters:
      relPitch - 0-11
      Returns:
      A Degree. Can't be null.