Class MlWorat

java.lang.Object
eu.bandm.music.top.MlWorat

public class MlWorat extends Object
Generate LaTeX survey graphics on pitch classes for all movements of Johann Sebastian Bach "Weihnachtsoratorium" BWV 248. Needed for MLs monography "Wege zum Weihnachtsoratorium".

Source format is one big score giving the MANUALLY retrieved first appearances of each pitch class for each movement. The time points are encoded by pairs of movement number and measure number. The only current source test is sig/examples/tscore/worat.tscore.

This code collects all pitch classes and writes them to 2*6 latex output files: For each part of the Weihnachtsoratorium one musixtex table in fifths-form (horizontal sequence of columns, one for each movement), and one in scale form (vertical sequence of lines, one for each movement).

Structure of the maps which model time:

                    satzTakt2tp        Vox.sortedByStart       pitch  
    Tuple[Int,Int] ------------>1  TpTop ------------>1  Event ----------->n pitch
                  1<------------                               ----------->1 key
                    tp2satzTakt                                keys
   
  • Field Details

    • myModifiers

      static final Modifiers myModifiers
      Modifiers for the different phases of the parsing process.
    • mylang

      public static final String mylang
      The language used for parsing the tonal keys and the pitch classes.
      See Also:
    • voxname_key

      public static final String voxname_key
      The name of the voice which holds the current tonal key.
      See Also:
    • tp2satzTakt

      final Map<TpTop,Tuple2<Integer,BigDecimal>> tp2satzTakt
      Maps tscore Tp objects to pairs of movement number and measure number.
    • satzTakt2tp

      final SortedMap<Tuple2<Integer,BigDecimal>,TpTop> satzTakt2tp
      Inverse of tp2satzTakt.
    • pitches

      Pitch classes as recognized by the parser parse_pitch.
    • keyVox

      Vox keyVox
      The dedicated voice holding the current tonal key. See voxname_key.
    • keys

      final Map<Event,FunctionalKey> keys
      The data from the dedicated voice holding the current tonal key. See keyVox.
    • taktbuffer

      protected int taktbuffer
      The running movement number, used to complete measure-only timepoints, as in 13/1 /2 /3.
    • parse_time

      protected final Translet.Parser<Tuple2<Integer,BigDecimal>> parse_time
      Format for time points is "movement/measure".
    • parse_pitch

      protected final Translet.Parser<?> parse_pitch
      Format for pitch classes is German language pitch, lilypond octave ad lib.
    • parse_pitches

      protected final Translet.Parser<?> parse_pitches
      Parse more than one pitch class, joined by "+".
    • parse_key

      protected final Translet.Parser<?> parse_key
      Parse German language tonal key indication.
    • pitchClasses

      Maps all events of a new synthetic voice "~~syntheticSum" to all pitch classes appearing at this time point in any of the input voices (except the tonal key voice).
    • firstMovement

      int firstMovement
      The lowest movement number appearing in the sequence of tscore input time points.
    • lastMovement

      int lastMovement
      The highes movement number appearing in the sequence of tscore input time points.
    • sumVox

      Vox sumVox
      A synthetic vox with name "~~syntheticSum" which holds for every time point in the input data exaclty one event with all pitch classes appearing there, in any voice. There may be arbitrary many arbitrarily named voices for pitch classes in the tscore source input. The construction of one single sum voice "~~syntheticSum" is a first step towards rendering.
    • FP_his

      static final FunctionalPitchModOctave FP_his
      Constant holding the functional pitch English "b-sharp", German "his". FIXME Is needed for !?!??!?!??
    • allPitchClasses_sorted

      final List<FunctionalPitchModOctave> allPitchClasses_sorted
      All pitch classes (in their original functional enharmonic spelling) which appear somewhere in the source, sorted in ascending order, starting with a particular pitch class (here: "d").
    • teil2satz

      public static final Map<Integer,Integer> teil2satz
      Manually entered constants which relate the numbers of "satz"/movements to the "Teile"/parts of the Weihnachtsoratorium.
    • last_b_accidental

      protected int last_b_accidental
      The index of the last white key which has been printed with a "flat" accidental. When notes are printed in an ascending chromatic scale in one line, then the position of an e-flat precedes that of an e-natural. So iff the e-flat is printed, the e-natural must be preceded by an explicit natural sign ("Auflösezeichen").
    • satz2alleTh

      protected Map<Integer,Set<FunctionalPitchModOctave>> satz2alleTh
      Map of the movement number to all pitch classes found for this movement. Is filled as a by-product during the linear printing in writeLinear(PrintWriter,int) and used for the "tower of fifth" printing in writeFifths(PrintWriter,int).
    • notehead_spacing

      protected String[] notehead_spacing
      Musix tex codes for spacing note heads, by the categories calculated by category(FunctionalKey, FunctionalPitchModOctave). These note heads are used for the "linear" display: each movement in one line.
    • notehead_nospacing

      protected String[] notehead_nospacing
      Musix tex codes for non-spacing note heads, by the categories calculated by category(FunctionalKey, FunctionalPitchModOctave). These note heads are used for the "tower of fifth" display: each movement in one column.
    • options

      final MlwOptions options
      Options as defined in MlwOptions.xml.
    • debugLevel

      protected int debugLevel
    • mp

      final MessagePrinter<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> mp
      Evident.
    • mf

      final MessageFormatter<eu.bandm.tools.util.xml.XMLDocumentIdentifier> mf
      Evident.
    • mc

      final MessageCounter mc
      Evident.
    • msg

      final MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg
      Evident.
  • Constructor Details

    • MlWorat

      public MlWorat()
  • Method Details

    • chromaticScaleComparator

      public static Comparator<FunctionalPitchModOctave> chromaticScaleComparator(FunctionalPitchModOctave basis)
      Delivers a comparator to sort functional pitch classes in ascending order. First the "stammton" is compared, then the accidental. The lowest pitch class is given as parameter.
    • update

      public void update(Part p0)
      Translate untyped tscore data into semantically sensible "MlWorat" data. This method reads the event lists contained in TimeScape->voices->bySourceOrder and writes to all the local Map and Set output data declared locally.
    • firstTp

      protected Tuple2<Integer,BigDecimal> firstTp(int satz)
      Return the first time point with the given "Sazt"/movement number for which an event is in the input score.
    • findValidKey

      protected FunctionalKey findValidKey(int satz)
      Find the "tonart"/tonal key input value which stands exactly at the start of the movement "satz".
    • category

      protected int category(FunctionalKey key, FunctionalPitchModOctave p)
      Compare a pitch class to a scale. Possible results are:
      0 = "leiter-eigen" = belongs to major scale or to the non-variable steps of a minor scale
      1 = "foreign" = doesn not belong to the major scale or to any variant of a minor scale
      2 = "variable" = is the sixth step of a minor scale or the minor seventh of a minor scale.
    • musixTexName

      protected String musixTexName(FunctionalPitchModOctave fp)
      Return the musixtex encoding of the functional pitch class to print, and memorize the Stammton of this print, if printing includes a flat accidental. If a flat version precedes a natural, then prepend the natural sign.
    • count2tex

      protected String count2tex(int count)
      Prints the counts of found pitches in different optical TeX formats. Exactly ==12 or exactly ==7: put it in a box. Less than 12: put it in brackets "(.."). More than 12: print it bold.
    • writeLinear

      protected void writeLinear(PrintWriter pw, int satz)
      Present all notes of one particular movement/"satz" in one horizontal row, white notes for in-scale, black notes for foreigns, together with the first appearance. Put spaces for notes which are in allPitchClasses_sorted, but not in this Satz. As a by-product: memorize pitch classes for the subsequent call to writeFifths(PrintWriter,int) in satz2alleTh.
    • write_skip

      protected void write_skip(PrintWriter pw)
      Aux routine for switching to the next higher staff when printing the "tower of fifth". (Is printed in two bass and two violin clef staffs.)
    • write_note

      protected void write_note(PrintWriter pw, int satz, FunctionalKey key, String pitchName, String str)
      Writes musixtex note head without spacing, in the graphical form decided by category(FunctionalKey, FunctionalPitchModOctave), iff pitchName is contained in this Satz.
    • writeFifths

      protected void writeFifths(PrintWriter pw, int satz)
      Write one movement/"Satz" as one tower of fifth. This goes accros four staves.
    • writeNumbers

      protected void writeNumbers(PrintWriter pw)
      Write statistics of pitch class numbers to movement numbers for each Part and for the whole Weihnachtsoratorium.
    • convertToTex_S

      public void convertToTex_S(PrintWriter pw, String genComment, int teil)
      Print the sequential representation of one particular part/"Teil I-VI". All contents goes exactly into one of the generated LaTeX source files.
    • convertToTex_Q

      public void convertToTex_Q(PrintWriter pw, String genComment, int teil)
      Print the "tower of fifths" representation of one particular part/"Teil I-VI". All contents goes exactly into one of the generated LaTeX source files.
    • error

      void error(String s)
      Evident.
    • hasErrors

      boolean hasErrors()
      Evident.
    • terminateApplicationOnErrors_printUsage

      void terminateApplicationOnErrors_printUsage()
      Evident.
    • terminateApplicationOnErrors

      void terminateApplicationOnErrors()
      Evident.
    • convert

      protected void convert(MlwOptions options)
      Calls update() to collect the pitch data into different sets and maps, and then call for every Part (="Teil I - VI") the two print methods. This generates two latex source files each. At last construct the latex source file with the table of the staticstical sums.
    • main

      public static void main(String[] args)
      Creates an instance and calls nonStatic_main(String[]).
    • nonStatic_main

      public void nonStatic_main(String[] args)
      Main execution tool, for the options see MlwOptions.xml: name of input tscore file, then file name templates for scale-formed graphics, fith-tower graphics and name of sum file.