Class Metric2Duration

java.lang.Object
eu.bandm.music.entities.Metric2Duration

public class Metric2Duration extends Object
Lists all note values which may be used at a certain metric position in a bar. Some things are quite natural and have a canonical decision: E.g. normally you do not want a half note starting one-eights after the start of the bar. A doubly-dotted half note but may be permitted. In a four-quarter bar it is a matter of taste whether you allow a dotted quarter on the "two" beat (one quarter after the start of the bar). And whether you allow a syncopized half note or prefer to write it using a tie. So there are some default methods for filling a Metric2Duration according to some standards. You are free to create a modifiable clone of these and adjust them to your needs.
  • Field Details

  • Constructor Details

    • Metric2Duration

      public Metric2Duration(Rational barLength)
  • Method Details

    • getAllowed

      public Multimap<Rational,Rational> getAllowed()
    • getLongestAllowed

      public Rational getLongestAllowed(Rational pos, Rational dur)
      returns null iff no lower limit at this metric position. On caller level, this is mostly an error!
    • add

      public Metric2Duration add(Multimap<Rational,Rational> additional)
      Adds for certain positions a set of allowed durations each.
    • add

      public Metric2Duration add(Rational pos, Rational dur)
      Allows at a certain position a certain duration.
    • add

      public Metric2Duration add(int posNum, int posDen, int durNum, int durDen)
      Allows at a certain position a certain duration.
    • addAllDoubleAlignedDotted

      public Metric2Duration addAllDoubleAlignedDotted(Rational baseValue, int maxDotCount)
      Adds all dotted versions up to the given dot count of the given base value to all metric positions where it either starts or ends on an integer multiple of its double value. E.g.
         quarter     0  .  .   .  1   .   .   .   2   .   .   .  3   .   .   .  |
         starts of quarter without dots:
                     X            X               X              X 
         starts of dotted quarter:
                     X     X                      X       X 
         starts of double dotted quarter:
                     X  X                         X   X 
      
         starts of dotted eighth:
                     X  X         X   X           X   X          X   X    
       
    • addIncreasingDoubleAlignedDotted

      public Metric2Duration addIncreasingDoubleAlignedDotted(Rational startValue, int startDotCount)