Class Score_hkn

java.lang.Object
eu.bandm.music.haken.Score_hkn
Direct Known Subclasses:
Score_hkn_sig_v00, Score_hkn_svg_v00, Score_hkn_vla_v00, Score_hkn_vox_v00

public class Score_hkn extends Object
This class represents the use of tscore models for ml's "hook project" ("HKN-Projekt").
Usage:
The different classes for different back-ends are derived from this class. An instance is created with an already raw-parsed TimeScape, and (optionally) a Score_hkn.Parameters collection. Then update() is called, which parses all contained voices. (TpTops are integer with arbitrary subdivisions, and stand for "K-measure-numbers", with no relation to front-end timing, but possibly printed in the F-score as comments.)

Example of a K-Score

   T         1      !         !                   2
   VOX v0    p2               p1        p2
   VOX v1    M      O         MU        OMO    
   VOX v2    MO 'OM U         MUUM                   
  
Voice "v0" is a voice containing only "additional pauses" to support the reception of the intended groupings. (This will be done additionally to and outside of the Haken expansion process.)
Voices "v1" and "v2" are a "Haken-Voices" = "K-Voices". They contain arbitrary sequences of RelWert, Haken and DoppelHaken. (= relative values, hooks and double hooks). They will be selected to control particular parameters when translating to an executable V-score.

First step is to create an Score_hkn.Expansion of a selection of voices. This is a transformed score where the voices contain RelWert only, at each K-Timepoint in the union of the selected voices. For example, the score above can be expanded to

   T         1            !         !      .           2
   VOX v0    p2                     p1     p2
   VOX v1    M            O         M O U  O U M U O  
   VOX v2    M U O O U M  U         M O O  U U O O M 
  
The rules for this expansion can become complicated and can be further modified by translation parameters and operators in the source text. (E.g. the apostrophe in v2 above means: "do not overlap"; contrarily a tilde means "force overlap".) For the details see the project documentation (in German).

All further processing is specific to the interpretation of the K-score, as realized by the subclasses of this class. It operates only on Score_hkn.Expansion.tps and Score_hkn.Expansion.expanded, which run in parallel (plus possibly a dedicated "Pause" voice, which assigns articulation pauses to a subset of the time points).

Additionally a voice may contain "pause" events, and the specialized process may select a particular voice to translate the contained pause events to some foreground temporal articulation/gap. (Pauses are meant to occur BEFORE the sound event at the same K-Timepoint.)
FIXME ATTENTION do not mix pause events with haken events !? is currently not checked by the parser ?!?!?!

  • Field Details

    • modifiers

      protected static Modifiers modifiers
      Control parameters for the raw tscore parsing process.
    • name

      protected final String name
      FIXME DOC
    • noVoiceSelected

      public static final String noVoiceSelected
      String value to be used instead of a voice name, iff no voice is selected for a particular role.
      See Also:
    • allMedium

      public static final List<RelWert> allMedium
      An infinite list delivering RelWert.M at every position.
    • msgr

      final MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msgr
      Target of all messages generated by this class.
    • msg

      final SimpleMessage.Sender<eu.bandm.tools.util.xml.XMLDocumentIdentifier> msg
      Target of all messages generated by this class.
    • tsPart

      final Part tsPart
      The tscore score PART to process. Normally the result of parsing a tscore source file.
    • parameters

      final Score_hkn.Parameters parameters
      The control parameters for the expansion process, etc.
    • noPauseSelected

      public static final int noPauseSelected
      Value returned by getPauseIndexByIndex(List,Vox,int,int) if no valid entry is found.
      See Also:
    • tp2barnum

      final Map<TpTop,Integer> tp2barnum
      Map of numeric entries in tne tsore "T" line to their text, as usual in tscore raw parsing.
    • barnum2tp

      final SortedMap<Integer,TpTop> barnum2tp
      Inverse of tp2barnum, as usual in tscore raw parsing.
    • event2haken

      final Map<Event,Haken> event2haken
      Semantic attribute of events.
    • event2doppelHaken

      final Map<Event,DoppelHaken> event2doppelHaken
      Semantic attribute of events.
    • event2relwert

      final Map<Event,RelWert> event2relwert
      Semantic attribute of events.
    • event2pause

      final Map<Event,Integer> event2pause
      Semantic attribute of events. Pauses are contained in dedicated voices and notated as "p0", "p2", "p2", etc., with a dynamic upper limit and increasing significance.
    • event2noOverlap_start

      final Map<Event,String> event2noOverlap_start
      Semantic attribute of events. Means that the event source text starts with an apostrophe "&amp;", what suppresses any overlap with its predecessor.
    • event2forceOverlap_start

      final Map<Event,String> event2forceOverlap_start
      Semantic attribute of events. Means that the event source text starts with a tilde "~", what enforces overlap with its predecessor.
    • event2noOverlap_end

      final Map<Event,String> event2noOverlap_end
      Semantic attribute of events. Means that the event source text ends with an apostrophe "'", what suppresses any overlap with its successor.
    • event2forceOverlap_end

      final Map<Event,String> event2forceOverlap_end
      Semantic attribute of events. Means that the event source text ends with a tilde "~", what enforces overlap with its successor.
    • eventCanOverlapAtStart

      final Set<Event> eventCanOverlapAtStart
      Holds all events which start with the same RelWert as their predecssor ends.
    • parser

      final Translet.Parser<?> parser
      Parser for relwert/haken voices AND pause voices. Both shall not be mixed.
    • tp2rat

      final Map<Tp,Rational> tp2rat
      Maps all time points to rationals, als usual in tscore raw parsing. (The rational time values of these K-Voices have no significance beyond their sequential order.)
    • rat2tp

      final SortedMap<Rational,Tp> rat2tp
      Inverse of tp2rat, as usual in tscore raw parsing.
  • Constructor Details

    • Score_hkn

      public Score_hkn(String name, Part tsPart, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg)
      Constructor which will use the default controal Score_hkn.Parameters.
      Parameters:
      tsPart - the already raw-parsed time scape. (Normally the parse result of a tscore source file.)
      msg - drain of all messages.
    • Score_hkn

      public Score_hkn(String name, Part tsPart, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, @Opt @Opt Score_hkn.Parameters parameters)
      Constructor which will use an explicit parameter setting.
      Parameters:
      tsPart - the already raw-parsed time scape. (Normally the result of parsing a tscore source file.)
      msg - drain of all messages.
      parameters - to control the parsing and expansion process.
  • Method Details

    • findVoice

      @Opt protected @Opt Vox findVoice(@Opt @Opt String s1, boolean errorsNotWarnings)
      Auxiliary functions for sub-classes=specialized formats, to find a voice for a particular purpose by name. If not there, write error or warning to global messagereceiver.
      Parameters:
      s1 - name of the voice. If ==null or ==noVoiceSelected, then return null.
      errorsNotWarnings - whether not finding a name (!=null and != noVoiceSelected) will raise an error, not only a warning.
    • getPauseIndexByIndex

      protected int getPauseIndexByIndex(List<Tp> tps, @Opt @Opt Vox vpause, int i, int maxPause)
      Valid pauses are numbered from 0 to maxPause, with increasing significance.
      Returns:
      noPauseSelected (==-1) for not defined pauses and issue error message for too large index. The parser syntax already enyures that pause nubmers are non-negative.
    • getRelWertFolge

      protected RelWertFolge getRelWertFolge(Event ev)
      Get Relwert, Haken or DoppelHaken standing with the given event.
    • getRelWertFolge_first

      @Opt protected @Opt RelWert getRelWertFolge_first(Event ev)
      Get the first RelWert of the entry with the given event.
    • update

      public void update()
      Translate untyped tscore data into semantically defined values.
      1. Parse all voices into the maps event2relwert, event2haken, event2doppelHaken, and additionally "event2(no/force)overlap_(start/end)".
      2. Calculate time instances for ALL tps into two global caches (forward and backward, tp2rat and rat2tp.) TpTops are integer constants with arbitrary subdivisions, and stand for "abstract bar numbers", not for any concrete time domain or front-end measures. All Tps are linked to a Rational.