Class MTree.EssentialBracket

java.lang.Object
eu.bandm.music.entities.MTree.EssentialBracket
Enclosing class:
MTree

public static class MTree.EssentialBracket extends Object
Models a proportional bracket, spanning note heads, which is unavoidable due to the prime factors of the denominators of the duration values. ATTENTION: Is (currently) only determined by its duration factor, which is a RATIONAL! So all visual appearances not identic with a normalized rational, like "|-- 6:8--|", cannot be realized.
  • Field Details

    • predec

      @Opt protected @Opt MTree.EssentialBracket predec
      The next higher (relevant, non-vanishing) bracket covering this node.
    • effectiveProportion

      protected final Rational effectiveProportion
      Proportion to be applied to all nodes below this bracket. Is the product of bracketProportion of this bracket and all brackets atop. All notated time value symbols (note heads, flags etc.) must be multiplied by this proportion to get the intended duration value. Vanishing brackets do only count for the immediately spanned (single) node, thus are dropped from the calculation for all DEEPER brackets.
    • bracketProportion

      protected final Rational bracketProportion
      Proportion introduced by this very bracket. (For the effect see effectiveProportion.)
    • endTime

      protected final Rational endTime
      End time point (relative to 0.0 as start point of the measure(=top-level node), i.e. relative to the start point of all nodes.
    • singleton

      protected final boolean singleton
      Whether this bracket spans only one single node. (In very modern notation styles, like "1/4+1/6").
    • convenient

      protected final boolean convenient
      Whether this bracket is also for convenience = realizes an odd numerator in its duration factor.
    • vanishing

      protected final boolean vanishing
      Whether the bracket vanishes iff subnodes are printed.
    • effectiveDenomFactors

      protected final PrimeFactors effectiveDenomFactors
      Convencience cache, all prime factors of the denominator, without powers of two.
  • Constructor Details

    • EssentialBracket

      public EssentialBracket(@Opt @Opt MTree.EssentialBracket predec, int bracketDenominator, int bracketNumerator, Rational endTime, boolean singleton, boolean vanishing)
      Effekt of an EB: multiply the written duration (=note symbols=note heads, flags etc.) by proportion n/d to get the meant duration. The modern front-end notation will show a bracket with "d:n" = "play d notes instead of n".

      d and n are given explicity, n must not be even when calling this special constructor. (For more simple EBs with only a clean power of two as n use EssentialBracket(EssentialBracket,int,CheckedParameters,Rational,boolean,boolean).) So this constructor delivers an "essential" bracket, which is "also convenient", like "|-5:7-|".

      Parameters:
      predec - the next higher (relevant, non-vanishing) bracket covering this node.
      bracketDenominator - the value "d", i.e. the divider of the durations.
      bracketNumerator - the value "n", i.e. the numerator of the rational giving the proportion.
      endTime - position in the measure where this bracket ends.
      singleton - whether this bracket spans only one single node (in very modern notation styles, like "1/4+1/6").
    • EssentialBracket

      public EssentialBracket(@Opt @Opt MTree.EssentialBracket predec, int bracketDenominator, MTree.CheckedParameters parameters, Rational endTime, boolean singleton, boolean vanishing)
      Effekt of an EB: multiply the written duration (=note symbols=note heads, flags etc.) by proportion n/d to get the meant duration. The modern front-end notation will show a bracket with "d:n" = "play d notes instead of n".

      The numerator "n" of the proportion is set to some near power of two, as specified by MetricParameters.MTreeParameters.proportiones_lentiores and MTree.numeratorByMenoList(int, java.util.Set<java.lang.Integer>).

      Parameters:
      predec - the next higher (relevant, non-vanishing) bracket covering this node.
      bracketDenominator - the value "d", i.e. the divider of the durations.
      parameters - needed to invent the numerator of the bracket's factor
      endTime - position in the measure where this bracket ends.
      singleton - whether this bracket spans only one single node (in very modern notation styles).
  • Method Details

    • withVanishing

      public MTree.EssentialBracket withVanishing(boolean newVanishing)
      Create a copy with only "vanishing" set to the given value.
    • toString

      public String toString()
      Give a symbolic text representation for debugging.
      Overrides:
      toString in class Object