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+&C2&major&inKey+&thirds 
     VOX v1   %  .12r1    >2            -.    %  
     VOX v2   %           11r5          % 
     VOX v3   55          -.          % >L4   %
         view β *  

FIXME NO DEFAULTS ! The name of the "conf" voice is fixed. There must be an event at the very first timepoint, giving orientation, base pitch, scale, // tonal key, inKey // chromatic or diatonic / subset, and adjacency. // distance !?!?
Only when the functional key changes, the parameter

invalid reference
layoutTransition
// fixed is required.

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 named "conf" contains the switches of the global configuration parameters, esp. for the "pitch layout". as an unordered list of values of optional alternatives.

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

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 pad's coordinate means a new attack on this pad, 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

    • MIN_ROW

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

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

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

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

      Receiver of error/log messages.
    • msgCount

      final MessageCounter msgCount
      Counter of message kinds.
    • 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.
    • PRELUDENAME_COLLISION

      public static final String PRELUDENAME_COLLISION
      See Also:
    • 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.
    • DEFAULT_HORIZONTAL

      public static final boolean DEFAULT_HORIZONTAL
      See Also:
    • DEFAULT_FIXED

      public static final boolean DEFAULT_FIXED
      See Also:
    • DEFAULT_INKEY

      public static final boolean DEFAULT_INKEY
      See Also:
    • DEFAULT_DISTANCE

      public static final Tabstaff.distance DEFAULT_DISTANCE
    • DEFAULT_SCALE

      public static final ScalaNumAbstrPOcts DEFAULT_SCALE
    • DEFAULT_BASEPITCH

      public static final PitchAndOctave<OctaveRegister,FunctionalPitchModOctave> DEFAULT_BASEPITCH
    • event2horizontal

      Map<Event,Boolean> event2horizontal
      Storage for events in the configuration voice.
    • event2fixed

      Map<Event,Boolean> event2fixed
      Storage for events in the configuration voice.
    • event2inKey

      Map<Event,Boolean> event2inKey
      Storage for events in the configuration voice.
    • event2distance

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

      Storage for events in the configuration voice.
    • event2basePitch

      Storage for events in the configuration voice.
    • event2subArea

      Map<Event,Tabstaff.SubArea> event2subArea
      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 "%"
    • CONFIGURATION_VOICENAME

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

      @Opt @Opt Vox configurationVoice
      The voice which controls the layout of the TUI.
    • NOTATION_VOICENAME

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

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

      protected ArrayList<Vox> padPressVoices
      Whether the voice is a normal one, with pad-press data, not a configuration voice.
    • parserCoord

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

      final Translet.Parser<?> parserHand
      Parser for the hand indication
    • parserFinger

      final Translet.Parser<?> parserFinger
      Parser for the finger indication
    • parserChange

      final Translet.Parser<?> parserChange
      Parser for the hand and/or finger change
    • 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

  • Method Details

    • pitchLayout

      final Translet.Parser<?> pitchLayout(String lang)
      Parser for events in the configuration voice.
    • normalize

      protected void normalize(Vox v)
      Semantic evaluation. (Eliminate initial "hold" events; hand selection is sticky; so are coordinates for finger-change events; check finger-number not without hand-spec; memorize end points of all non-pauses.)
    • update

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

      static void usage()
      Print help text for command line options, in cases of error etc.
    • 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