Class Scale

java.lang.Object
org.jjazz.harmony.api.Scale
Direct Known Subclasses:
StandardScale

public class Scale extends Object
A list of notes. Example: name=MajorPentatonic and startNote=Eb represent the scale Eb, F, G, Bb, C
  • Constructor Details

    • Scale

      public Scale(String name, Degree... degs)
      Create a scale from a list of degrees.
      Parameters:
      name -
      degs - The ascending unique degrees starting with ROOT.
  • Method Details

    • getName

      public String getName()
    • getNotes

      public List<Note> getNotes()
      The list of notes starting on middle C (60).
      Returns:
    • getNotes

      public List<Note> getNotes(Note startNote)
      The list of ascending notes starting on the specified note.
      Parameters:
      startNote -
      Returns:
      Returned notes reuse startNote's duration, velocity and Alteration.
    • getDegrees

      public List<Degree> getDegrees()
      The list of degrees composing this scale.
      Returns:
    • getIntervals

      public List<Integer> getIntervals()
      For example for scale [C,D,E,G,A], intervals=[2,2,3,2]
      Returns:
      A list of intervals between notes (size=nb of notes-1)
    • getDegree

      public Degree getDegree(int relPitch)
      Get the scale degree corresponding to specified relative pitch, if any.
      Parameters:
      relPitch -
      Returns:
      A degree or null.
    • getDegrees

      public List<Degree> getDegrees(Degree.Natural n)
      Get the scale degrees corresponding to a natural degree.

      Ex: n=NINTH, scale=MAJOR/IONIAN => return NINTH
      Ex: n=NINTH, scale=PHRYGIAN => return NINTH_FLAT
      Ex: n=NINTH, scale=ALTERED => return NINTH_FLAT and NINTH_SHARP
      Ex: n=THIRTEENH, scale=PENTATONIC_MINOR => return an empty list

      Parameters:
      n - A natural degree
      Returns:
      A list of degrees. List size is usually 1, possibly 2 or 0.
    • toString

      public String toString()
      Overrides:
      toString in class Object