Package eu.bandm.music.haken
Class Score_hkn_vla_v00
java.lang.Object
eu.bandm.music.haken.Score_hkn
eu.bandm.music.haken.Score_hkn_vla_v00
A first version of a haken score for realization by a viola solo.
This is the production version for one single output instrument "Vla" with
one or two K-voices per parameter
= "th" (pitch), "dur" (duration) and "ls" (intensity).
Usage: create an Instance (with an already raw-parsed TimeScape) and call "update(... score.findVoice(..)..).
The
Usage: create an Instance (with an already raw-parsed TimeScape) and call "update(... score.findVoice(..)..).
The
main(String[])
method takes filenames and voice names from the command
line parameters.-
Nested Class Summary
Nested classes/interfaces inherited from class eu.bandm.music.haken.Score_hkn
Score_hkn.Expansion, Score_hkn.Parameters
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
Index how fat the generated lists of indexes have been written out.protected int
The index of K-Events when the MetricConsumer steps through the list of pauses and durations.protected Integer
The last written out intensity value, for eliminating repetitions in the generated LilyPond source(package private) final int
Highest index into the constant value arrays.(package private) final int
Medium index into the constant value arrays.static final String
Is inserted as voice name into the generated LilyPond source.protected final LilypondGenerator
Auxiliary module for generating a LilyPond source text as output.final int
Highest index into the constant pause durations arrays.protected static final QualifiedRational
Evident.(package private) QualifiedRational[]
Duration values for the pauses p0..p4protected static final Rational
Evident.protected static final Rational
Evident.protected static final Rational
Evident.protected static final Rational
Evident.protected static final Rational
Evident.protected static final Rational
Evident.List of index codes for the durations.List of indexes into the value array for dynamicsrelwert_2_intensity(java.lang.Integer)
.List of indexes into the value array for pitchesrelwert_2_pitch(java.lang.Integer)
.protected static final QualifiedRational
Evident.protected static final QualifiedRational
Evident.protected static final QualifiedRational
Evident.protected static final QualifiedRational
Evident.protected static final QualifiedRational
Evident.protected String
Additional lilypond source text which defines the macros for "highest possible pitch".protected Integer
The last sounding pitch, needed to check if a "breath" symbol has to be entered in the generated LilyPond source text.protected boolean
Whether the predecessor event of a fermata (sound or pause) has just changed the meter to an incomplete measure <4/4.(package private) boolean
Whether the last emitted lilypoind V-event was a pause.Fields inherited from class eu.bandm.music.haken.Score_hkn
allMedium, barnum2tp, event2doppelHaken, event2forceOverlap_end, event2forceOverlap_start, event2haken, event2noOverlap_end, event2noOverlap_start, event2pause, event2relwert, eventCanOverlapAtStart, modifiers, msg, msgr, name, noPauseSelected, noVoiceSelected, parameters, parser, rat2tp, tp2barnum, tp2rat, tsPart
-
Constructor Summary
ConstructorDescriptionScore_hkn_vla_v00
(String name, Part ts, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, @Opt Score_hkn.Parameters parameters) Only constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Convert the RelWert of the K-Voices into a list of array index values.protected String
change_intensity
(String eventSoFar, @Opt Integer intens) Generate the lilypond text for dynamics.protected String
checkForThBreath
(String eventSoFar, Integer th, Integer intens) Extends the event if a breath-symbol is required before (i.e.protected void
flush_accu
(int max, List<Tp> tps, Vox vpause, boolean checkLastForPause) Since a new 4/4 measure is started with every fermata-event (duration="O"="O+O"=5), all events up to such a "maxDuration" event are accumulated and then rendered by this method.static Map<String,
Score_hkn_vla_v00> fromTimeScape
(TimeScape ts, String topName, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, @Opt Score_hkn.Parameters parameters) FIXME DOCprotected @Opt QualifiedRational
getPauseByIndex
(List<Tp> tps, @Opt Vox vpause, int i) static void
Main method, translates input file in HKN-vox format to lilypond output file.protected void
put_long_event
(int i, List<Tp> tps) Generate a fermata-measure for event number "i".protected void
Generate a fermata-measure for longest possible pause.protected String
LilyPond source text framgents for intentities 0..4protected String
LilyPond source text framgents for pitches 0..4void
update
(String inputFileName, String outputFileStem, @Opt String subtitle, @Opt Vox v_ps, @Opt Vox v_dt0, @Opt Vox v_dt1, @Opt Vox v_th0, @Opt Vox v_th1, @Opt Vox v_ls0, @Opt Vox v_ls1) protected void
writeToFormat
(Score_hkn.Expansion exp, @Opt Vox vpause) Show one staff with output notes for the viola and changing meters caused by whole-measure fermatas.protected void
writeVoiceGraphics
(Score_hkn.Expansion exp, String title, @Opt Vox v) Methods inherited from class eu.bandm.music.haken.Score_hkn
findVoice, getPauseIndexByIndex, getRelWertFolge, getRelWertFolge_first, update
-
Field Details
-
instrumentname
Is inserted as voice name into the generated LilyPond source.- See Also:
-
rat_1_32
Evident. -
rat_1_16
Evident. -
rat_3_16
Evident. -
rat_1_2
Evident. -
rat_3_4
Evident. -
rat_5_4
Evident. -
sound_1_32
Evident. -
pause_1_32
Evident. -
sound_3_16
Evident. -
sound_1_2
Evident. -
sound_3_4
Evident. -
sound_5_4
Evident. -
lilypondGenerator
Auxiliary module for generating a LilyPond source text as output. -
specialPreamble
Additional lilypond source text which defines the macros for "highest possible pitch". -
currentIntensity
The last written out intensity value, for eliminating repetitions in the generated LilyPond source -
timeChanged
protected boolean timeChangedWhether the predecessor event of a fermata (sound or pause) has just changed the meter to an incomplete measure <4/4. -
thBreath
The last sounding pitch, needed to check if a "breath" symbol has to be entered in the generated LilyPond source text. -
accu_index
protected int accu_indexIndex how fat the generated lists of indexes have been written out. -
accu_index_writeout
protected int accu_index_writeoutThe index of K-Events when the MetricConsumer steps through the list of pauses and durations. (Must be a class-level field only for Java-technical reaosns.) -
wasPause
boolean wasPauseWhether the last emitted lilypoind V-event was a pause. (Must be a class-level field only for Java-technical reaosns.) -
seq_pitch
List of indexes into the value array for pitchesrelwert_2_pitch(java.lang.Integer)
. Constant 1 if no K-voice is selected, 0..2 for one K-voice and 0..4 for two. -
seq_duration
List of index codes for the durations. These are currently hard-coded inwriteToFormat(eu.bandm.music.haken.Score_hkn.Expansion, eu.bandm.tscore.model.Vox)
as 0=1/32, 1=3/15, 2=1/2, 3=5/4, and 4 as an external pause. Constant 1 if no K-voice is selected, 0..2 for one K-voice and 0..4 for two. -
seq_intensity
List of indexes into the value array for dynamicsrelwert_2_intensity(java.lang.Integer)
. Constant 1 if no K-voice is selected, 0..2 for one K-voice and 0..4 for two. -
indexMax
final int indexMaxHighest index into the constant value arrays.- See Also:
-
indexMed
final int indexMedMedium index into the constant value arrays.- See Also:
-
pauseGrades
QualifiedRational[] pauseGradesDuration values for the pauses p0..p4 -
maxPause
public final int maxPauseHighest index into the constant pause durations arrays.
-
-
Constructor Details
-
Score_hkn_vla_v00
public Score_hkn_vla_v00(String name, Part ts, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, @Opt @Opt Score_hkn.Parameters parameters) Only constructor.- Parameters:
name
- of the score, also used to derive output file namests
- the raw parsed tscore input data.msg
- the drain of all messages.parameters
- controll parsing, if left out, derfaults to "newScore_hkn.Parameters
".
-
-
Method Details
-
fromTimeScape
public static Map<String,Score_hkn_vla_v00> fromTimeScape(TimeScape ts, String topName, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, @Opt @Opt Score_hkn.Parameters parameters) FIXME DOC -
relwert_2_intensity
LilyPond source text framgents for intentities 0..4 -
relwert_2_pitch
LilyPond source text framgents for pitches 0..4 -
writeToFormat
Show one staff with output notes for the viola and changing meters caused by whole-measure fermatas.
Add all duration values. Whenever a "duration=maximal" is reached, flush_accu() is called (which may generate a partial measure). Then a fermate measure is created. In any case the durations < 1/1 are split according to 4/4 meter. -
getPauseByIndex
-
change_intensity
Generate the lilypond text for dynamics. Reads and writescurrentIntensity
.- Parameters:
eventSoFar
- source text built so far, to which append the dynamics, if necessary.intens
- index translated to lilypond source text fragment byrelwert_2_intensity(Integer)
- Returns:
- eventSoFar with added suffix.
-
checkForThBreath
Extends the event if a breath-symbol is required before (i.e. dynamics and pitch do repeat), and stores the event-pitch as new last-pitch. -
flush_accu
Since a new 4/4 measure is started with every fermata-event (duration="O"="O+O"=5), all events up to such a "maxDuration" event are accumulated and then rendered by this method. The accumulator is realized by global accu_index=start and parameter "max"=exclusive end.accu_index max v v tp4 5 6 7 8 9 10 ... generate: p=== p-- p== P
Generate the events and the pauses. Pauses in the K-Voice are meant BEFORE the event. But for generating the Graphic output afterwards, their duration is added to the predecessor event in "allDurations".
The possible pause before the "maxDuration" must be realized here, AFTER the "max-1" event- Parameters:
checkLastForPause
- whether FIXME
-
put_long_event
Generate a fermata-measure for event number "i". -
put_long_pause
protected void put_long_pause()Generate a fermata-measure for longest possible pause. -
addValues
protected void addValues(@Opt @Opt List<RelWert> exp1, @Opt @Opt List<RelWert> exp2, int len, String p, List<Integer> out) Convert the RelWert of the K-Voices into a list of array index values. ByRelWert.getArrayIndex()
.exp1!=null eep2!= null => add them exp1!=null eep2== null => put only voice 1 exp1==null eep2!= null => put only voice 2 and emit warning exp1==null eep2== null => put sequence of "M" values
The same voice(-name) can be given twice, what means a doubling of the voice's V-effects. -
update
-
writeVoiceGraphics
-
main
Main method, translates input file in HKN-vox format to lilypond output file.- Parameters:
args
-
[0] input file name
[1] basic score name (also determines the output files)
[2] used for the entry catgory "subtitle" in the header of the generated lilypond source. "-" stands for "none", (The category "title" will be filled by the name of the outputfile, "subsubtitle" will be a source file indication.)
[3] pause voice ("-" stands for "none")
[4]/[5] give the two voices for "Dauer" ("duration")
[6]/[7] give the two voices for "Tonhoehe" ("pitch")
[8]/[9] give the two voices for "Lautstärke" ("volume"/"intensity")
-