Class MetrumSpecs

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

public class MetrumSpecs extends Object
Combines the data structures and evaluation rules for the metric specs in a "main/metric voice" (normally called "M") and local alternatives for a particular (sounding) voice.
The rules are complicated because they reflect the historic rules of CWN.
Basically: The M-voice gives in its main track the "name" of a metrum, which is CURRENTLY an arbitrary Rational value, possibly followed by a modifing character. At its FIRST appearance (in measure number order) this must be mapped to a MTreeSpec. This gives the meaning of this name, up to any re-definition (in measure number order).
ATTENTION only "mtrees" for the local voices is altered. All other information is cached based on bar numbers.

(This class combines the old deprecated "MeasureCollector" and "MTreeCollector".
  • Field Details

  • Constructor Details

    • MetrumSpecs

      public MetrumSpecs()
  • Method Details

    • checkAndCacheGlobalVoice

      public void checkAndCacheGlobalVoice(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, Iterable<TpTop> topTps, Map<TpTop,BigDecimal> tp2barnum, Vox mainVox)
      first step: every metrum name must have a preceding definition: check and expand.
      second step: check whether explicit durations must sum up to a complete measure, and cache the measure durations (explicit and implicit).
      OLD outputs (MeasureCollector): barnum2metric_explicit barnum2duration_explicit barnum2metric barnum2duration barnum2startpos
    • isInteger

      public static boolean isInteger(BigDecimal b)
    • barnumShouldBeInteger

      void barnumShouldBeInteger(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, Event e, BigDecimal barnum)
    • barnumShouldBeBroken

      void barnumShouldBeBroken(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, Event e, BigDecimal barnum)
    • expandLocalVoice

      public void expandLocalVoice(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, Iterable<TpTop> topTps, Map<TpTop,BigDecimal> tp2barnum, Vox globalVoice, Vox vox)
      Distribute a local metric definition in "mtrees" to any subsequent measure (only those which have a TpTop-Event!), as long as it is "running". (Optimization: for faster later retrieval.)
    • checkNameConsistency

      void checkNameConsistency(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, Event e, MetrumSpecs.Name name, MTreeSpec mtree)
    • checkNotTop

      void checkNotTop(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, Vox voice, boolean isMain)
      FIXME unvollständige takte aber doch noch erlaubt !?!
    • getMTree

      public MTreeSpec getMTree(Vox vox, TpTop tpTop)
      ATTENTION, only toTops are allowed in which an EVENT is defined! All other measures are NOT expanded above!
      Returns:
      the MTreeSpec for a particular measure in a particular voice, by first considering the local overwrites, then the current global setting.
    • getMTree

      public MTreeSpec getMTree(Vox vox, Event event)