Class Tabstaff

java.lang.Object
eu.bandm.music.applications.tabstaff.Tabstaff

public class Tabstaff extends Object
Tscore parsing and model creation of a subset of "TabStaff+", as presented by L.Wilde and C.White on Tenor2024 in Zürich. proceedings pg 159--168
(Planned backends are: XML encoding (MISSING FIXME), own tablature graphics, Midi encoding (MISSING FIXME), and dynamic SVG proof rendering )

The tscore input is intended to realize the semantic contents. Very different renderings ("Tab+", "Staff+", "Charts+") can be derived from such a model. The tscore input looks like...

     T        1           2             3        4
     VOX conf horizontal&Cmaj&diatonic&thirds 
     VOX v1   %  .12r1    >2            -.    %  
     VOX v2   %           11r5          % 
     VOX v3   55          -.          % >L4   %
         view β *  

The name of the "conf" voice is fixed. There must be an event at the very first timepoint, giving orientation, tonal key, subset, and adjacency.
Only then the functional key changes, the parameter Tabstaff.layoutTransition is required.

FIXME Currently the tonal key can only be given in the German language.

FIXME Currently only the very first event is evaluated (for orientation, tonal mode, subset, adjacency). FIXME subset and orientation are NOT YET considered

The time points follow the standard strategy of metrical sub-divisions. This includes dotted notation. In this preliminary demo version the meter is fixed to 4/4. FIXME
The reserved voice name "conf" contains the switches of the global configuration parameters, as an unordered list of values of optional alternatives.

Most events in (the main parameter track of) such a voice are a tuple of the row and column cooordinate of the switch (1-based), plus optionally a hand and a finger indication = one character for the hand plus the finger number. The hand is required with the very finger specification and extends "sticky" over all successors.
This can be limited by an explicit "X" for "hand is ad lib".
(Please note that the sequnce "row before column" corresponds to the usual "matrix" view, not to the "Cartesian coordinates".)

The special form ">" with a finger (or hand+finger) indication means an unaudible finger change.

The source text of "row" and "column" goes from 1 to 8, "finger" from 1 to 5, as usual for keyboards.
A hold "-" and a pause "%" have the usual meaning. Any event which contains a key coordinate means a new attack on thiskey, even when the event has the same combination of values as its immediate predecessor.

The input sequences ">2" or ">r2" mean a silent finger change to finger "2" of the current hand, resp. the right hand, on the button defined by the adjacently preceding event.

The voice names "nota" influences the renderings and can contain the clef indications "A", "AB", "B", "α", "β", etc.

This demo version generates a tablature-like graphics, multiple static chord diagrams ("Charts+") as SVG, and an animated sequence of these, with BPM 40 .

Please see the examples for details.

SVG source text generation by the library JSVG by Jon Sevy. documenation here.

  • Field Details

    • minrow

      public static final int minrow
      Lowest row index on the standard TUI device
      See Also:
    • maxrow

      public static final int maxrow
      Highest row index on the standard TUI device. Can be overwritten by a subclass.
      See Also:
    • mincol

      public static final int mincol
      Lowest column index on the standard TUI device
      See Also:
    • maxcol

      public static final int maxcol
      Highest column index on the standard TUI device. Can be overwritten by a subclass.
      See Also:
    • msgr

      final MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msgr
      Receiver of error/log messages.
    • msgCount

      final MessageCounter msgCount
      Counter of message kinds.
    • msg

      final SimpleMessage.Sender<eu.bandm.tools.util.xml.XMLDocumentIdentifier> msg
      For to conveniently construct messages and send them to msgr and counter.
    • part

      protected final Part part
      The score data as parsed by tscore.
    • modifiers

      public static final Modifiers modifiers
      Modifiers controlling the parsing process.
    • tp2rat

      protected final Map<Tp,Rational> tp2rat
      Map time point objects to rational time values. Cf Score_cwn.
    • rat2tp

      protected final SortedMap<Rational,Tp> rat2tp
      Inverse of tp2rat.
    • lastTpTop_rat

      protected Rational lastTpTop_rat
      Very last time point in score.
    • lastTp

      protected Tp lastTp
      Very last time point in score.
    • firstTpTop_rat

      protected Rational firstTpTop_rat
      Very first time point in score. (Tablature graphic reqires currently ==0/1.)
    • firstTp

      protected Tp firstTp
      Very first time point in score.
    • decimal2tpTop

      protected final SortedMap<BigDecimal,TpTop> decimal2tpTop
      Parser for the measure numbers.
    • tpTop2decimal

      final Map<TpTop,BigDecimal> tpTop2decimal
      Inverse of decimal2tpTop.
    • event2orientation

      Map<Event,Tabstaff.orientation> event2orientation
      Storage for events in the configuration voice.
    • event2distance

      Map<Event,Tabstaff.distance> event2distance
      Storage for events in the configuration voice.
    • event2subset

      Map<Event,Tabstaff.subset> event2subset
      Storage for events in the configuration voice.
    • event2layoutTransition

      Map<Event,Tabstaff.layoutTransition> event2layoutTransition
      Storage for events in the configuration voice.
    • event2functionalKey

      Map<Event,FunctionalKey> event2functionalKey
      Storage for events in the configuration voice.
    • microLayout

      final Translet.Parser<?> microLayout
      Parser for events in the configuration voice.
    • event2staffControl

      Map<Event,Tabstaff.SubArea> event2staffControl
      Total map from all events in the notation voice.
    • notationHints

      final Translet.Parser<?> notationHints
      Parser for notation control. FIXME MORE TO COME
    • event2endpos

      Map<Event,Rational> event2endpos
      Total map from all events except pauses or holds.
    • event2hasAttack

      Map<Event,String> event2hasAttack
      Total map from all events except pauses or holds.
    • event2x

      Map<Event,Integer> event2x
      Total map from all events except pauses or holds.
    • event2y

      Map<Event,Integer> event2y
      Total map from all events except pauses or holds.
    • event2finger

      Map<Event,Integer> event2finger
      Partial map from all events except pauses or holds.
    • event2hand

      Map<Event,Tabstaff.Hand> event2hand
      Total map from all events except holds.
    • holds

      final Map<Event,String> holds
      All "hold" events "-"
    • pauses

      final Map<Event,String> pauses
      All "pause" events "%"
    • configurationVoiceName

      public static final String configurationVoiceName
      The pre-scribed name of the voice which controls the layout of the TUI.
      See Also:
    • configurationVoice

      Vox configurationVoice
      The voice which controls the layout of the TUI.
    • notationVoiceName

      public static final String notationVoiceName
      The pre-scribed name of the voice which controls the notation.
      See Also:
    • notationVoice

      @Opt @Opt Vox notationVoice
      The voice which controls the notation
    • keypressVoices

      protected ArrayList<Vox> keypressVoices
      Whether the voice is a normal one, with keypress data, not a configuration voice.
    • parser_coord

      final Translet.Parser<?> parser_coord
      Parser for the TUI coordinates: row before column.
    • parser_hand

      final Translet.Parser<?> parser_hand
      Parser for the hand indication
    • parser_finger

      final Translet.Parser<?> parser_finger
      Parser for the finger indication
    • parser

      final Translet.Parser<?> parser
      Parser for events with pauses and holds
    • COLOR_BG_OKAY

      public static final Color COLOR_BG_OKAY
      Background of the interactive tablature window
  • Constructor Details

    • Tabstaff

      public Tabstaff(Part part, MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> extMsgr)
      Construct data for one particular Part of a tscore TimeScape. In the score source text this is marked by "PART". Usage: create this instance and call update().
  • Method Details

    • normalize

      protected void normalize(Vox v)
      Semantic evaluation. (Eliminate "hold" events; hand selection is sticky; so are coordinates with finger-change events; memorize all end points.)
    • update

      public void update()
      Translate untyped tscore data into semantically sensible data, indexed by events.
    • usage

      static void usage()
    • main

      public static void main(String[] args) throws IOException
      Stand-alone application, translates input file "arg[0]" into multiple static SVGs, one dynamic SVG, and one tabular SVG. The tabular SVG is interactively presented if there is no (arbitrary non-empty) second command line argument. If no command line arguments are given, the tscore file to translate is selected interactively. The output files are in the same directory as the source and have derived names:
                comp007.tscore        // score file
      
                comp007.svg           // animated graphics
      
                comp007_0.svg         // screen shots of the animation 
                comp007_3_8.svg       //    at the given metric time point
                comp007_1_4.svg      
      
                comp007.tab.svg       // tablature
        
      Throws:
      IOException