Package eu.bandm.music.haken
Class LilypondGenerator
java.lang.Object
eu.bandm.music.haken.LilypondGenerator
Tool for generating one LilyPond source text file from a HKN K-score.
  The source text is generated by subsequent calls to different service providing methods.
  It is stored internally as a sequence of 
Formats.
  Finally it can be written out to a disk file.- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringEvidentprotected MSplitter.CheckedParametersEvidentprotected MSplitterEvidentprotected final SimpleMessage.Sender<XMLDocumentIdentifier> Target of all messages.protected MTree.CheckedParametersprotected MetricParameters.MTreeParametersstatic final String[]Constant text of some function definitions to be entered in every HKN lilypond output.protected static final RationalEvidentprotected static final RationalEvidentprotected static final QualifiedRationalEvidentprotected static final QualifiedRationalEvidentAuxiliary storage for K-Eevent durations PLUS additional pauses.Central list of all generated formats; will finally be written out to make a LilyPond source file. - 
Constructor Summary
ConstructorsConstructorDescriptionOnly constructor. - 
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a pause duration to the last emmitted V-Event for later printing the graphic voices.voidAppend the LilyPond source text to close a score.voidAppend the LilyPond source text to close a staff.voidAppend the LilyPond source text to close a staff group.static StringEvidentvoidWrite the very beginnig of generated lilypond source file.voidAppend the LilyPond source text to open a score.voidopen_staff(String longname, String shortname) Append the LilyPond source text to open a staff.voidAppend the LilyPond source text to open a staff group.voidAdd a particular text after callingString.format(String, Object...)as a literal format tovFormats.voidAdd a particular text as a literal format tovFormats.voidputSpace()Add a special one-blankFormat.spacetovFormats.voidAdd a longer text (including line breaks) tovFormats.voidstartGraphEvent(Rational rat) Append the duration of a generated V-Voice event to the list of complete durationstotalDurations.(package private) voidAdd the macro call to the lilyPond source which creates the graphik of a DoppelHaken.(package private) voidAdd the macro call to the lilyPond source which creates the graphik of a Haken.(package private) voidAdd the macro call to the lilyPond source which creates the graphik of a directly given RelWert (without any Haken).protected voidwriteGraphics(String role, Vox inputVoice, List<RelWert> expanded, List<Tp> tps, Map<Event, RelWert> event2relwert, Map<Event, Haken> event2haken, Map<Event, DoppelHaken> event2doppelHaken) Append a dedicated lilypond voice to the score, which presents a graphic symbol of the underlying K-event.(package private) voidMethod which print the graphic represention of the currently valid RelWert for all V-events which are not the first in the K-event expansion.(package private) voidAux method to add the macro call print the name of a RelWert.voidwriteToFile(String outputfilename) Write all accumulated LilyPond source text to the given file. 
- 
Field Details
- 
msg
Target of all messages. - 
lilypond_tie_symbol
Evident- See Also:
 
 - 
rat_3_4
Evident - 
sound_3_4
Evident - 
rat_1_4
Evident - 
sound_1_4
Evident - 
metricSplitParameters
Evident - 
mtreePreParameters
 - 
mtreeParameters
 - 
metricSplitter
Evident - 
vFormats
Central list of all generated formats; will finally be written out to make a LilyPond source file. - 
preamble_definitions
Constant text of some function definitions to be entered in every HKN lilypond output. Includes routines to genearte Graphics for the commentary lines which indicate the original K-events. - 
totalDurations
Auxiliary storage for K-Eevent durations PLUS additional pauses. For printing the additional "graphic" voices, which is done after the generation of the corrensponding V-Voice, and which shows the original K-Events, the durations of the corresponding events PLUS their subsequent pauses are needed. These are kept here and added (by the specific interpretation code) in sync with thewriteGraphics(java.lang.String, eu.bandm.tscore.model.Vox, java.util.List<eu.bandm.music.haken.RelWert>, java.util.List<eu.bandm.tscore.model.Tp>, java.util.Map<eu.bandm.tscore.model.Event, eu.bandm.music.haken.RelWert>, java.util.Map<eu.bandm.tscore.model.Event, eu.bandm.music.haken.Haken>, java.util.Map<eu.bandm.tscore.model.Event, eu.bandm.music.haken.DoppelHaken>)parameters "tps" and "expanded". 
 - 
 - 
Constructor Details
- 
LilypondGenerator
Only constructor.- Parameters:
 msg- targt of all messages.
 
 - 
 - 
Method Details
- 
lilypond_duration_encoding
Evident - 
putS
Add a particular text as a literal format tovFormats. - 
putF
Add a particular text after callingString.format(String, Object...)as a literal format tovFormats. - 
putSpace
public void putSpace()Add a special one-blankFormat.spacetovFormats. - 
putText
Add a longer text (including line breaks) tovFormats. This is done usingFormats.text(String). - 
addPause
Add a pause duration to the last emmitted V-Event for later printing the graphic voices. SeetotalDurations. - 
startGraphEvent
Append the duration of a generated V-Voice event to the list of complete durationstotalDurations. See there for details. - 
writeGraphics
protected void writeGraphics(String role, Vox inputVoice, List<RelWert> expanded, List<Tp> tps, Map<Event, RelWert> event2relwert, Map<Event, Haken> event2haken, Map<Event, DoppelHaken> event2doppelHaken) Append a dedicated lilypond voice to the score, which presents a graphic symbol of the underlying K-event. This voice is synchronuous to the corresponding V-events, which have just been written into a lilypond E-voice.- Parameters:
 role- Only for generating lilypond source text comment: For what parameter this voice has been used.inputVoice- for getting the original K-events when stepping through the time points (and for inserting the voice name into the lilypond source text comment)expanded- list of all expanded values, coming from theScore_hkn.Expansionand in sync with tps.tps- list of all collected and synthesized time points, coming from theScore_hkn.Expansionand in sync with expanded.event2relwert- links possibly a K-event to a RelWert, coming fromScore_hkn.event2haken- links possibly a K-event to a Haken, coming fromScore_hkn,event2doppelHaken- links possibly a K-event to a Doppelhaken, coming fromScore_hkn.
 - 
writeGraphics
Add the macro call to the lilyPond source which creates the graphik of a Haken. - 
writeGraphics
Add the macro call to the lilyPond source which creates the graphik of a DoppelHaken. This is slightly different when internally overlapping and not-overlapping, e.g. "OMO" vs. "OMMO". - 
writeGraphics
Add the macro call to the lilyPond source which creates the graphik of a directly given RelWert (without any Haken). - 
writeGraphicsValueString
Aux method to add the macro call print the name of a RelWert. This canbe directy given or part of a Haken expansion. - 
writeGraphicsExpanded
Method which print the graphic represention of the currently valid RelWert for all V-events which are not the first in the K-event expansion. - 
open
Write the very beginnig of generated lilypond source file. This includes generation documentation comment line, paper and header blocks, additional free components as previously entered intopreamble_definitions. - 
open_score
public void open_score()Append the LilyPond source text to open a score. - 
open_staffGroup
public void open_staffGroup()Append the LilyPond source text to open a staff group. - 
open_staff
Append the LilyPond source text to open a staff. - 
close_staff
public void close_staff()Append the LilyPond source text to close a staff. - 
close_staffGroup
public void close_staffGroup()Append the LilyPond source text to close a staff group. - 
close_score
public void close_score()Append the LilyPond source text to close a score. - 
writeToFile
Write all accumulated LilyPond source text to the given file. 
 -