Class FunctionalKey

java.lang.Object
eu.bandm.tscore.base.Entity<FunctionalKey>
eu.bandm.music.entities.FunctionalKey
All Implemented Interfaces:
Translet.Parseable<FunctionalKey>

public class FunctionalKey extends Entity<FunctionalKey>
Indicates a tonal key (/"Tonart"/"diatonics") in tonal theory. Please note that the concrete meaning of the instances can vary widely, depending on the context. For instance, a particular scale of pitches of set of pitch classes may or may not be determined by a particular value. This depends on the applied theory. Nevertheless, values of this type are frequently used to name opera.
  • Field Details

  • Method Details

    • get_gender

      public FunctionalGender get_gender()
      Return the gender of the key.
    • get_base

      public FunctionalPitchModOctave get_base()
      Return the base pitch of the key.
    • get_fifthsFromC

      public int get_fifthsFromC()
      Get the distance of the base (in case of major) or the base of the relative key (/"parallele Durtonart") in case of minor, from the pitch class of "C". This is the fundamentel means of sorting keys in the so-called "Circle of Fifths" (which is indeed per se a spiral and not a circle.)
    • valueOf

      public static FunctionalKey valueOf(FunctionalPitchModOctave base, FunctionalGender gender)
    • toString

      public String toString(String lang)
      Returns a name in the given language. This algorithm follows the tradition to write major keys capitalized and minor keys with lower case initials.
    • getName

      public String getName(String lang)
      Returns a name in the given language. This algorithm follows the tradition to write major keys capitalized and minor keys with lower case initials.
      Overrides:
      getName in class Entity<FunctionalKey>
    • 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<FunctionalKey>
    • getExplicitParser

      public static Translet.Parser<FunctionalKey> getExplicitParser(String lang, String delim)
      Delivers a parser which accepts the names of the pitch classes (only) as they were defined. These are followed by the delimiter (which may be the empty string) and the explict word for major/minor selection,
    • getCapitalizationAdjustedParser

      public static Translet.Parser<FunctionalKey> getCapitalizationAdjustedParser(String lang, String delim)
      Delivers a parser which accepts the lower-initial variant of a pitch class followed by the word for minor, and the upper-initial variant for major. Separaterd by the string delim, which may be the empty string.
    • getCapitalizationOnlyParser

      public static Translet.Parser<FunctionalKey> getCapitalizationOnlyParser(String lang)
      Delivers a parser which accepts only the pitch class names and derives the gender/mode from the case of the initial character.