Class FunctionalInterval

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

public class FunctionalInterval extends Entity<FunctionalInterval>
The distance of two pitches or pitch classes in functional music theory. Each is characterized by a particular combination of two distances: In diatonic steps and in half-tone / chromatic steps. These distances vary (basically) idependently. The have names in different (human) languages, which are automatically generated when an instance is constructed, based on the textual building blocks defined explicitly for the diatonic distances and the chromatic modifications. The naming scheme in human discourse goes up to "double diminished", as in "double diminished fifths" of a c-flat above a f-sharp (Bruckner Symphony I/1, m.102) = funCode D//9- --> D//5+. The algorithm herein does not impose limits but delivers names like "3*augmented fifth".
  • Field Details

    • modifiers

      static Catalog<Integer> modifiers
      Represents the modifiers for the intervals size. Basically, there are "imperfect" intervals which exist in a "major" / "groß" / "large" variant and in a "minor" / "klein" / "small" variant, vs. "perfect" intervals which only have one (default) form. (Reflected here by the value of perfectKind)

      (The single default form of perfect intervals is sometimes named with the modifier "pure" / "rein", to emphasize the contrast to "diminished", etc., but the modifier "pure" can be left out, and should be left out whenever it could be mixed up with "pure tuning".)

      The inverval which is one half-step larger than the major or the pure form is the augmented form. The interval which is one half-step larger than the augmented form is the double augmented form. The inverval which is one half-step smaller than the minor or the pure form is the diminished form. The interval which is one half-step smaller than the diminished form is the double diminished form.

    • scalarStepsNames

      static Catalog<Integer> scalarStepsNames
      Contains the names of the unmodified base intervals. Indexed by the number of diatonic steps they bridge.
    • appendModifiers

      static Set<String> appendModifiers
      All languages which put the modifier after the base name.
    • catalog

      public static final EntityCatalog<FunctionalInterval> catalog
      The catalog in which all functional intervals are contained, adressable either with human language or with a synthetic name. Both kinds of names are calculated automatically from the basic interval names in scalarStepsNames and the modifiers in modifiers.
    • diatonicDistance

      protected int diatonicDistance
      The number of scale degrees bridged by this interval, i.e. the number of keys of one particular diatonic scale. (This distance is the historic origin of the names of the intervals, when including also the start point in the figure. The "second" is the interval which goes one(1) step upward the diatonic scale.
    • halfToneDistance

      protected int halfToneDistance
      The number of half-tone steps bridged by this interval. This is the number of physical keys on a chromatic keyboard, not considering a diatonic context.
    • byDiatonicDistance

      protected static Map<Integer,Map<Integer,FunctionalInterval>> byDiatonicDistance
      Maps diatonicDistance to maps from halftone distance to functional interval.
    • perfectKind

      protected final boolean perfectKind
      Indicates that this interval has only one un-altered form.
    • isOvershooting

      protected final boolean isOvershooting
      Indicates that this interval is larger than a seventh, i.e. not relevant harmonically.
    • _1

      public static final FunctionalInterval _1
    • _kl2

      public static final FunctionalInterval _kl2
    • _gr2

      public static final FunctionalInterval _gr2
    • _kl3

      public static final FunctionalInterval _kl3
    • _gr3

      public static final FunctionalInterval _gr3
    • _4

      public static final FunctionalInterval _4
    • _ue4

      public static final FunctionalInterval _ue4
    • _verm5

      public static final FunctionalInterval _verm5
    • _5

      public static final FunctionalInterval _5
    • _kl6

      public static final FunctionalInterval _kl6
    • _gr6

      public static final FunctionalInterval _gr6
    • _kl7

      public static final FunctionalInterval _kl7
    • _gr7

      public static final FunctionalInterval _gr7
    • _okt

      public static final FunctionalInterval _okt
    • _klNon

      public static final FunctionalInterval _klNon
    • _grNon

      public static final FunctionalInterval _grNon
    • _klDez

      public static final FunctionalInterval _klDez
    • _grDez

      public static final FunctionalInterval _grDez
    • _2okt

      public static final FunctionalInterval _2okt
  • Method Details

    • addModifierTranslation

      public static void addModifierTranslation(int mod, String lang, String text)
      Modifiers are encoded by integers, NOT by a scalar type, because conceptually they can grow infinitely.
      • 4 = augmented augmented augmented etc. (<-- synthesized, if not defined)
      • 3 = double augmented
      • 2 = augmented
      • 1 = large/major
      • 0 = pure/unmodified/rein
      • -1 = small/minor
      • -2 = diminished
      • -3 = double diminished
      • -4 = diminished^3 (<-- synthesized, if not defined)
    • addScalarStepsName

      public static void addScalarStepsName(int steps, String lang, String name)
      Add a new translation for a base interval. See scalarStepsNames.
    • declareLanguageToAppendModifiers

      public static void declareLanguageToAppendModifiers(String s)
      Add the given language to those which put the modifier after the base name.
    • moduloOctave

      public FunctionalInterval moduloOctave()
      Returns the smallest form modulo octave, i.e. a harmonically relevant interval.
    • valueOf

      public static FunctionalInterval valueOf(int scaleDistance, int halfToneDistance)
      Returns the interval with the given scale and halftone distances. If no instance exists, a new one is created and a name is constructed in every language ever used for base intervals and modifiers.
    • rehashNames

      public static void rehashNames()
      After translations for modifiers and base scale steps have been added for further languages, all names must be calculated anew.

      The implemented algorithm assumes that adding a name is IDEMPOTENT! FIXME CHECK

    • times

      public FunctionalInterval times(int i)
      Return the interval defined by i-times applying this interval.
      Parameters:
      i - must be >= 0
    • plus

      Return the interval resulting from adding both intervals.
    • addHalfTone

      public FunctionalInterval addHalfTone(int ht)
      Return the interval resulting from adding the half-tone modification.
    • addOctave

      public FunctionalInterval addOctave(int octave)
      Return the interval resulting from adding the octave tone modification.
      Parameters:
      octave - must CURRENTLY FIXME be >= 0
    • get_diatonicDistance

      public int get_diatonicDistance()
      Returns the number of diatonic steps bridged by this interval.
    • get_halfToneDistance

      public int get_halfToneDistance()
      Returns the number of chromatic steps / half tone steps bridged by this interval.
    • get_isOvershooting

      public boolean get_isOvershooting()
      Returns whether the interval is larger than an octave, i.e. harmonically (in the narrowest sense) not relevant.
    • dump

      public void dump(PrintStream ps)
      Make a debug print out.
      Overrides:
      dump in class Entity<FunctionalInterval>
    • transpose_up

      Transpose a functional pitch upward by the functional interval.
    • transpose_down

      Transpose a functional pitch downward by the functional interval.
    • transpose_up

      Transpose a functional pitch class up (modulo octave) by the functional interval.
    • transpose_down

      public FunctionalPitchModOctave transpose_down(FunctionalPitchModOctave pitch)
      Transpose a functional pitch class down (modulo octave) by the functional interval.