Class MTreeCollector<M>

java.lang.Object
eu.bandm.music.entities.MTreeCollector<M>
Type Parameters:
M - the class used as "meter names"

public class MTreeCollector<M> extends Object
Constructs different mappings into MTreeSpecs and provides the retrievel methods:
  1. map "names for meters" at a particular time point to an MTreeSpec.
  2. map particular time point in a particular voice to an MTreeSpec
      Co-operates with MeasureCollector: The latter collects the names of meters in the Main M-voice and stores them into barnum2metrum_explicit, which is passed to the method insertMVoice(Vox,SortedMap).
  • Field Details

    • runUpToExplicit

      public static final String runUpToExplicit
      Constant operator to indicate that an mtree specification local to a voice shall be valid until the next explicit entry in this voice. (This is called "runrun mode".)
      See Also:
    • runUpToCommon

      public static final String runUpToCommon
      Constant operator to indicate that an mtree specification local to a voice shall be valid until the next explicit local entry or the next entry in the global M-Voice, whatever comes earlier. (This is called "run mode".)
      See Also:
    • useCommon

      public static final String useCommon
      Constant operator to indicate that from here on the mtree specification in the M-Voice is again used in this voice.
      See Also:
    • msg

      protected final MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg
      Evident
    • paramNameMTree

      protected final String paramNameMTree
      Name of the parameter track to parse for mtree specifications. Constant, set once on construction.
    • topTps

      protected final Iterable<TpTop> topTps
      List of all time points to parse. Constant, set once on construction.
    • tp2barnum

      protected final Map<TpTop,BigDecimal> tp2barnum
      Input data, linking the top time points to bar numbers / measure numbers. Constant, set once on construction.
    • commonDefs

      public SortedMap<BigDecimal,MTreeSpec> commonDefs
      Map all measure numbers to the mtree spec which is valid in that measure, according to the global "M" voice.
    • explicitCommons

      public Set<BigDecimal> explicitCommons
      Where explicit meter name definitions are in the global M voice.
    • voiceDefs

      public Map<Vox,SortedMap<BigDecimal,MTreeSpec>> voiceDefs
      Map measure numbers to localdefinitions of meter names to mtree specs, per voices.
  • Constructor Details

    • MTreeCollector

      public MTreeCollector(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, String paramNameMTree, Iterable<TpTop> topTps, Map<TpTop,BigDecimal> tp2barnum)
      Constructor for the user.

      ATTENTION params 1 - 3 may be NULL fuer programmatic fill = direct write to map FIXME AUFRÄUMEN!!

  • Method Details

    • searchBackwards

      @Opt public @Opt MTreeSpec searchBackwards(SortedMap<BigDecimal,M> explicitMeterNames, M metername, BigDecimal barnum)
      Search for the mtree spec definition for a particular meter name, which is valid at a particular measure number.
      Parameters:
      explicitMeterNames - names by measure number ("bar number")
      metername - the name to find a definition for
      barnum - the point where the definition shall be valid
    • insertMVoice

      public void insertMVoice(Vox voice, SortedMap<BigDecimal,M> explicitMeterNames)
      Analyse the "mtree" parameter track of the global metric "M" voice. Meter names are (together with tempo etc.) in the main param track, have been parsed by MeasureCollector, and are passed as method argument.

      Here the meter names from the m voice are checked a second time: Each first occurance of a particular meter name must be accompanied by an mtree spec. Each later occurance can copy the last assignment.

      Parameters:
      voice - the global "M" voice
      explicitMeterNames - the names of the meters collected in this voice (by MeasureCollector) by measure numbers.
    • insertVoice

      public void insertVoice(Vox voice)
      Analyse the "mtree" parameter track of a particular voice which is not the global metric "M" voice. Creates a map in voiceDefs which maps every measure number to a meter definition.
      Parameters:
      voice - to analyze.
    • checkNotTop

      void checkNotTop(Vox voice)
      Verify that mtree source text does appear only with top level time nodes, not with sub-nodes.
    • insertVoice_noMTreeSpecs

      public void insertVoice_noMTreeSpecs(Vox voice)
      Add the map of all measure numbers to an mtree spec for a voice which is known to have no own/local mtree specifications.
    • get

      public MTreeSpec get(Vox v, BigDecimal t)
      Return the mtree specification valid for a particular voice and measure number.