Package eu.bandm.music.top
Class MwHaiku
java.lang.Object
eu.bandm.music.top.MwHaiku
Realizes the parsing of a "Haiku" score in MWs accordeon project.
Every tscore file contains a single part with a single voice.
The events therein are text syllables of a haiku.
They are written as a mere sequence, without any timinig information.
They carry additional attributes (mandatory and optional) which allow
to translate them into a
Score_cwn
, for printing, executing or
further manual or automated processing.
A working example is in sig/examples/tscore/haiku0.tscore
.
The currently supported format is as follows:
// since only the sequential order is semantically relevant, this // top-level time points are required only technically, for parsing: T 0 1 VOX haiku Wol- ken am Hü- gel/ der Hund des Schä- fers treibt sie/ categ -,- !,- ,- !- !,- !-. :-,! !,, :xx- ,,., !,,,!! ,-xThe characters in the text line stand for the Haiku text, divided in syllables. Appended can be "-" for "syllable not yet finished" and "/" for "line finished." Each text character must be categorized by a character code in the "categ" parameter track as in a particular phoneme category or not. The categories and their codes are:
- "{\code !}" = short sound, maybe explosive (often at the beginning of a syllable)
- "{\code :}" = short at the beginning, no stand alone possible, like "spiritus asper".
- "{\code -}" = longer, either vowel or sounding consonant
- "{\code ,}" = normal length vowel or consonant
- "{\code .}" = short (maybe explosive) at the end of a syllabel, nearly vanishing.
- "{\code x}" = No own phoneme. Has own position only in writing, but not in speaking.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Prototypes to generate a CWN Event (with text and markup). -
Field Summary
Modifier and TypeFieldDescriptionstatic final char
Character category: at the end of a syllable, nearly vanishing.static final char
Character category: long (mostly vowel, but also soundful consonant.)static final char
Character category: very short explosive sound.static final char
Character category: only WRITTEN character, no phonetic appearance.static final char
Character category: short (normal vowel or consonant).static final char
Character category: at the start of a syllable, no stand-alone form possible ("spiritus asper" etc)protected int
Whether to print debugging information.The category string corresponding to the syllable text.Values of the param track namedparamname_register
.The text for each tscore event.Whether the text of a tscore event ends with a "/
".Whether the text of a tscore event ends with a "-
".(package private) final Map<Event,
List<MwHaiku.GenEvent>> Inverse ofsoundEvent2inEvent
.Duration factors for the different categories of phonems.(package private) final MessageTee<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>>
Target of all messages.(package private) final MessageCounter
Only needed in the main application.(package private) static final Modifiers
Tscore parsing control.Maps the generated CWN event to the original Haiku score event.static final String
The name of the only obligate parameter track, carrying the categorie of the phonetic units.static final String
The name of the an additional parameter track, carrying the accordeon register for MWs project.protected final Translet.Parser<?>
Parser for character categoriesprotected final Translet.Parser<?>
Parser additional text in the param track namedparamname_register
.protected final Translet.Parser<?>
Parser for syllable text.Gives the position of the character which lead to the CWN event in the original Haiku score event's sequence of categories.(package private) final Map<MwHaiku.GenEvent,
Event> Maps the sound event prototype to the original Haiku score event.(package private) final List<MwHaiku.GenEvent>
Sequence of event prototypes, generated from the characters of the syllables.static final String
The name of the only voice, carrying the haiku syllables. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Central service provision: read the input file identified by the given file name and generate all output files.protected void
Count up the number assigned to e by one.protected void
dumpRawEvents
(Vox v) Debugging method, dump the events of the Haiku score: syllable text, categories and "lastInLine" / "notLastInWord".(package private) void
Send an error tomsg
with the event's location(package private) void
Send an error tomsg
(package private) boolean
Whether errors have been received bymsg
.static void
Application to parse a tscore source file and generated lilypond source and statistics.void
nonStatic_main
(String[] args) Application to parse a tscore source file and generated lilypond source and statistics.protected void
printStatistics
(Vox v, PrintWriter p, String inputfilename) Print the whole analysed input score as a vertical table of groupings and frequencies.(package private) void
Evident.Convert raw data into haiku input events.
-
Field Details
-
myModifiers
Tscore parsing control. -
voxname_haiku
The name of the only voice, carrying the haiku syllables.- See Also:
-
paramname_kategorie
The name of the only obligate parameter track, carrying the categorie of the phonetic units.- See Also:
-
paramname_register
The name of the an additional parameter track, carrying the accordeon register for MWs project.- See Also:
-
cat_redundant
public static final char cat_redundantCharacter category: only WRITTEN character, no phonetic appearance.- See Also:
-
cat_plosive
public static final char cat_plosiveCharacter category: very short explosive sound.- See Also:
-
cat_long
public static final char cat_longCharacter category: long (mostly vowel, but also soundful consonant.)- See Also:
-
cat_short
public static final char cat_shortCharacter category: short (normal vowel or consonant).- See Also:
-
cat_start
public static final char cat_startCharacter category: at the start of a syllable, no stand-alone form possible ("spiritus asper" etc)- See Also:
-
cat_end
public static final char cat_endCharacter category: at the end of a syllable, nearly vanishing.- See Also:
-
event2silbe
The text for each tscore event. -
eventNotLastInWord
Whether the text of a tscore event ends with a "-
". -
eventIsLastInLine
Whether the text of a tscore event ends with a "/
". -
event2kategorien
The category string corresponding to the syllable text. -
event2register
Values of the param track namedparamname_register
. Additional data for MWs accordeon project. -
parseText
Parser for syllable text. Accepts all German language characters. -
parseKateg
Parser for character categories -
parseRegister
Parser additional text in the param track namedparamname_register
. -
soundEvents
Sequence of event prototypes, generated from the characters of the syllables. (Only this sequence will be further translated into CWN Events byMwHaiku_to_cwn
.) -
soundEvent2inEvent
Maps the sound event prototype to the original Haiku score event. -
inEvent2soundEvent
Inverse ofsoundEvent2inEvent
. -
origin
Maps the generated CWN event to the original Haiku score event. -
posInOrigin
Gives the position of the character which lead to the CWN event in the original Haiku score event's sequence of categories. -
kat2factor
Duration factors for the different categories of phonems. Should later be parameterizable, FIXME. -
debugLevel
protected int debugLevelWhether to print debugging information. (Can become a command line option) -
msgCounter
Only needed in the main application. -
msg
Target of all messages.
-
-
Constructor Details
-
MwHaiku
public MwHaiku()
-
-
Method Details
-
dumpRawEvents
Debugging method, dump the events of the Haiku score: syllable text, categories and "lastInLine" / "notLastInWord". -
doAdd
Count up the number assigned to e by one. -
printStatistics
Print the whole analysed input score as a vertical table of groupings and frequencies.syllables in that line / syllables in that word / / phonemes in that word / / / phonemes in that syllables / / / / syllable / / / / /and categories / / / / / Phonemes and calculated durations / / / / / / S/Z S/W Ph/W Ph/S | ------------------------+--------------- 5 2 6 3 | Wol W=1/2 o=1/4 l=1/2 | -,- 3 | ken k=1/12 e=1/4 n=1/2 | !,- 1 2 2 | am a=3/8 m=3/4 | ,- 2 5 2 | Hü H=1/8 ü=3/4 | !- 3 | gel g=1/12 e=1/4 l=1/2 | !,-
-
update
Convert raw data into haiku input events.- Returns:
- the only haiku voice (for printing statistics, etc.)
-
error
Send an error tomsg
-
error
Send an error tomsg
with the event's location -
hasErrors
boolean hasErrors()Whether errors have been received bymsg
. -
terminateApplicationOnErrors
void terminateApplicationOnErrors()Evident. Print text and message counts. -
convert
Central service provision: read the input file identified by the given file name and generate all output files. -
main
Application to parse a tscore source file and generated lilypond source and statistics. -
nonStatic_main
Application to parse a tscore source file and generated lilypond source and statistics.
-