Package eu.bandm.music.top
Class Cwn_to_lilypond
java.lang.Object
eu.bandm.music.top.Cwn_to_lilypond
Creates a simple lilypond output for one or more 
Score_cwn object/s.
  These are combined in one ".ly" file, in different "score{..}" blocks.- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected booleanWhether for "irregular" meters not only the overall duration shall be printed, but the first generation child nodes, as in "3/8+2/8" instead of simply "5/8".An additional lilypond "paper{...}" text block entered into the generated source format.An additional lilypond "layout{...}" text block entered into the generated source format.static final StringName of the lilypond include file for language selection.static final StringDefault language to use for pitch class names etc.Maps of the labels which shall be printed before the very first staff for this voice.static final FormatEvident.static final FormatEvident.static final FormatEvident.static final FormatEvident.static final FormatEvident.static final FormatEvident.static final FormatEvident.protected StringName of the lilypond include file for language selection.protected StringLanguage to use for pitch class names etc.static final StringTemplate for the generation comment added into the generated source file format.static final StringTemplate for the global include command added into the generated source file format.static final StringEvident.Local cache of one metric splitter each (with its internal cache) per metric tree specifications.protected final MessageReceiver<SimpleMessage<?>> Evidentprotected booleanWhether "4/4" shall be printed instead of "C", etc.protected final MCover.CheckedParameters_approximateParameter collection controlling metric split approximation by binary division.protected final MTree.CheckedParametersParameter collection controlling metric split beams.protected final MCover.CheckedParameters_divideParameter collection controlling metric split approximation by synthesis of new divisions.protected final MSplitter.CheckedParametersParameter collection controlling metric split dotting, sibling merge, syncopes, etc.protected intWhether the sizes of notes and staves shall be altered.protected Score_cwnThe currently processed score input.All scores which shall be printed by this instance.protected booleanWhether compound meters shall be printed with a common denominator.Maps of the labels which shall be printed before the subsequent (non-first) staves for this voice.(package private) booleanWhether shan one voice share the current staff and the current voice is silent.static final StringTimeless parameter for selecting the major include file.static final StringTimeless parameter for selecting the source text language.static final StringTimeless parameter for an automated sharing of staffs by voices.protected Map<Vox, FunctionalInterval> Maps of transpostions to be applied to the score data before writing out.static final Patternprotected booleanWhether more than one voice is in the same staff.protected final booleanWhether a pause covering a whole measure shall be printed in a special way, namely always with the duration "1/1" and in the geometric middle between the bars.
- 
Constructor SummaryConstructorsConstructorDescriptionCwn_to_lilypond(MessageReceiver<SimpleMessage<?>> msg, List<Score_cwn> scores, MTree.CheckedParameters parameters_beams, MCover.CheckedParameters_approximate parameters_approximate, MCover.CheckedParameters_divide parameters_divide, MSplitter.CheckedParameters parameters_splitter, boolean wholeMeasurePauses) Only constructor.
- 
Method SummaryModifier and TypeMethodDescriptionstatic Formatbarnum2format(BigDecimal barnum) Generate a lilypond comment format indicating the bar number / measure number.convertOneVoice(Vox voice, boolean includeMetric, @Opt List<Format> formatsLyrics) Generate a format for one particular voice (possibly including metric info) which can be read by LilyPond.convertVoices(String sourcename) Generate the format of a lilypond source file, for all Score_cwn instances inscores.convertVoices(String sourcename, Part part, List<Vox> voices) Generate a format representing Lilypond source text, for one tscore source "PART" and the given list of voices.static FormatformatValueOf(Rational rat) Translate the rational value into a literal format.protected MSplitterGet a metric splitter (with its internal cache) for the given metric tree specifications, or construct a new one.static voidStand-alone application, translates input file "arg[0]" to lilypond output file "arg[1]".static StringGenerate a meter name based only on duration, or on an "addition" of the first generation child nodes.Set the initial=long and subsequent=short labels to be printed before the staff of a voice.putTransposition(Vox voice, FunctionalInterval ival) Set a transposition to be applied to the voice before generating the lilypond source.Setconst_layout.Setconst_paper.set_meter_names(boolean numericTimeSignature, boolean compoundMeter, boolean shareDenominator) Sets parameters how to render meter names.staffsByVoiceNames(List<Vox> voices, int maxnum) Constructs a list of staff names for a list of voices.voidtoLilyPond_clefSelect(List<Format> formats, Event event) Generate a format for changing the clef, iff event carries such a command.voidtoLilyPond_clefSelect(List<Format> formats, Event event, ClefUsage cu) Generate a format for changing the clef.static StringTranslate duration information into lilypond format.protected voidEmit a lilypond diatonic key change, if the Event carries such a command.voidtoLilyPond_key(List<Format> formats, Event event) Emit a lilypond diatonic key change, if the Event carries such a command.voidtoLilyPond_metrics(List<Format> formats, BigDecimal barnum) Generate a format for the start text for the measure with the given barnum, indicating its meter, (and its duration, if it is partial).static StringTranslate pitch information into lilypond format.protected FunctionalPitchModOctaveDeliver the pitch transposed UP by the interval which is assigned to the voice intranspositions, if any.protected PitchAndOctave<OctaveRegister, FunctionalPitchModOctave> Deliver the pitch transposed UP by the interval which is assigned to the voice intranspositions, if any.
- 
Field Details- 
timeless_includefileTimeless parameter for selecting the major include file. NOT YET OPERATIVE.- See Also:
 
- 
timeless_languageTimeless parameter for selecting the source text language. NOT YET OPERATIVE.- See Also:
 
- 
msgEvident
- 
scoresAll scores which shall be printed by this instance. All data goes together into one single disk-file, but with a new lilypond "score{}" block for each.
- 
scoreThe currently processed score input.
- 
parameters_beamsParameter collection controlling metric split beams. Configuration parameter, set once when constructing.
- 
parameters_approximateParameter collection controlling metric split approximation by binary division. Iff == null, the binary division will not be applied. Configuration parameter, set once when constructing.
- 
parameters_divideParameter collection controlling metric split approximation by synthesis of new divisions. Iff == null, this method will not be applied. Configuration parameter, set once when constructing.
- 
parameters_splitterParameter collection controlling metric split dotting, sibling merge, syncopes, etc. Configuration parameter, set once when constructing.
- 
wholeMeasurePausesprotected final boolean wholeMeasurePausesWhether a pause covering a whole measure shall be printed in a special way, namely always with the duration "1/1" and in the geometric middle between the bars. Configuration parameter, set once when constructing.
- 
default_includefileName of the lilypond include file for language selection. Must be in sync withdefault_language.- See Also:
 
- 
default_languageDefault language to use for pitch class names etc. Must be in sync withdefault_includefile.- See Also:
 
- 
includefileName of the lilypond include file for language selection. Default can be overrriden in the timeless prefix of the tscore bytimeless_includefile. Must be in sync withlanguage.
- 
languageLanguage to use for pitch class names etc. Default can be overrriden in the timeless prefix of the tscore bytimeless_language. Must be in sync withincludefile.
- 
metricSplittersLocal cache of one metric splitter each (with its internal cache) per metric tree specifications.
- 
transpositionsMaps of transpostions to be applied to the score data before writing out. The Score_cwn data will be transposed by this interval upward before translating it into lilypond source text. Can be set byputTransposition(Vox,FunctionalInterval).
- 
firstLabelsMaps of the labels which shall be printed before the very first staff for this voice. Must be set byputLabels(Vox,String,String).
- 
shortLabelsMaps of the labels which shall be printed before the subsequent (non-first) staves for this voice. Must be set byputLabels(Vox,String,String).
- 
relativeScoreSizeprotected int relativeScoreSizeWhether the sizes of notes and staves shall be altered. (Currently only 0 and -1 are supported.)
- 
const_paperAn additional lilypond "layout{...}" text block entered into the generated source format. Can be set byset_const_paper(String).
- 
const_layoutAn additional lilypond "paper{...}" text block entered into the generated source format. Can be set byset_const_paper(String).
- 
numericTimeSignatureprotected boolean numericTimeSignatureWhether "4/4" shall be printed instead of "C", etc. Is set byset_meter_names(boolean,boolean,boolean).
- 
compoundMeterprotected boolean compoundMeterWhether for "irregular" meters not only the overall duration shall be printed, but the first generation child nodes, as in "3/8+2/8" instead of simply "5/8". Is set byset_meter_names(boolean,boolean,boolean).
- 
lily_generation_commentTemplate for the generation comment added into the generated source file format.- See Also:
 
- 
lily_headerTemplate for the global include command added into the generated source file format.- See Also:
 
- 
lilypond_comment_leadinEvident.- See Also:
 
- 
format_lilypond_tieEvident.
- 
format_lilypond_pauseEvident.
- 
format_lilypond_suppressEvident.
- 
format_lilypond_measure_pauseEvident.
- 
format_lilypond_cautionaryEvident.
- 
format_lilypond_forceAccidentalEvident.
- 
format_lilypond_setMetrumEvident.
- 
suppressboolean suppressWhether shan one voice share the current staff and the current voice is silent.
- 
voiceNameDecompose
 
- 
- 
Constructor Details- 
Cwn_to_lilypondpublic Cwn_to_lilypond(MessageReceiver<SimpleMessage<?>> msg, List<Score_cwn> scores, @Opt MTree.CheckedParameters parameters_beams, @Opt MCover.CheckedParameters_approximate parameters_approximate, @Opt MCover.CheckedParameters_divide parameters_divide, @Opt MSplitter.CheckedParameters parameters_splitter, boolean wholeMeasurePauses) Only constructor. Gets the final values of many configuration parameters and all scores which shall be translated. Usage: construct an instance and then callconvertVoices(String)or sim.- Parameters:
- msg- receiver for all errors and warnings
- scores- all scores to be put into one lilypond source output file
- parameters_beams- control generation of beaming
- parameters_approximate- alternative to parameters_divide
- parameters_divide- how to synthesize required and unforseseen sub-divisions
- parameters_splitter- how to join siblings and nephews, etc.
- wholeMeasurePauses- whehter to treat them differently (1/1 durations and centraleizd)
 
 
- 
- 
Method Details- 
getMetricSplitterGet a metric splitter (with its internal cache) for the given metric tree specifications, or construct a new one.
- 
putTranspositionSet a transposition to be applied to the voice before generating the lilypond source. The Score_cwn data will be transposed by this interval upward before translating it into lilypond source text.
- 
putLabelsSet the initial=long and subsequent=short labels to be printed before the staff of a voice.
- 
set_const_paperSetconst_paper.
- 
set_const_layoutSetconst_layout.
- 
set_meter_namespublic Cwn_to_lilypond set_meter_names(boolean numericTimeSignature, boolean compoundMeter, boolean shareDenominator) Sets parameters how to render meter names. SeenumericTimeSignature,compoundMeter, andshareDenominator.
- 
toLilyPond_durationTranslate duration information into lilypond format. (Apply this only after all containing brackets have been generated and their factor thus removed from the duration argument.) Works for all Rationals which have a power-of-two denominator and are e-writeable. Possibly DISLOC to "RationalDuration.lilypondString()" ?? FIXME
- 
toLilyPond_pitchTranslate pitch information into lilypond format. Lilypond syntax for a single pitch event is :pitchClass Octave Accidental Duration
- 
formatValueOfTranslate the rational value into a literal format.
- 
meterNameGenerate a meter name based only on duration, or on an "addition" of the first generation child nodes.FIXME CHECK whether lilypond copes with "6/6" etc. !?!?! FIXME GEHEN NICHT ALLE siehe sig/examples/msplit/nichtUebersetzbar.ly !!! - Parameters:
- compress- whether to put on ONE fractional line: "1+2+3/8" instead of "1/8+2/8+3/8".
 
- 
toLilyPond_metricsGenerate a format for the start text for the measure with the given barnum, indicating its meter, (and its duration, if it is partial). Do this only if these values change w.r.t. its predecessor. Currently: encode metrics only as a measure DURATION, no influence on beams and grouping, etc. MISSING FIXME- Parameters:
- formats- where to append the generated command
 
- 
transposeprotected PitchAndOctave<OctaveRegister,FunctionalPitchModOctave> transpose(@Opt @Opt Vox v, PitchAndOctave<OctaveRegister, FunctionalPitchModOctave> p) Deliver the pitch transposed UP by the interval which is assigned to the voice intranspositions, if any.
- 
transposeDeliver the pitch transposed UP by the interval which is assigned to the voice intranspositions, if any.
- 
toLilyPond_keyEmit a lilypond diatonic key change, if the Event carries such a command. No voice is defined so not transposition is applied.- Parameters:
- formats- where to append the generated command
 
- 
toLilyPond_keyEmit a lilypond diatonic key change, if the Event carries such a command. Transposition according totranspositionsis applied.- Parameters:
- formats- where to append the generated command
 
- 
toLilyPond_clefSelectGenerate a format for changing the clef, iff event carries such a command.- Parameters:
- formats- where to append the generated command
 
- 
toLilyPond_clefSelectGenerate a format for changing the clef.- Parameters:
- formats- where output is appended.
 
- 
barnum2formatGenerate a lilypond comment format indicating the bar number / measure number.
- 
convertOneVoicepublic Format convertOneVoice(Vox voice, boolean includeMetric, @Opt @Opt List<Format> formatsLyrics) Generate a format for one particular voice (possibly including metric info) which can be read by LilyPond. Assume all input data (semantic maps in Score_cwn) are valid. Esp. it requires ...- that the metric voice has a metric indication at the very first timepoint,
- + that all voices start at the first TopTp
- that the very first event in every voice carries a clef selection
 - Parameters:
- voice- to convert
- includeMetric- In lilypond, changes of metrum and duration of all measures are global and valid for all voices simultaneously. They thus need to appear only in one voice. This parameter says whether metrum information shall be included in the currently generated lilypond voice.
- formatsLyrics- output parameter where to put the formats realizing the sung text. If ==null, no lyric formats are generated. (FIXME: currently ONE STANZA only?!?!!)
 
- 
convertVoicesGenerate a format representing Lilypond source text, for one tscore source "PART" and the given list of voices. A null in global datashortLabelsmeans that voice shares the staff with its predecessor.- Parameters:
- sourcename- only for doc comments about the generation.
- part- the tscore raw parsing level Part object (indicating all voices, timeless parameters, etc.)
- voices- to convert
 
- 
convertVoicesGenerate the format of a lilypond source file, for all Score_cwn instances inscores. Each such will be put into one lilypond "Score{..}" block.- Parameters:
- sourcename- only for doc comments about the generation.
 
- 
staffsByVoiceNamesConstructs a list of staff names for a list of voices. Each "null" in the list indicates the voice belonging to its predecessors. For instance, if maxnum=2, then the sequence of voice names
 "Hrn1", "Hrn3", "Hrn2", "Hrn4", "Hrn5", "Trp" will result into
 "Hrn1,2", null, "Hrn2,4", null, "Hrn5" "Trp".
 With maxnum=3 we get
 "Hrn1,3,2", null, null, "Hrn4,5", null, "Trp".
 This data is intended to be fed into firstLabelsandshortLabelsin case thatevoicesShareStaff==true.
- 
mainStand-alone application, translates input file "arg[0]" to lilypond output file "arg[1]".
 
-