Class Tempo

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

public class Tempo extends Object
Tempo indication, relating a metric duration to a physical duration. Objects behave immutable/algebraic. For convenience, they support reading different data and construction via different data. Standard construction is by "MM", means "Mälzel's Metronome", means beats per minutes. Beats are the "refDuration" values.
  • Field Details

    • refDuration

      protected RationalDuration refDuration
    • msecs

      protected Rational msecs
    • mm

      protected Rational mm
    • msecs_per_minute

      public static final Rational msecs_per_minute
      Evident
    • mm_1_4_60

      public static final Tempo mm_1_4_60
    • pack

      protected static final BiFunction<RationalDuration,Integer,Tempo> pack
      Used for parsers.
    • parser

      public static final Translet.Parser<Tempo> parser
      Accepts the standard notation as usual in printed sheet music, e.g. 3/8=72.
    • prefixed_parser

      public static final Translet.Parser<Tempo> prefixed_parser
      Accepts the standard notation as usual in printed sheet music, e.g. MM3/8=72.
  • Constructor Details

  • Method Details

    • mm

      public static Tempo mm(RationalDuration refDuration, int mm)
      Create a tempo with "mm" beats per minute, and one beat has the given "refDuration" as its logical abstract CWN duration.
    • mm

      public static Tempo mm(RationalDuration refDuration, Rational mm)
      Create a tempo with "mm" beats per minute, and one beat has the given "refDuration" as its logical abstract CWN duration.
    • msecs

      public static Tempo msecs(RationalDuration refDuration, int msecs)
      Create a tempo in which a beat has the duration of "msecs" milliseconds, and one beat has the given "refDuration" as its logical abstract CWN duration.
    • msecs

      public static Tempo msecs(RationalDuration refDuration, Rational msecs)
      Create a tempo in which a beat has the duration of "msecs" milliseconds, and one beat has the given "refDuration" as its logical abstract CWN duration.
    • get_mm

      public Rational get_mm()
      Return the number of beats per physical minute.
    • get_msecs

      public Rational get_msecs()
      Return the physical duration of one beat.
    • get_refDuration

      public RationalDuration get_refDuration()
      Return the abstract CWN duration of one beat.
    • get_mm

      public Rational get_mm(RationalDuration newref)
      Return the number of beats per physical minute, when the beat changes the dedicated abstract CWN duration, but in correct proportion to the original beat.
    • get_msecs

      public Rational get_msecs(RationalDuration newref)
      Return the physical duration of a new beat, when the beat changes the dedicated abstract CWN duration, but in correct proportion to the original beat.
    • get_msecs_per_whole

      public Rational get_msecs_per_whole()
    • toString

      public String toString()
      Returns as a String the standard notation as usual in printed sheet music, e.g. 3/8=72.
      Overrides:
      toString in class Object