public class MlWorat extends Object
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------------>1 TpTop ------------>1 Event ----------->n pitch 1<------------ ----------->1 key tp2satzTakt keys
Modifier and Type | Field and Description |
---|---|
(package private) 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").
|
protected int |
debugLevel |
(package private) int |
firstMovement
The lowest movement number appearing in the sequence of tscore input time points.
|
(package private) static FunctionalPitchModOctave |
FP_his
Constant holding the functional pitch English "b-sharp", German "his".
|
(package private) Map<Event,FunctionalKey> |
keys
The data from the dedicated voice holding the current tonal key.
|
(package private) Vox |
keyVox
The dedicated voice holding the current tonal key.
|
protected int |
last_b_accidental
The index of the last white key which has been printed with a "flat" accidental.
|
(package private) int |
lastMovement
The highes movement number appearing in the sequence of tscore input time points.
|
(package private) MessageCounter |
mc
Evident.
|
(package private) MessageFormatter<XMLDocumentIdentifier> |
mf
Evident.
|
(package private) MessagePrinter<SimpleMessage<XMLDocumentIdentifier>> |
mp
Evident.
|
(package private) MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> |
msg
Evident.
|
static String |
mylang
The language used for parsing the tonal keys and the pitch classes.
|
(package private) static Modifiers |
myModifiers
Modifiers for the different phases of the parsing process.
|
protected String[] |
notehead_nospacing
Musix tex codes for non-spacing note heads, by the
categories calculated by
category(FunctionalKey, FunctionalPitchModOctave) . |
protected String[] |
notehead_spacing
Musix tex codes for spacing note heads, by the
categories calculated by
category(FunctionalKey, FunctionalPitchModOctave) . |
(package private) MlwOptions |
options
Options as defined in
MlwOptions.xml . |
protected Translet.Parser<?> |
parse_key
Parse German language tonal key indication.
|
protected Translet.Parser<?> |
parse_pitch
Format for pitch classes is German language pitch, lilypond octave ad lib.
|
protected Translet.Parser<?> |
parse_pitches
Parse more than one pitch class, joined by "+".
|
protected Translet.Parser<Tuple2<Integer,BigDecimal>> |
parse_time
Format for time points is "movement/measure".
|
(package private) Multimap<Event,FunctionalPitchModOctave> |
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).
|
(package private) Multimap<Event,Tuple2<FunctionalPitchModOctave,OctaveRegister>> |
pitches
Pitch classes as recognized by the parser
parse_pitch . |
protected Map<Integer,Set<FunctionalPitchModOctave>> |
satz2alleTh
Map of the movement number to all pitch classes found for this movement.
|
(package private) SortedMap<Tuple2<Integer,BigDecimal>,TpTop> |
satzTakt2tp
Inverse of
tp2satzTakt . |
(package private) 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.
|
protected int |
taktbuffer
The running movement number, used to complete measure-only timepoints, as in
13/1 /2 /3 . |
static Map<Integer,Integer> |
teil2satz
Manually entered constants which relate the numbers of "satz"/movements to the
"Teile"/parts of the Weihnachtsoratorium.
|
(package private) Map<TpTop,Tuple2<Integer,BigDecimal>> |
tp2satzTakt
Maps tscore Tp objects to pairs of movement number and measure number.
|
static String |
voxname_key
The name of the voice which holds the current tonal key.
|
Constructor and Description |
---|
MlWorat() |
Modifier and Type | Method and Description |
---|---|
protected int |
category(FunctionalKey key,
FunctionalPitchModOctave p)
Compare a pitch class to a scale.
|
static Comparator<FunctionalPitchModOctave> |
chromaticScaleComparator(FunctionalPitchModOctave basis)
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 |
error(String s)
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 |
hasErrors()
Evident.
|
static void |
main(String[] args)
Creates an instance and calls
nonStatic_main(String[]) . |
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.
|
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. |
(package private) void |
terminateApplicationOnErrors_printUsage()
Evident.
|
(package private) void |
terminateApplicationOnErrors()
Evident.
|
void |
update(Part p0)
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 by
category(FunctionalKey, FunctionalPitchModOctave) ,
iff pitchName is contained in this Satz. |
protected void |
write_skip(PrintWriter pw)
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 |
writeNumbers(PrintWriter pw)
Write statistics of pitch class numbers to movement numbers for each Part
and for the whole Weihnachtsoratorium.
|
static final Modifiers myModifiers
public static final String mylang
public static final String voxname_key
final Map<TpTop,Tuple2<Integer,BigDecimal>> tp2satzTakt
final SortedMap<Tuple2<Integer,BigDecimal>,TpTop> satzTakt2tp
tp2satzTakt
.final Multimap<Event,Tuple2<FunctionalPitchModOctave,OctaveRegister>> pitches
parse_pitch
.Vox keyVox
voxname_key
.final Map<Event,FunctionalKey> keys
keyVox
.protected int taktbuffer
13/1 /2 /3
.protected final Translet.Parser<Tuple2<Integer,BigDecimal>> parse_time
protected final Translet.Parser<?> parse_pitch
protected final Translet.Parser<?> parse_pitches
protected final Translet.Parser<?> parse_key
final Multimap<Event,FunctionalPitchModOctave> pitchClasses
int firstMovement
int lastMovement
Vox sumVox
static final FunctionalPitchModOctave FP_his
final List<FunctionalPitchModOctave> allPitchClasses_sorted
public static final Map<Integer,Integer> teil2satz
protected int last_b_accidental
protected Map<Integer,Set<FunctionalPitchModOctave>> satz2alleTh
writeLinear(PrintWriter,int)
and used for the "tower of fifth"
printing in writeFifths(PrintWriter,int)
.protected String[] notehead_spacing
category(FunctionalKey, FunctionalPitchModOctave)
.
These note heads are used for the "linear" display: each movement in one line.protected String[] notehead_nospacing
category(FunctionalKey, FunctionalPitchModOctave)
.
These note heads are used for the "tower of fifth" display: each movement in one column.final MlwOptions options
MlwOptions.xml
.protected int debugLevel
final MessagePrinter<SimpleMessage<XMLDocumentIdentifier>> mp
final MessageFormatter<XMLDocumentIdentifier> mf
final MessageCounter mc
final MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg
public static Comparator<FunctionalPitchModOctave> chromaticScaleComparator(FunctionalPitchModOctave basis)
public void update(Part p0)
protected Tuple2<Integer,BigDecimal> firstTp(int satz)
protected FunctionalKey findValidKey(int satz)
protected int category(FunctionalKey key, FunctionalPitchModOctave p)
protected String musixTexName(FunctionalPitchModOctave fp)
protected String count2tex(int count)
protected void writeLinear(PrintWriter pw, int satz)
writeFifths(PrintWriter,int)
in satz2alleTh.protected void write_skip(PrintWriter pw)
protected void write_note(PrintWriter pw, int satz, FunctionalKey key, String pitchName, String str)
category(FunctionalKey, FunctionalPitchModOctave)
,
iff pitchName is contained in this Satz.protected void writeFifths(PrintWriter pw, int satz)
protected void writeNumbers(PrintWriter pw)
public void convertToTex_S(PrintWriter pw, String genComment, int teil)
public void convertToTex_Q(PrintWriter pw, String genComment, int teil)
void error(String s)
boolean hasErrors()
void terminateApplicationOnErrors_printUsage()
void terminateApplicationOnErrors()
protected void convert(MlwOptions options)
public static void main(String[] args)
nonStatic_main(String[])
.public void nonStatic_main(String[] args)
MlwOptions.xml
: name of input tscore file,
then file name templates for scale-formed graphics, fith-tower graphics and name of sum file.