Package eu.bandm.music.entities
Class MetricConsumer.WriteOut
java.lang.Object
eu.bandm.music.entities.MetricConsumer.WriteOut
- Enclosing class:
MetricConsumer
Basic class for writing out the result of the last
So the usage is something like
MetricConsumer.getNext() call.
The call-back methods must be overriden by the user.
The signatures are the same as with MSplitter.Result.WriteOut.
One can get the corresponding instance of the MSplitter.Result
directly by MetricConsumer.getResult(), but this is seldom sensible.
Only with this class the index and flag values correctly reflect the
cross-measure-bar situation.
So the usage is something like
myMetricConsumer.getNext();
myMetricConsumer.new WriteOut(){
&at;Override public void open_proportion(final Rational p, final Rational when){
// user code
}
&at;Override public void close_proportion(final Rational p, final Rational when){
// user code
}
&at;Override public void writeOut(final int index,
final MTree node,
final DottedBaseDuration duration,
final Rational prop,
final StemEnd beams,
final boolean isSound,
final boolean isFirst,
final boolean isLast){
// user code
}
}.process()
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclose_proportion(Rational proportion, Rational time) Close an open tuplet bracket.abstract voidopen_proportion(Rational proportion, Rational time) Start a new tuplet bracket.voidprocess()Loop through all events in this result and call the call-back methodwriteOut(int,MTree,RationalDuration.DottedBaseDuration,Rational,StemEnd,boolean,boolean,boolean)for every single note symbol (/pause symbol) resulting from the preceding notational split-and-merge process.abstract voidwriteOut(int index, MTree node, RationalDuration.DottedBaseDuration symbol, Rational proportion, StemEnd beams, boolean isSound, boolean isFirst, boolean isLast) Write out one symbol of an event.
-
Field Details
-
msw
-
-
Constructor Details
-
WriteOut
public WriteOut()
-
-
Method Details
-
writeOut
public abstract void writeOut(int index, MTree node, RationalDuration.DottedBaseDuration symbol, Rational proportion, StemEnd beams, boolean isSound, boolean isFirst, boolean isLast) Write out one symbol of an event.- Parameters:
index- the index into the original event listnode- the MTree node (for accessing "weight" etc.)symbol- the (possibly dotted) symbol to printproportion- the currently effective proportion (for convenience!)beams- describes left and right beams and beamlets / flagsisSound- whether the symbol is sound and not pause (for convenience)isFirst- whether the symbol is the very first in the eventisLast- whether the symbol is the very last in the event
-
open_proportion
Start a new tuplet bracket. The parameter "proportion" is the specific proportion, as defined with theMTree.EssentialBracketclass. -
close_proportion
Close an open tuplet bracket. The parameter "proportion" is the specific proportion, as defined with theMTree.EssentialBracketclass. -
process
public void process()Loop through all events in this result and call the call-back methodwriteOut(int,MTree,RationalDuration.DottedBaseDuration,Rational,StemEnd,boolean,boolean,boolean)for every single note symbol (/pause symbol) resulting from the preceding notational split-and-merge process. Interspered are the calls toopen_proportion(Rational,Rational)andclose_proportion(Rational,Rational)for proportions/n-plet-brackets in the correct nesting order.
-