Class Score_cwn
It imposes the following properties:
-
The
TpTop
top level time points are labeled mostly with *integral* numbers, in continuously increasing order. These can be seen as "measure numbers", but may be based anywhere. Every segment between two adjacent top level Tp labels is meant as one musical measure. Most measures are "complete", but there may be "incomplete" measures, eg. for upbeats and for to carry repetition bars. - There is one dedicated global metric voice named "M". Its main parameter is the metrum. There must be at least ONE event at the beginning of the score, on the very first event, which specifies the metrum of the first bar.
- Metrum specifications are only allowed on the "beat one" of each measure, except in the very first measure.
-
Metrum specifications are firstly only "names" for meter.
At each first appearance, a second parameter track named "mtree" must give a definition
according to the syntax defined in
MTree
. - This global voice "M" may have a second parameter track, called "tempo", or further tracks for overall parameters like "general espression directives", etc.
- All further voices hold the data for some instrument taking part in the music. They use some pitch class with "running octave" as a their main parameter.
- They may have a second track "nota" containing notation specs, like clefs and keys, and/or a track "artik" for articulation etc. The very first event must have a nota-event specifying the key. ((FIXME schlagzeug?Horn?))
- "volume" (aka "loudness", "intensity", "dynamics") is STILL MISSING FIXME.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Function3<Comparator<? super BigDecimal>,
BigDecimal, BigDecimal, String> Checks that two consecutive time points are (a) strictly increasing, but (b) not more than "1.0" distant.(package private) final String
Prefix in the source text for a clef indication.final SortedMap<BigDecimal,
TpTop> Maps bar numbers / measure numbers to tscore top-leve time points.(package private) final Map<Event,
Artikulation> Artikulation parsed from the param track calledparamname_articulation
.Maps events of sounding voices to a clef change, from param track .Maps events to their end time point.(package private) final Map<Event,
FunctionalKey> Maps events of sounding voices to a key change, from param track .Additional text to be printed below the rendering of a note.Ornamentation parsed from the param track calledparamname_articulation
.Maps voice events to one nominal pitch.Explicit hint for printing, when multiple voices share one staff.Maps events from the global "M" voice to a tempo indication.Additional text to be printed above the rendering of a note.Maps events of a sounding voice to a lyric syllable.Whether a cautionary accidental is requested explicitly by the tscore source, in the param track calledparamname_nota
.Whether an accidental is requested explicitly by the tscore source, in the param track calledparamname_nota
.The very first time point of the score.Marks voice events as being a "hold", which is an unaltered prolongation of the preceding event(package private) final String
Human language in which the tscore input will be interpreted.The very last time point of the score.The rational time point of the very last top level tscore time point.Event sets standing for legato arcs, parsed from the param track calledparamname_articulation
.final MeasureCollector<MetrumName>
Collector for the meter names and duration indications in the main metric voice "M".The global voice vor metric, tempo, and global expression information.static final Modifiers
Modifiers controlling the parsing process.Groups of events collected to represent "analytical brackets" for motifs, etc.(package private) final SimpleMessage.Sender<eu.bandm.tools.util.xml.XMLDocumentIdentifier>
Only for conveniently construction messages and sending them tomsgr
(package private) final MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>>
The drain for all messags.protected MTreeCollector<MetrumName>
Collector for the meter specifications in the main meter voice (mandatory) and in sounding voice (optional).static final String
Name of the parameter track of a normal voice carrying articulation marks.static final String
Metric specifications are the main events in the global metric voice.static final String
Name of the parameter track of the main metric voice with metric tree formulas.static final String
Name of the parameter track of a normal voice carrying notation (meta-) information.static final String
Name of the parameter track of a normal voice carrying "lyrics" / text syllables.static final Translet.Parser<BigDecimal>
Parser for measure numbers accept a non-negative integer, and maybe a decimal point with a fractional part.final Part
The score data as (in most cases) parsed by tscore.Marks voice events as being a pause.Inverse oftp2rat
.Maps all tscore time points to rational numbers which correspond to the musical time relative to the start of the very first event.(package private) final Map<TpTop,
BigDecimal> Inverse ofdecimal2tpTop
.static final String
The name of the mandatory global "metric" voice. -
Constructor Summary
ConstructorDescriptionScore_cwn
(Part part, String lang, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msgr) Service providing main factory method for converting a particular PART of a TimeScape.Score_cwn
(TimeScape ts, String lang, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msgr) Service providing main factory method for converting the one and only "PART" section of the given tscore input Timescape. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCompleteMeasure
(int den, int nom, @Opt MTreeSpec mt) Append at the end of all measure specifications a new measure with the given name (looking like "den/nom") and MTree specification.void
addCompleteMeasure
(MetrumName name, @Opt MTreeSpec mt) Append at the end of all measure specifications a new measure with the given name (looking like "den/nom") and MTree specification.void
dump()
Debugging print which prints all voices.void
dump
(PrintStream ps) Debugging print which prints all voices.void
dumpVoice
(PrintStream ps, Vox voice) Debugging print which prints only the time point and the pitch, if it is not the metric voice.protected void
extra_tracks
(Vox v) Hook method to extend this class to parse additional parameter tracks contained in the input source text.DOCMEmakeTp
(Rational when, eu.bandm.tools.location.Location<eu.bandm.tools.util.xml.XMLDocumentIdentifier> origLoc) Add a new time point at the given rational time value, if no such already exists.multipleParts
(TimeScape ts, String lang, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msgr) Service providing main factory method for converting all "PART" sections in the given tscore input Timescape.normalizeEvents
(Vox voice, Predicate<Event> mergePauses, Predicate<Event> mergeSounds, List<Event> events, List<QualifiedRational> evStarts, List<Boolean> repeats) Step through the voice, remove "hold" symbols by the prolongating the preceding (sounding) event, merge adjacent "pause" events, and calculate the required sub-division of a quarter for the midi realization of all.int
normalizeEvents_midi_PPQ
(Vox voice, Predicate<Event> mergePauses, Predicate<Event> mergeSounds, List<Event> events, List<QualifiedRational> evStarts, List<Boolean> repeats) ExecutenormalizeEvents(Vox,Predicate,Predicate,List,List,List)
, but return the lcm of all duration numerators in the form required for Midi "Parts per quarter".void
update()
Translate untyped tscore data into semantically sensible "common western notation", and verify that all constraints are met.void
FIXME DOCME For ADDITIONAL global directices (=events) contained in the main meter voice.protected void
Second step of interpreting syntactic to semantic contents: parse the Metric voice and collect metra and durations.protected void
First step of interpreting syntactic to semantic contents: parse the TpTop text to bar numbers, constructing an ordered sequence of TpTops:void
update_voice
(Vox v) FIXME DOCMEvoid
FIXME DOCMEvoid
FIXME DOCMEvoid
void
void
FIXME DOCMEvoid
FIXME DOCME
-
Field Details
-
msgr
The drain for all messags. -
msg
Only for conveniently construction messages and sending them tomsgr
-
part
The score data as (in most cases) parsed by tscore. It is needed as public for all programs which synthesize scores. -
language
Human language in which the tscore input will be interpreted. Esp. the pitch classes and key names. -
modifiers
Modifiers controlling the parsing process. -
voicename_metric
The name of the mandatory global "metric" voice.- See Also:
-
paramname_metric
Metric specifications are the main events in the global metric voice. Therefore they have no explicit parameter name, butEvent.main_parameter_name
.- See Also:
-
paramname_mtree
Name of the parameter track of the main metric voice with metric tree formulas.- See Also:
-
paramname_articulation
Name of the parameter track of a normal voice carrying articulation marks.- See Also:
-
paramname_nota
Name of the parameter track of a normal voice carrying notation (meta-) information.- See Also:
-
paramname_verba
Name of the parameter track of a normal voice carrying "lyrics" / text syllables.- See Also:
-
parse_barNumber
Parser for measure numbers accept a non-negative integer, and maybe a decimal point with a fractional part. -
checkDistance
public static final Function3<Comparator<? super BigDecimal>,BigDecimal, checkDistanceBigDecimal, String> Checks that two consecutive time points are (a) strictly increasing, but (b) not more than "1.0" distant. -
meterVoice
The global voice vor metric, tempo, and global expression information. Will be identified by its namevoicename_metric
. -
decimal2tpTop
Maps bar numbers / measure numbers to tscore top-leve time points. -
tpTop2decimal
Inverse ofdecimal2tpTop
. -
tp2rat
Maps all tscore time points to rational numbers which correspond to the musical time relative to the start of the very first event. This this time point notion is notrelated to the measure numbers. -
firstTp
The very first time point of the score. (Must be a toplevel time point due to the syntax of the general tscore format.) -
lastTp
The very last time point of the score. This must not carry an event but mark the end-time of the very last event in any voice. (Must be a toplevel time point due to the syntax of the general tscore format.) -
lastTpTop_rat
The rational time point of the very last top level tscore time point. Seetp2rat
. -
event2tempo
Maps events from the global "M" voice to a tempo indication. -
rat2tp
Inverse oftp2rat
. -
event2endtp
Maps events to their end time point. -
pause
Marks voice events as being a pause. -
holds
Marks voice events as being a "hold", which is an unaltered prolongation of the preceding event -
event2pitch
Maps voice events to one nominal pitch. (FIXME: CHORDS with MORE THAN ONE pitch are currently not supported. -
eventHasFullAccidental
Whether an accidental is requested explicitly by the tscore source, in the param track calledparamname_nota
. The terminal symbol is fixed to "!
", which is inspired by lilypond.FIXME should be for PITCH, not for EVENT!! Current solution ASSUMES each Event has only ONE(1) Pitch!!
-
eventHasCautionaryAccidental
Whether a cautionary accidental is requested explicitly by the tscore source, in the param track calledparamname_nota
. The terminal symbol is fixed to "?
", which is inspired by lilypond.FIXME should be for PITCH, not for EVENT!! Current solution ASSUMES each Event has only ONE(1) Pitch!!
-
event2artikulation
Artikulation parsed from the param track calledparamname_articulation
. -
event2ornamentation
Ornamentation parsed from the param track calledparamname_articulation
. -
legatos
Event sets standing for legato arcs, parsed from the param track calledparamname_articulation
. -
clefPrefix
Prefix in the source text for a clef indication.- See Also:
-
event2clefUsage
Maps events of sounding voices to a clef change, from param track . -
event2key
Maps events of sounding voices to a key change, from param track . -
event2staffUsage
Explicit hint for printing, when multiple voices share one staff. -1 = "I am solo" 0 = "I am pausing" 1,2,3,4 = "I am voice number 1,2,3,4" -
motifs
Groups of events collected to represent "analytical brackets" for motifs, etc. From param trackparamname_nota
. -
event2lowerText
Additional text to be printed below the rendering of a note. -
event2upperText
Additional text to be printed above the rendering of a note. -
event2verba
Maps events of a sounding voice to a lyric syllable. -
measures
Collector for the meter names and duration indications in the main metric voice "M". -
mTreeCollector
Collector for the meter specifications in the main meter voice (mandatory) and in sounding voice (optional).
-
-
Constructor Details
-
Score_cwn
public Score_cwn(Part part, String lang, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msgr) Service providing main factory method for converting a particular PART of a TimeScape.- Parameters:
lang
- the human language to interpret pitch classes etc.
-
Score_cwn
public Score_cwn(TimeScape ts, String lang, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msgr) Service providing main factory method for converting the one and only "PART" section of the given tscore input Timescape.- Parameters:
lang
- the human language to interpret pitch classes etc.
-
-
Method Details
-
multipleParts
public static Map<String,Score_cwn> multipleParts(TimeScape ts, String lang, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msgr) Service providing main factory method for converting all "PART" sections in the given tscore input Timescape. Returns a map of Score_cwns by the names of the tscore parts.- Parameters:
lang
- the human language to interpret pitch classes etc.
-
update
public void update()Translate untyped tscore data into semantically sensible "common western notation", and verify that all constraints are met. This method READS the event lists contained in TimeScape->voices->bySourceOrder and WRITES to all the local Map and Set output data declared locally.Extending the score format is done by sub-classing this class with an "update" method starting with "super.update()". After this, additional tracks can be parsed into additional parameter containers.
Furthermore, the update process is divided into different methods to be overridden selectively:update() -> update_topTps() -> update_metric() -> update_voices() -> update_voice(v) -> update_voice_durations(v) -> update_voice_pitches(v) -> update_voice_articulations(v) -> update_voice_notations(v) -> update_voice_ornaments(v) // _and_Articulations -> update_voice_lyrics(v)
The parsing of a particular track "X" can be changed by overriding the sub-method "parse_track_X()". <---- FIXME MISSING!
-
update_voices
public void update_voices()FIXME DOCME -
update_meterVoice
FIXME DOCME For ADDITIONAL global directices (=events) contained in the main meter voice. -
update_voice
FIXME DOCME -
extra_tracks
Hook method to extend this class to parse additional parameter tracks contained in the input source text. For each of these tracks the data stores must be provided. This method is called at the end processing every single voice If it is overridden, the code must start withsuper.extra_tracks(v)
, to allow sub-classing from sub-classes. -
update_topTps
protected void update_topTps()First step of interpreting syntactic to semantic contents: parse the TpTop text to bar numbers, constructing an ordered sequence of TpTops: -
update_metric
protected void update_metric()Second step of interpreting syntactic to semantic contents: parse the Metric voice and collect metra and durations. -
update_voice_durations
FIXME DOCME -
update_voice_pitches
FIXME DOCME -
update_voice_articulations
FIXME DOCME -
update_voice_notations
-
update_voice_lyrics
-
normalizeEvents
public PrimeFactors normalizeEvents(Vox voice, Predicate<Event> mergePauses, Predicate<Event> mergeSounds, List<Event> events, List<QualifiedRational> evStarts, List<Boolean> repeats) Step through the voice, remove "hold" symbols by the prolongating the preceding (sounding) event, merge adjacent "pause" events, and calculate the required sub-division of a quarter for the midi realization of all. Checks additionally that the very first symbol has a clef and is not a "hold". Results are returned in three lists which are indexed in sync.(currently 20180310 only used in Cwn_to_{lilypond,musicxml} !! FIXME make idempotent!
FIXME merge pause only with preceding pause if not attributed (provide predicate as functional arg)- Parameters:
voice
- the voice to process (the time points to step through the voice are in the global fieldrat2tp
.mergePauses
- whether adjacent pauses shall be merged.events
- OUTPUT parameter: list of all filtered eventsevStarts
- OUTPUT parameter: list of the starting time points of the filtered eventsrepeats
- OUTPUT parameter: whether the event has the same pitch as its predecessor WIRD NICHT UNBEDINGT GEBRRAUCHT / WIEDER RAUS ??? FIXME- Returns:
- the lowest common multiple of all occuring time divisions. (Needed e.g. to set the time granularity "ppq" for a midi encoding.)
-
normalizeEvents_midi_PPQ
public int normalizeEvents_midi_PPQ(Vox voice, Predicate<Event> mergePauses, Predicate<Event> mergeSounds, List<Event> events, List<QualifiedRational> evStarts, List<Boolean> repeats) ExecutenormalizeEvents(Vox,Predicate,Predicate,List,List,List)
, but return the lcm of all duration numerators in the form required for Midi "Parts per quarter". -
initialTempo
DOCME -
dumpVoice
Debugging print which prints only the time point and the pitch, if it is not the metric voice. -
dump
Debugging print which prints all voices. FIXME timeless data auch !!?! -
dump
public void dump()Debugging print which prints all voices. FIXME timeless data auch !!?! -
makeTp
public Tp makeTp(Rational when, @Opt eu.bandm.tools.location.Location<eu.bandm.tools.util.xml.XMLDocumentIdentifier> origLoc) Add a new time point at the given rational time value, if no such already exists. -
addCompleteMeasure
Append at the end of all measure specifications a new measure with the given name (looking like "den/nom") and MTree specification. -
addCompleteMeasure
Append at the end of all measure specifications a new measure with the given name (looking like "den/nom") and MTree specification. Iff the mtreespec !=null, then this measure will be treated as "explicit measure indication". FIXME, this seems rather arbitrary!?!
FIXME there is a fixme inMeasureCollector.addCompleteMeasure(MetrumIndication)
.
-