public class BarDurationCollector<D extends DurationIndication,M extends MetrumIndication> extends Object
TimeScape
.
Measures are defined according to the general CWN interpretation of a
eu.bandm.tscore.model
TimeScape input.
The tscore realization of a measure is the segment between two adjacent
top level time points TpTop
with integral value labels
(see below).
Each measure/bar is identified by the numeric label of the left, i.e. the earlier
of these two limiting time points. Esp. in the generated output maps, they
are represented this way.
This interpetation requires that all top-level timepoints are
labeled with strictly increasing decimal fractions.
This should be checked by the preceding time line parsing process.
The presence of a post-comma part indicates incomplete measures. Beyond this.
the concrete numeric values have no meaning.
But it is recommended that these numbers have a distance of maximally 1.0,
and, for readability, to use the bar numbers
which would be used in a traditional hand-written or printed score,
applying CWN bar numbering rules, as far as possible.
(Please note that this is not always feasible, due to the different disciplines of
bar number re-usage around repetition marks.)
This algorithm extracts the specification of durations and metrum values from one dedicated parameter track of one dedicated voice. It distributes the values to subsequent measures and stores the result into different maps.
Both specifications of durations and of metrum may only appear at the
beginning of bars, i.e. at top level time points
TpTop
That non-top-level Tps
eu.bandm.tscore.model.TpTSub
do not carry such source texts, is
not checked here.
T 0.2 0.4 1.0 2.0 2.2 2.4 3.0 3.3 4.0 3/4 4/4 [1/4] [1/4] [1/4] [1/4] [2/4] --or-- [1/4] [1/4] [1/4] [1/4] [1/4] [2/4] [2/4]
A complete measure is what is denotated between two
integral valued top level time points.
The duration of every complete measure is defined solely by the currently valid
Metrum.
The current metrum is extracted by parsing the data of the dedicate parameter
track. If no metrum can be parsed, it is inherited from the predecessing
measure. The first measure (complete or incomplete) must carry a metrum indication.
An incomplete measure extends between two adjacent
TpTop
with one integral and one broken number.
Its length is given by a duration indication. This
is parsed from the same character data as the metrum, but easily distinguishable.
As a default, a duration is represented as a rational number in square brackets.
Other parsers may be substituted. In the
main track (cf. Event.main_parameter_name
) the round parentheses
are reserved for defining sub-divisions of time and cannot be employed
for user lexers.
A measure has a duration indication iff it is an incomplete measure.
The duration of the last incomplete measure before the next integral bar number
may be omitted if allowed by the flag lastDurationFragmentOmittable
,
and will be calculated to complete the duration as required by the metrum.
Typically, an "Auftakt" is an incomplete measure.
But also in the middle of a work there are oftenly incomplete measures,
whenever a repetition of parts is notated, which both have
Auftakts:
T 0.5 ! 1 ! ! 2 2.5 ! 3 4 VOX M 3/4[2/4] [2/4] [1/4] // ||: :||: :|
T 0.5 ! 1 ! ! 2 2.3 2.6 ! 3 4 VOX M 3/4[2/4] [1/4] [1/4] [1/4] // ||: :| |: :|
T 0.5 ! 1 ! ! 2 ! ! 3 3.999 VOX M 3/4[2/4] [1/4]or, using diffeent syntax:
T 0.5 ! 1 ! ! 2 ! ! 3 3.999 VOX M 3/4=1/2 =1/4
From the viewpoint of the top-tps the rules are:
An integral TpTop may and must have a duration iff
it starts an incomplete measure (i.e. the following Top Tp is broken)
An broken TpTop may and must have a duration (the started measure is
always incomplete). If lastDurationFragmentOmittable==true
,
the duration is optional for the very last which completes the measure.
An broken TpTop may only carry a metric indication iff it is
the very first in a score/part.
The very first TpTop must carry a metric indication.
Constructor and Description |
---|
BarDurationCollector(MuLiMessageReceiver<XMLDocumentIdentifier> msg,
Translet.Parser<M> metricParser,
Translet.Parser<D> durationParser) |
BarDurationCollector(MuLiMessageReceiver<XMLDocumentIdentifier> msg,
Translet.Parser<M> metricParser,
Translet.Parser<D> durationParser,
String openSign_duration,
String closeSign_duration) |
Modifier and Type | Method and Description |
---|---|
void |
analyse(SortedMap<BigDecimal,TpTop> dec2tp,
Vox vox,
RetractableFunction<D,Rational> duration2rational,
RetractableFunction<M,Rational> meter2rational,
boolean lastDurationFragmentOmittable,
Map<BigDecimal,M> barnum2metric_explicit,
Map<BigDecimal,Rational> barnum2duration_explict,
Map<BigDecimal,M> barnum2metric,
Map<BigDecimal,Rational> barnum2duration,
Map<BigDecimal,Rational> barnum2startpos)
Is called for all events of the meter voice which are related to
a
TpTop . |
Translet.Parser<?> |
parser() |
public BarDurationCollector(MuLiMessageReceiver<XMLDocumentIdentifier> msg, Translet.Parser<M> metricParser, Translet.Parser<D> durationParser, String openSign_duration, String closeSign_duration)
public BarDurationCollector(MuLiMessageReceiver<XMLDocumentIdentifier> msg, Translet.Parser<M> metricParser, Translet.Parser<D> durationParser)
public Translet.Parser<?> parser()
public void analyse(SortedMap<BigDecimal,TpTop> dec2tp, Vox vox, RetractableFunction<D,Rational> duration2rational, RetractableFunction<M,Rational> meter2rational, boolean lastDurationFragmentOmittable, Map<BigDecimal,M> barnum2metric_explicit, Map<BigDecimal,Rational> barnum2duration_explict, Map<BigDecimal,M> barnum2metric, Map<BigDecimal,Rational> barnum2duration, Map<BigDecimal,Rational> barnum2startpos)
TpTop
. All other events may not carry a metric indication.
This is checked NOT YET, because on these other events there is NO ORDER YET.
FIXME further output: collect all processed tps on the fly !? optimization !?