Package eu.bandm.music.entities
Class MetrumSpecs
java.lang.Object
eu.bandm.music.entities.MetrumSpecs
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
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".
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".
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected SortedMap<BigDecimal,
Rational> Complete map, for opimized retrievalprotected SortedMap<BigDecimal,
MTreeSpec> Complete map, for opimized retrieval.protected SortedMap<BigDecimal,
Rational> Partial map.protected SortedMap<BigDecimal,
Rational> complete map:final Translet.Parser<MetrumSpecs.Name>
protected Map<Event,
MetrumSpecs.Name> final Translet.Parser<?>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) void
barnumShouldBeBroken
(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, Event e, BigDecimal barnum) (package private) void
barnumShouldBeInteger
(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, Event e, BigDecimal barnum) 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.(package private) void
checkNameConsistency
(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, Event e, MetrumSpecs.Name name, MTreeSpec mtree) (package private) void
checkNotTop
(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, Vox voice, boolean isMain) FIXME unvollständige takte aber doch noch erlaubt !?!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".ATTENTION, only toTops are allowed in which an EVENT is defined! All other measures are NOT expanded above!static boolean
-
Field Details
-
run
-
runrun
-
endrun
-
mtrees
-
durations
-
names
-
nameParser
-
parseMetrics
-
barnum2mtree
Complete map, for opimized retrieval. For accessing the local overwrites, the retrieval methods(Vox, Event)
and(Vox, TpTop)
additionally considermtrees
. -
barnum2duration
Complete map, for opimized retrieval -
barnum2startpos
complete map: -
barnum2phase
Partial map. "not contains key" means a phase of Rational.ZERO, ie. end of a complete measure.
-
-
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
-
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
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
-