Package eu.bandm.music.top
Class MlWorat
java.lang.Object
eu.bandm.music.top.MlWorat
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 Summary
Modifier and TypeFieldDescription(package private) final List<FunctionalPitchModOctave>
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").protected int
(package private) int
The lowest movement number appearing in the sequence of tscore input time points.(package private) static final FunctionalPitchModOctave
Constant holding the functional pitch English "b-sharp", German "his".(package private) final Map<Event,
FunctionalKey> The data from the dedicated voice holding the current tonal key.(package private) Vox
The dedicated voice holding the current tonal key.protected int
The index of the last white key which has been printed with a "flat" accidental.(package private) int
The highes movement number appearing in the sequence of tscore input time points.(package private) final MessageCounter
Evident.(package private) final MessageFormatter<eu.bandm.tools.util.xml.XMLDocumentIdentifier>
Evident.(package private) final MessagePrinter<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>>
Evident.(package private) final MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>>
Evident.static final String
The language used for parsing the tonal keys and the pitch classes.(package private) static final Modifiers
Modifiers for the different phases of the parsing process.protected String[]
Musix tex codes for non-spacing note heads, by the categories calculated bycategory(FunctionalKey, FunctionalPitchModOctave)
.protected String[]
Musix tex codes for spacing note heads, by the categories calculated bycategory(FunctionalKey, FunctionalPitchModOctave)
.(package private) final MlwOptions
Options as defined inMlwOptions.xml
.protected final Translet.Parser<?>
Parse German language tonal key indication.protected final Translet.Parser<?>
Format for pitch classes is German language pitch, lilypond octave ad lib.protected final Translet.Parser<?>
Parse more than one pitch class, joined by "+".protected final Translet.Parser<Tuple2<Integer,
BigDecimal>> Format for time points is "movement/measure".(package private) final Multimap<Event,
FunctionalPitchModOctave> 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).(package private) final Multimap<Event,
Tuple2<FunctionalPitchModOctave, OctaveRegister>> Pitch classes as recognized by the parserparse_pitch
.protected Map<Integer,
Set<FunctionalPitchModOctave>> Map of the movement number to all pitch classes found for this movement.(package private) final SortedMap<Tuple2<Integer,
BigDecimal>, TpTop> Inverse oftp2satzTakt
.(package private) Vox
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.protected int
The running movement number, used to complete measure-only timepoints, as in13/1 /2 /3
.Manually entered constants which relate the numbers of "satz"/movements to the "Teile"/parts of the Weihnachtsoratorium.(package private) final Map<TpTop,
Tuple2<Integer, BigDecimal>> Maps tscore Tp objects to pairs of movement number and measure number.static final String
The name of the voice which holds the current tonal key. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
Compare a pitch class to a scale.static Comparator<FunctionalPitchModOctave>
Delivers a comparator to sort functional pitch classes in ascending order.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.void
convertToTex_Q
(PrintWriter pw, String genComment, int teil) Print the "tower of fifths" representation of one particular part/"Teil I-VI".void
convertToTex_S
(PrintWriter pw, String genComment, int teil) Print the sequential representation of one particular part/"Teil I-VI".protected String
count2tex
(int count) Prints the counts of found pitches in different optical TeX formats.(package private) void
Evident.protected FunctionalKey
findValidKey
(int satz) Find the "tonart"/tonal key input value which stands exactly at the start of the movement "satz".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.(package private) boolean
Evident.static void
Creates an instance and callsnonStatic_main(String[])
.protected String
Return the musixtex encoding of the functional pitch class to print, and memorize the Stammton of this print, if printing includes a flat accidental.void
nonStatic_main
(String[] args) Main execution tool, for the options seeMlwOptions.xml
: name of input tscore file, then file name templates for scale-formed graphics, fith-tower graphics and name of sum file.(package private) void
Evident.(package private) void
Evident.void
Translate untyped tscore data into semantically sensible "MlWorat" data.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 bycategory(FunctionalKey, FunctionalPitchModOctave)
, iff pitchName is contained in this Satz.protected void
Aux routine for switching to the next higher staff when printing the "tower of fifth".protected void
writeFifths
(PrintWriter pw, int satz) Write one movement/"Satz" as one tower of fifth.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.protected void
Write statistics of pitch class numbers to movement numbers for each Part and for the whole Weihnachtsoratorium.
-
Field Details
-
myModifiers
Modifiers for the different phases of the parsing process. -
mylang
The language used for parsing the tonal keys and the pitch classes.- See Also:
-
voxname_key
The name of the voice which holds the current tonal key.- See Also:
-
tp2satzTakt
Maps tscore Tp objects to pairs of movement number and measure number. -
satzTakt2tp
Inverse oftp2satzTakt
. -
pitches
Pitch classes as recognized by the parserparse_pitch
. -
keyVox
Vox keyVoxThe dedicated voice holding the current tonal key. Seevoxname_key
. -
keys
The data from the dedicated voice holding the current tonal key. SeekeyVox
. -
taktbuffer
protected int taktbufferThe running movement number, used to complete measure-only timepoints, as in13/1 /2 /3
. -
parse_time
Format for time points is "movement/measure". -
parse_pitch
Format for pitch classes is German language pitch, lilypond octave ad lib. -
parse_pitches
Parse more than one pitch class, joined by "+". -
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 firstMovementThe lowest movement number appearing in the sequence of tscore input time points. -
lastMovement
int lastMovementThe highes movement number appearing in the sequence of tscore input time points. -
sumVox
Vox sumVoxA 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
Constant holding the functional pitch English "b-sharp", German "his". FIXME Is needed for !?!??!?!?? -
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
Manually entered constants which relate the numbers of "satz"/movements to the "Teile"/parts of the Weihnachtsoratorium. -
last_b_accidental
protected int last_b_accidentalThe 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
Map of the movement number to all pitch classes found for this movement. Is filled as a by-product during the linear printing inwriteLinear(PrintWriter,int)
and used for the "tower of fifth" printing inwriteFifths(PrintWriter,int)
. -
notehead_spacing
Musix tex codes for spacing note heads, by the categories calculated bycategory(FunctionalKey, FunctionalPitchModOctave)
. These note heads are used for the "linear" display: each movement in one line. -
notehead_nospacing
Musix tex codes for non-spacing note heads, by the categories calculated bycategory(FunctionalKey, FunctionalPitchModOctave)
. These note heads are used for the "tower of fifth" display: each movement in one column. -
options
Options as defined inMlwOptions.xml
. -
debugLevel
protected int debugLevel -
mp
Evident. -
mf
Evident. -
mc
Evident. -
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
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
Return the first time point with the given "Sazt"/movement number for which an event is in the input score. -
findValidKey
Find the "tonart"/tonal key input value which stands exactly at the start of the movement "satz". -
category
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
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
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
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 towriteFifths(PrintWriter,int)
in satz2alleTh. -
write_skip
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 bycategory(FunctionalKey, FunctionalPitchModOctave)
, iff pitchName is contained in this Satz. -
writeFifths
Write one movement/"Satz" as one tower of fifth. This goes accros four staves. -
writeNumbers
Write statistics of pitch class numbers to movement numbers for each Part and for the whole Weihnachtsoratorium. -
convertToTex_S
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
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
Evident. -
hasErrors
boolean hasErrors()Evident. -
terminateApplicationOnErrors_printUsage
void terminateApplicationOnErrors_printUsage()Evident. -
terminateApplicationOnErrors
void terminateApplicationOnErrors()Evident. -
convert
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
Creates an instance and callsnonStatic_main(String[])
. -
nonStatic_main
Main execution tool, for the options seeMlwOptions.xml
: name of input tscore file, then file name templates for scale-formed graphics, fith-tower graphics and name of sum file.
-