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 Summary
Modifier and TypeFieldDescriptionprotected boolean
Whether 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 String
Name of the lilypond include file for language selection.static final String
Default 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 Format
Evident.static final Format
Evident.static final Format
Evident.static final Format
Evident.static final Format
Evident.static final Format
Evident.static final Format
Evident.protected String
Name of the lilypond include file for language selection.protected String
Language to use for pitch class names etc.static final String
Template for the generation comment added into the generated source file format.static final String
Template for the global include command added into the generated source file format.static final String
Evident.Local cache of one metric splitter each (with its internal cache) per metric tree specifications.protected final MessageReceiver<SimpleMessage<?>>
Evidentprotected boolean
Whether "4/4" shall be printed instead of "C", etc.protected final MCover.CheckedParameters_approximate
Parameter collection controlling metric split approximation by binary division.protected final MTree.CheckedParameters
Parameter collection controlling metric split beams.protected final MCover.CheckedParameters_divide
Parameter collection controlling metric split approximation by synthesis of new divisions.protected final MSplitter.CheckedParameters
Parameter collection controlling metric split dotting, sibling merge, syncopes, etc.protected int
Whether the sizes of notes and staves shall be altered.protected Score_cwn
The currently processed score input.All scores which shall be printed by this instance.protected boolean
Whether 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) boolean
Whether shan one voice share the current staff and the current voice is silent.static final String
Timeless parameter for selecting the major include file.static final String
Timeless parameter for selecting the source text language.static final String
Timeless 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 Pattern
protected boolean
Whether more than one voice is in the same staff.protected final boolean
Whether 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 Summary
ConstructorDescriptionCwn_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 Summary
Modifier and TypeMethodDescriptionstatic Format
barnum2format
(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 Format
formatValueOf
(Rational rat) Translate the rational value into a literal format.protected MSplitter
Get a metric splitter (with its internal cache) for the given metric tree specifications, or construct a new one.static void
Stand-alone application, translates input file "arg[0]" to lilypond output file "arg[1]".static String
Generate 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.void
toLilyPond_clefSelect
(List<Format> formats, Event event) Generate a format for changing the clef, iff event carries such a command.void
toLilyPond_clefSelect
(List<Format> formats, Event event, ClefUsage cu) Generate a format for changing the clef.static String
Translate duration information into lilypond format.protected void
Emit a lilypond diatonic key change, if the Event carries such a command.void
toLilyPond_key
(List<Format> formats, Event event) Emit a lilypond diatonic key change, if the Event carries such a command.void
toLilyPond_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 String
Translate pitch information into lilypond format.protected FunctionalPitchModOctave
Deliver 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_includefile
Timeless parameter for selecting the major include file. NOT YET OPERATIVE.- See Also:
-
timeless_language
Timeless parameter for selecting the source text language. NOT YET OPERATIVE.- See Also:
-
msg
Evident -
scores
All 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. -
score
The currently processed score input. -
parameters_beams
Parameter collection controlling metric split beams. Configuration parameter, set once when constructing. -
parameters_approximate
Parameter collection controlling metric split approximation by binary division. Iff == null, the binary division will not be applied. Configuration parameter, set once when constructing. -
parameters_divide
Parameter 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_splitter
Parameter collection controlling metric split dotting, sibling merge, syncopes, etc. Configuration parameter, set once when constructing. -
wholeMeasurePauses
protected 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_includefile
Name of the lilypond include file for language selection. Must be in sync withdefault_language
.- See Also:
-
default_language
Default language to use for pitch class names etc. Must be in sync withdefault_includefile
.- See Also:
-
includefile
Name 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
. -
language
Language 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
. -
metricSplitters
Local cache of one metric splitter each (with its internal cache) per metric tree specifications. -
transpositions
Maps 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)
. -
firstLabels
Maps of the labels which shall be printed before the very first staff for this voice. Must be set byputLabels(Vox,String,String)
. -
shortLabels
Maps of the labels which shall be printed before the subsequent (non-first) staves for this voice. Must be set byputLabels(Vox,String,String)
. -
relativeScoreSize
protected int relativeScoreSizeWhether the sizes of notes and staves shall be altered. (Currently only 0 and -1 are supported.) -
const_paper
An additional lilypond "layout{...}
" text block entered into the generated source format. Can be set byset_const_paper(String)
. -
const_layout
An additional lilypond "paper{...}
" text block entered into the generated source format. Can be set byset_const_paper(String)
. -
numericTimeSignature
protected boolean numericTimeSignatureWhether "4/4" shall be printed instead of "C", etc. Is set byset_meter_names(boolean,boolean,boolean)
. -
compoundMeter
protected 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_comment
Template for the generation comment added into the generated source file format.- See Also:
-
lily_header
Template for the global include command added into the generated source file format.- See Also:
-
lilypond_comment_leadin
Evident.- See Also:
-
format_lilypond_tie
Evident. -
format_lilypond_pause
Evident. -
format_lilypond_suppress
Evident. -
format_lilypond_measure_pause
Evident. -
format_lilypond_cautionary
Evident. -
format_lilypond_forceAccidental
Evident. -
format_lilypond_setMetrum
Evident. -
suppress
boolean suppressWhether shan one voice share the current staff and the current voice is silent. -
voiceNameDecompose
-
-
Constructor Details
-
Cwn_to_lilypond
public 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 warningsscores
- all scores to be put into one lilypond source output fileparameters_beams
- control generation of beamingparameters_approximate
- alternative to parameters_divideparameters_divide
- how to synthesize required and unforseseen sub-divisionsparameters_splitter
- how to join siblings and nephews, etc.wholeMeasurePauses
- whehter to treat them differently (1/1 durations and centraleizd)
-
-
Method Details
-
getMetricSplitter
Get a metric splitter (with its internal cache) for the given metric tree specifications, or construct a new one. -
putTransposition
Set 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. -
putLabels
Set the initial=long and subsequent=short labels to be printed before the staff of a voice. -
set_const_paper
Setconst_paper
. -
set_const_layout
Setconst_layout
. -
set_meter_names
public Cwn_to_lilypond set_meter_names(boolean numericTimeSignature, boolean compoundMeter, boolean shareDenominator) Sets parameters how to render meter names. SeenumericTimeSignature
,compoundMeter
, andshareDenominator
. -
toLilyPond_duration
Translate 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_pitch
Translate pitch information into lilypond format. Lilypond syntax for a single pitch event is :pitchClass Octave Accidental Duration
-
formatValueOf
Translate the rational value into a literal format. -
meterName
Generate 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_metrics
Generate 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
-
transpose
protected 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. -
transpose
Deliver the pitch transposed UP by the interval which is assigned to the voice intranspositions
, if any. -
toLilyPond_key
Emit 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_key
Emit a lilypond diatonic key change, if the Event carries such a command. Transposition according totranspositions
is applied.- Parameters:
formats
- where to append the generated command
-
toLilyPond_clefSelect
Generate a format for changing the clef, iff event carries such a command.- Parameters:
formats
- where to append the generated command
-
toLilyPond_clefSelect
Generate a format for changing the clef.- Parameters:
formats
- where output is appended.
-
barnum2format
Generate a lilypond comment format indicating the bar number / measure number. -
convertOneVoice
public 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 convertincludeMetric
- 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?!?!!)
-
convertVoices
Generate a format representing Lilypond source text, for one tscore source "PART" and the given list of voices. A null in global datashortLabels
means 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
-
convertVoices
Generate 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.
-
staffsByVoiceNames
Constructs 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
firstLabels
andshortLabels
in case thatevoicesShareStaff
==true. -
main
Stand-alone application, translates input file "arg[0]" to lilypond output file "arg[1]".
-