Class FunctionalPitchModOctave

All Implemented Interfaces:
PitchIndication, Translet.Parseable<FunctionalPitchModOctave>, Comparable<FunctionalPitchModOctave>

public class FunctionalPitchModOctave extends PitchModOctave<FunctionalPitchModOctave> implements PitchIndication, Comparable<FunctionalPitchModOctave>
A pitch class mod octave which combines a "natural" note name [dt "Stammton"], given as an instance of WhiteKeyModOctave, with an alteration (normally in the range -2 to +2). These instances are in many cases the fundamental means for speficying pitch inputs, e.g. by parsing source texts. They can be accessed by very different names in different (human) languages. Named instances are pre-constructed in the conventional range, from zero to two accidentals, but this is not a limit for the construction of accidentals and functional pitches. Currently only the German language names are supported. Many languages do not have dedicated names, but append some representation of the accidental to the name of the white key, like "c#" or "c sharp" in English.
  • Field Details

  • Constructor Details

  • Method Details

    • get_natural

      public WhiteKeyModOctave get_natural()
      Return the natural key from which this pitch class is derived.
    • get_accidental

      public Accidental get_accidental()
      Return the accidental. Will be Accidental.natural if no shift by accidental applies.
    • compareTo

      public int compareTo(FunctionalPitchModOctave other)
      Technically required, to make "TreeMaps" etc. Semantically not very sensible, because very different comparison orders are sensible.
      Specified by:
      compareTo in interface Comparable<FunctionalPitchModOctave>
    • get_halfTonesFromC

      public int get_halfTonesFromC()
      Return the distance from c in half tones. This is a rather arbitrary measure, and is valid only modulo 12.
    • get_fifthsFromC

      public int get_fifthsFromC()
      Return the distance from c in fifth. This is a precise measure and not subject to any modulo.
    • minus

      The interval we have to go up from some pitch of the given parameter pitch class to the nearest pitch of this pitch class.
    • lowerInitialParser

      public static Translet.Parser<FunctionalPitchModOctave> lowerInitialParser(String lang)
      Deliver a parser with lower initial characters, in the given language.
    • upperInitialParser

      public static Translet.Parser<FunctionalPitchModOctave> upperInitialParser(String lang)
      Deliver a parser with upper initial characters, in the given language.
    • _x_upperInitialParser

      protected static Translet.Parser<FunctionalPitchModOctave> _x_upperInitialParser(String lang, boolean upper)
      Deliver a parser with lower or upper initial characters, in the given language.
    • toString

      public String toString()
      Description copied from class: Entity
      Get any name, preferable in the EntityCatalog.symbolic language, as defined in MuLi.get(String...). If this fails, get built-in Object.toString() conversion result.
      Overrides:
      toString in class Entity<FunctionalPitchModOctave>
    • valueOf

      public static FunctionalPitchModOctave valueOf(int wk, int alt)
      Deliver the functional pitch class derived from the given white key mod octave and the given chromatic shift by accidental. If no such instance exists, a new one (synthetic and adressable only by a "valueOf()" method) is created and cached.
      Parameters:
      wk - the white key by its distance from c (from 0 to 6)
      alt - the alteration, given numerically.
    • valueOf

      public static FunctionalPitchModOctave valueOf(WhiteKeyModOctave wk, Accidental alt)
      Deliver the functional pitch class derived from the given white key mod octave and the given chromatic shift by accidental. If no such instance exists, a new one (synthetic and adressable only by a "valueOf()" method) is created and cached.
      Parameters:
      wk - the white key, given as an object.
      alt - the alteration, given as an object.
    • valueOf

      public static FunctionalPitchModOctave valueOf(WhiteKeyModOctave wk, int alt)
      Deliver the functional pitch class derived from the given white key mod octave and the given chromatic shift by accidental.
      Parameters:
      wk - the white key given as an object.
      alt - the alteration, given numerically.