Class Score_hkn_vla_v00

java.lang.Object
eu.bandm.music.haken.Score_hkn
eu.bandm.music.haken.Score_hkn_vla_v00

public class Score_hkn_vla_v00 extends Score_hkn
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 main(String[]) method takes filenames and voice names from the command line parameters.
  • Field Details

    • instrumentname

      public static final String instrumentname
      Is inserted as voice name into the generated LilyPond source.
      See Also:
    • rat_1_32

      protected static final Rational rat_1_32
      Evident.
    • rat_1_16

      protected static final Rational rat_1_16
      Evident.
    • rat_3_16

      protected static final Rational rat_3_16
      Evident.
    • rat_1_2

      protected static final Rational rat_1_2
      Evident.
    • rat_3_4

      protected static final Rational rat_3_4
      Evident.
    • rat_5_4

      protected static final Rational rat_5_4
      Evident.
    • sound_1_32

      protected static final QualifiedRational sound_1_32
      Evident.
    • pause_1_32

      protected static final QualifiedRational pause_1_32
      Evident.
    • sound_3_16

      protected static final QualifiedRational sound_3_16
      Evident.
    • sound_1_2

      protected static final QualifiedRational sound_1_2
      Evident.
    • sound_3_4

      protected static final QualifiedRational sound_3_4
      Evident.
    • sound_5_4

      protected static final QualifiedRational sound_5_4
      Evident.
    • lilypondGenerator

      protected final LilypondGenerator lilypondGenerator
      Auxiliary module for generating a LilyPond source text as output.
    • specialPreamble

      protected String specialPreamble
      Additional lilypond source text which defines the macros for "highest possible pitch".
    • currentIntensity

      protected Integer currentIntensity
      The last written out intensity value, for eliminating repetitions in the generated LilyPond source
    • timeChanged

      protected boolean timeChanged
      Whether the predecessor event of a fermata (sound or pause) has just changed the meter to an incomplete measure <4/4.
    • thBreath

      protected Integer 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_index
      Index how fat the generated lists of indexes have been written out.
    • accu_index_writeout

      protected int accu_index_writeout
      The 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 wasPause
      Whether the last emitted lilypoind V-event was a pause. (Must be a class-level field only for Java-technical reaosns.)
    • seq_pitch

      List<Integer> seq_pitch
      List of indexes into the value array for pitches relwert_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<Integer> seq_duration
      List of index codes for the durations. These are currently hard-coded in writeToFormat(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<Integer> seq_intensity
      List of indexes into the value array for dynamics relwert_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 indexMax
      Highest index into the constant value arrays.
      See Also:
    • indexMed

      final int indexMed
      Medium index into the constant value arrays.
      See Also:
    • pauseGrades

      QualifiedRational[] pauseGrades
      Duration values for the pauses p0..p4
    • maxPause

      public final int maxPause
      Highest 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 names
      ts - the raw parsed tscore input data.
      msg - the drain of all messages.
      parameters - controll parsing, if left out, derfaults to "new Score_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

      protected String relwert_2_intensity(Integer r)
      LilyPond source text framgents for intentities 0..4
    • relwert_2_pitch

      protected String relwert_2_pitch(Integer r)
      LilyPond source text framgents for pitches 0..4
    • writeToFormat

      protected void writeToFormat(Score_hkn.Expansion exp, @Opt @Opt Vox vpause)
      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

      @Opt protected @Opt QualifiedRational getPauseByIndex(List<Tp> tps, @Opt @Opt Vox vpause, int i)
    • change_intensity

      protected String change_intensity(String eventSoFar, @Opt @Opt Integer intens)
      Generate the lilypond text for dynamics. Reads and writes currentIntensity.
      Parameters:
      eventSoFar - source text built so far, to which append the dynamics, if necessary.
      intens - index translated to lilypond source text fragment by relwert_2_intensity(Integer)
      Returns:
      eventSoFar with added suffix.
    • checkForThBreath

      protected String checkForThBreath(String eventSoFar, Integer th, Integer intens)
      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

      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. 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

      protected void put_long_event(int i, List<Tp> tps)
      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. By RelWert.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

      public void update(String inputFileName, String outputFileStem, @Opt @Opt String subtitle, @Opt @Opt Vox v_ps, @Opt @Opt Vox v_dt0, @Opt @Opt Vox v_dt1, @Opt @Opt Vox v_th0, @Opt @Opt Vox v_th1, @Opt @Opt Vox v_ls0, @Opt @Opt Vox v_ls1)
    • writeVoiceGraphics

      protected void writeVoiceGraphics(Score_hkn.Expansion exp, String title, @Opt @Opt Vox v)
    • main

      public static void main(String[] args)
      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")