Class MwHaiku

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

public class MwHaiku extends Object
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-  ,,., !,,,!! ,-x   
   
The 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.
Later these categories will be translated into durations of the generated rhythm.
  • Field Details

    • myModifiers

      static final Modifiers myModifiers
      Tscore parsing control.
    • voxname_haiku

      public static final String voxname_haiku
      The name of the only voice, carrying the haiku syllables.
      See Also:
    • paramname_kategorie

      public static final String paramname_kategorie
      The name of the only obligate parameter track, carrying the categorie of the phonetic units.
      See Also:
    • paramname_register

      public static final String 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_redundant
      Character category: only WRITTEN character, no phonetic appearance.
      See Also:
    • cat_plosive

      public static final char cat_plosive
      Character category: very short explosive sound.
      See Also:
    • cat_long

      public static final char cat_long
      Character category: long (mostly vowel, but also soundful consonant.)
      See Also:
    • cat_short

      public static final char cat_short
      Character category: short (normal vowel or consonant).
      See Also:
    • cat_start

      public static final char cat_start
      Character category: at the start of a syllable, no stand-alone form possible ("spiritus asper" etc)
      See Also:
    • cat_end

      public static final char cat_end
      Character category: at the end of a syllable, nearly vanishing.
      See Also:
    • event2silbe

      final Map<Event,String> event2silbe
      The text for each tscore event.
    • eventNotLastInWord

      final Map<Event,String> eventNotLastInWord
      Whether the text of a tscore event ends with a "-".
    • eventIsLastInLine

      final Map<Event,String> eventIsLastInLine
      Whether the text of a tscore event ends with a "/".
    • event2kategorien

      final Map<Event,String> event2kategorien
      The category string corresponding to the syllable text.
    • event2register

      final Map<Event,String> event2register
      Values of the param track named paramname_register. Additional data for MWs accordeon project.
    • parseText

      protected final Translet.Parser<?> parseText
      Parser for syllable text. Accepts all German language characters.
    • parseKateg

      protected final Translet.Parser<?> parseKateg
      Parser for character categories
    • parseRegister

      protected final Translet.Parser<?> parseRegister
      Parser additional text in the param track named paramname_register.
    • soundEvents

      final List<MwHaiku.GenEvent> soundEvents
      Sequence of event prototypes, generated from the characters of the syllables. (Only this sequence will be further translated into CWN Events by MwHaiku_to_cwn.)
    • soundEvent2inEvent

      final Map<MwHaiku.GenEvent,Event> soundEvent2inEvent
      Maps the sound event prototype to the original Haiku score event.
    • inEvent2soundEvent

      final Map<Event,List<MwHaiku.GenEvent>> inEvent2soundEvent
      Inverse of soundEvent2inEvent.
    • origin

      final Map<Event,Event> origin
      Maps the generated CWN event to the original Haiku score event.
    • posInOrigin

      final Map<Event,Integer> posInOrigin
      Gives the position of the character which lead to the CWN event in the original Haiku score event's sequence of categories.
    • kat2factor

      protected Map<Character,Rational> kat2factor
      Duration factors for the different categories of phonems. Should later be parameterizable, FIXME.
    • debugLevel

      protected int debugLevel
      Whether to print debugging information. (Can become a command line option)
    • msgCounter

      final MessageCounter msgCounter
      Only needed in the main application.
    • msg

      final MessageTee<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg
      Target of all messages.
  • Constructor Details

    • MwHaiku

      public MwHaiku()
  • Method Details

    • dumpRawEvents

      protected void dumpRawEvents(Vox v)
      Debugging method, dump the events of the Haiku score: syllable text, categories and "lastInLine" / "notLastInWord".
    • doAdd

      protected void doAdd(Map<Event,Integer> map, Event e, int i)
      Count up the number assigned to e by one.
    • printStatistics

      protected void printStatistics(Vox v, PrintWriter p, String inputfilename)
      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

      public Vox update(TimeScape timeScape)
      Convert raw data into haiku input events.
      Returns:
      the only haiku voice (for printing statistics, etc.)
    • error

      void error(String s)
      Send an error to msg
    • error

      void error(Event e, String s)
      Send an error to msg with the event's location
    • hasErrors

      boolean hasErrors()
      Whether errors have been received by msg.
    • terminateApplicationOnErrors

      void terminateApplicationOnErrors()
      Evident. Print text and message counts.
    • convert

      protected void convert(String inputfilename)
      Central service provision: read the input file identified by the given file name and generate all output files.
    • main

      public static void main(String[] args)
      Application to parse a tscore source file and generated lilypond source and statistics.
    • nonStatic_main

      public void nonStatic_main(String[] args)
      Application to parse a tscore source file and generated lilypond source and statistics.