public class LilypondGenerator extends Object
Format
s.
Finally it can be written out to a disk file.Modifier and Type | Field and Description |
---|---|
static String |
lilypond_tie_symbol
Evident
|
protected MSplitter.Parameters |
metricSplitParameters
Evident
|
protected MSplitter |
metricSplitter
Evident
|
protected SimpleMessage.Sender<XMLDocumentIdentifier> |
msg
Target of all messages.
|
static String[] |
preamble_definitions
Constant text of some function definitions to be entered in every HKN lilypond
output.
|
protected static Rational |
rat_1_4
Evident
|
protected static Rational |
rat_3_4
Evident
|
protected static QualifiedRational |
sound_1_4
Evident
|
protected static QualifiedRational |
sound_3_4
Evident
|
(package private) Stack<Rational> |
totalDurations
Auxiliary storage for K-Eevent durations PLUS additional pauses.
|
protected List<Format> |
vFormats
Central list of all generated formats; will finally be written out to make
a LilyPond source file.
|
Constructor and Description |
---|
LilypondGenerator(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg)
Only constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addPause(Rational rat,
Vox vpause,
Tp tp)
Add a pause duration to the last emmitted V-Event for later printing the
graphic voices.
|
void |
close_score()
Append the LilyPond source text to close a score.
|
void |
close_staff()
Append the LilyPond source text to close a staff.
|
void |
close_staffGroup()
Append the LilyPond source text to close a staff group.
|
static String |
lilypond_duration_encoding(RationalDuration.DottedBaseDuration dbd)
Evident
|
void |
open_score()
Append the LilyPond source text to open a score.
|
void |
open_staff(String longname,
String shortname)
Append the LilyPond source text to open a staff.
|
void |
open_staffGroup()
Append the LilyPond source text to open a staff group.
|
void |
open(String inputFileName,
String outputFileStem,
String subtitle)
Write the very beginnig of generated lilypond source file.
|
void |
putF(String text,
Object... args)
Add a particular text after calling
String.format(String, Object...)
as a literal format to vFormats . |
void |
putS(String text)
Add a particular text as a literal format to
vFormats . |
void |
putSpace()
Add a special one-blank
Format.space to vFormats . |
void |
putText(String text)
Add a longer text (including line breaks) to
vFormats . |
void |
startGraphEvent(Rational rat)
Append the duration of a generated V-Voice event to the list of complete durations
totalDurations . |
(package private) void |
writeGraphics(DoppelHaken h)
Add the macro call to the lilyPond source which creates the graphik of a DoppelHaken.
|
(package private) void |
writeGraphics(Haken h)
Add the macro call to the lilyPond source which creates the graphik of a Haken.
|
(package private) void |
writeGraphics(RelWert w)
Add the macro call to the lilyPond source which creates the graphik of a directly
given RelWert (without any Haken).
|
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.
|
(package private) void |
writeGraphicsExpanded(RelWert r)
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.
|
(package private) void |
writeGraphicsValueString(String s)
Aux method to add the macro call print the name of a RelWert.
|
void |
writeToFile(String outputfilename)
Write all accumulated LilyPond source text to the given file.
|
protected final SimpleMessage.Sender<XMLDocumentIdentifier> msg
public static final String lilypond_tie_symbol
protected static final Rational rat_3_4
protected static final QualifiedRational sound_3_4
protected static final Rational rat_1_4
protected static final QualifiedRational sound_1_4
protected MSplitter.Parameters metricSplitParameters
protected MSplitter metricSplitter
protected List<Format> vFormats
public static final String[] preamble_definitions
Stack<Rational> totalDurations
#tps
and #expanded
.public LilypondGenerator(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg)
msg
- targt of all messages.public static String lilypond_duration_encoding(RationalDuration.DottedBaseDuration dbd)
public void putF(String text, Object... args)
String.format(String, Object...)
as a literal format to vFormats
.public void putSpace()
Format.space
to vFormats
.public void putText(String text)
vFormats
.
This is done using Format.text(String)
.public void addPause(Rational rat, Vox vpause, Tp tp)
totalDurations
.public void startGraphEvent(Rational rat)
totalDurations
. See there for details.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)
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
the Score_hkn.Expansion
and in sync with tps.tps
- list of all collected and synthesized time points, coming from
the Score_hkn.Expansion
and in sync with expanded.event2relwert
- links possibly a K-event to a RelWert, coming from Score_haken
.event2haken
- links possibly a K-event to a Haken, coming from Score_haken
,event2doppelHaken
- links possibly a K-event to a Doppelhaken,
coming from Score_haken
.void writeGraphics(Haken h)
void writeGraphics(DoppelHaken h)
void writeGraphics(RelWert w)
void writeGraphicsValueString(String s)
void writeGraphicsExpanded(RelWert r)
public void open(String inputFileName, String outputFileStem, String subtitle)
preamble_definitions
.public void open_score()
public void open_staffGroup()
public void open_staff(String longname, String shortname)
public void close_staff()
public void close_staffGroup()
public void close_score()
public void writeToFile(String outputfilename)