Class ChartGraphics2

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

public class ChartGraphics2 extends Object
Generate the chart views for the Ableton Push grid TUI. Usage as a one-shot instance: (1) Create one instance for one particular score and grid geometry, (2) overwrite the graphic parameters by {{a=b;}}, (3) call
invalid reference
#makeeSequenceOfSvgs()
or writeSequenceOfSvgs(String) or and/or writeToDynamicSVG(File), etc., to generate the graphic output.

This class uses the JSVG library.

FIXME make ONE CHART (ohne partitur!) fehlt noch !!

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) float
    Duration (in seconds) subtracted from the end of a keypress, to visually indicate key repetitions.
    (package private) Font
     
    (package private) int
    Configuration parameter: Size of the circle which stands for events by arbitrary hands.
    (package private) Color
    Configuration parameter: Color of all diatonic keys.
    (package private) Color
    Configuration parameter: Color of all key-press symbols.
    (package private) Color
    Configuration parameter: Color of all keys between the diatonic keys.
    (package private) Color
    Configuration parameter: Color of numbers on filled keypress symbols.
    (package private) int
    Configuration parameter: offset between two adjacent squares which represent the keys.
    (package private) int
    Configuration parameter: offset between two adjacent squares which represent the keys.
    (package private) float
    Global input register for adding the transparency animation.
    (package private) int
    Configuration parameter: border of squares representing keys which are root.
    (package private) int
    Configuration parameter: border of squares representing keys which are not root.
    final int
    Highest index for columns.
    final int
    Highest index for rows.
    Target of all messages.
    (package private) int
    Configuration parameter: Offset from the left margin of the graphic area to the very first square which represents a key.
    (package private) int
    Configuration parameter: Offset from the top margin of the graphic area to the very first square which represents a key.
    (package private) int
    Configuration parameter: Size of the rotated square which stands for left-hand events.
    (package private) int
    Configuration parameter: Radius of the rounded corner.
    (package private) int
    Configuration parameter: Radius of the rounded corner.
     
    (package private) Tabstaff.distance
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) boolean
     
    (package private) ScalaNumAbstrPOcts
     
    final Tabstaff
    The score data which will be rendered.
    (package private) int
    Configuration parameters: Duration of one 1/1 note in seconds.
    (package private) int
    Configuration parameter: width of the squares which represent the keys.
    (package private) int
    Configuration parameter: height of the squares which represent the keys.
    (package private) int
    Configuration parameter: Size of the upright square which stands for right-hand events.
    (package private) float
    Global input register for adding the transparency animation.
    (package private) BasicStroke
     
    (package private) BasicStroke
     
    (package private) BasicStroke
     
    (package private) com.jsevy.jsvg.SVGDocument
    Needed as global reference for adding the transparency animation.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Basic constructor which defines fundamental input and output data.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) int
    col2coord(int column)
    Get the x coord of a given column number (from 1 to 8).
    (package private) Path2D
    diamond(double x, double y)
     
    (package private) void
    Initialize the resources needed for drawing.
    (package private) boolean
     
    Service Access Point: Write to a sequence of distinct files which contain the graphics for different time points as static SVG.
    void
    number(Graphics2D gr, int column, int row, int finger, Color color)
    Generate the svg source for printing the finger number.
    (package private) void
    Set the last created svg element to non-transparent (= visible) only for the time interval from start to end.
    (package private) int
    row2coord(int row)
    Get the y coord of a given row number (from 1 to 8).
    void
    Construct the graphics for the display of a complete grid of pads.
    (package private) void
    tie(Graphics2D gr, int column, int row)
    Generate an "arriving" tie symbol.
    (package private) boolean
     
    (package private) Vox[]
     
    void
    Service Access Point: Write to a sequence of distinct files which contain the graphics for different time points as static SVG.
    (package private) void
    Generate the graphic representation of one particular event from the score.
    void
    Service Access Point: Write to one single file which contains the animated SVG stepping through the time points.
    void
    xCircle(Graphics2D gr, boolean attack, int column, int row)
    Generate the svg code for a diamond symbol for a key press.
    void
    xDiamond(Graphics2D gr, boolean attack, int column, int row)
    Generate the svg code for a diamond symbol for a key press.
    void
    xSquare(Graphics2D gr, boolean attack, int column, int row)
    Generate the svg code for a diamond symbol for a key press.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • score

      public final Tabstaff score
      The score data which will be rendered.
    • msg

      Target of all messages.
    • maxRow

      public final int maxRow
      Highest index for rows.
    • maxCol

      public final int maxCol
      Highest index for columns.
    • secondsPerWhole

      int secondsPerWhole
      Configuration parameters: Duration of one 1/1 note in seconds. Determins the tempo of the animated rendering.
    • linewidthSlim

      int linewidthSlim
      Configuration parameter: border of squares representing keys which are not root.
    • linewidthFat

      int linewidthFat
      Configuration parameter: border of squares representing keys which are root.
    • sizeX

      int sizeX
      Configuration parameter: width of the squares which represent the keys.
    • distX

      int distX
      Configuration parameter: offset between two adjacent squares which represent the keys.
    • sizeY

      int sizeY
      Configuration parameter: height of the squares which represent the keys.
    • distY

      int distY
      Configuration parameter: offset between two adjacent squares which represent the keys.
    • roundX

      int roundX
      Configuration parameter: Radius of the rounded corner.
    • roundY

      int roundY
      Configuration parameter: Radius of the rounded corner.
    • offsetX

      int offsetX
      Configuration parameter: Offset from the left margin of the graphic area to the very first square which represents a key. (The offset from the last key to the right margin is fixed to half a button width.)
    • offsetY

      int offsetY
      Configuration parameter: Offset from the top margin of the graphic area to the very first square which represents a key. (The offset from the last key to the bottom margin is fixed to half a button height.)
    • squareSize

      int squareSize
      Configuration parameter: Size of the upright square which stands for right-hand events.
    • rotSquareSize

      int rotSquareSize
      Configuration parameter: Size of the rotated square which stands for left-hand events.
    • circleRadius

      int circleRadius
      Configuration parameter: Size of the circle which stands for events by arbitrary hands.
    • colorKeypress

      Color colorKeypress
      Configuration parameter: Color of all key-press symbols.
    • colorDiatonic

      Color colorDiatonic
      Configuration parameter: Color of all diatonic keys.
    • colorNumberOnFill

      Color colorNumberOnFill
      Configuration parameter: Color of numbers on filled keypress symbols.
    • colorNotDiatonic

      Color colorNotDiatonic
      Configuration parameter: Color of all keys between the diatonic keys.
    • svgDocument

      com.jsevy.jsvg.SVGDocument svgDocument
      Needed as global reference for adding the transparency animation.
    • start

      float start
      Global input register for adding the transparency animation.
    • end

      float end
      Global input register for adding the transparency animation.
    • runningHorizontal

      boolean runningHorizontal
    • runningFixed

      boolean runningFixed
    • runningInKey

      boolean runningInKey
    • runningScale

      ScalaNumAbstrPOcts runningScale
    • runningDistance

      Tabstaff.distance runningDistance
    • runningBasePitch

    • articulationDistance

      float articulationDistance
      Duration (in seconds) subtracted from the end of a keypress, to visually indicate key repetitions.
    • strokeSlim

      BasicStroke strokeSlim
    • strokeFat

      BasicStroke strokeFat
    • strokeFatDashed

      BasicStroke strokeFatDashed
    • boldFont

      Font boldFont
  • Constructor Details

    • ChartGraphics2

      protected ChartGraphics2(int rows, int cols, Tabstaff score, SimpleMessage.Sender<XMLDocumentIdentifier> msg)
      Basic constructor which defines fundamental input and output data. Not called by the user, but the constructors of the subclasses.
      Parameters:
      rows - number of rows = highest index of rows (because row numbers are 1-based!)
      cols - number of cols = highest index of cols (because col numbers are 1-based!)
  • Method Details

    • voiceArray

      Vox[] voiceArray()
    • initializePitchGrid

      boolean initializePitchGrid(PitchGrid pg)
    • updatePitchGrid

      boolean updatePitchGrid(PitchGrid pg, Event e)
    • writeSequenceOfSvgs

      public void writeSequenceOfSvgs(String fileStem)
      Service Access Point: Write to a sequence of distinct files which contain the graphics for different time points as static SVG. The rational value of the time point is encoded in the file name and shown above the key grid.

      (In contrast to the tabstaff paper, "hand" has been propagated explicitly when parsing, and "finger" is propagated because here the most recent event is processed anyhow.)

    • makeSequenceOfSvgs

      public List<String> makeSequenceOfSvgs()
      Service Access Point: Write to a sequence of distinct files which contain the graphics for different time points as static SVG. The rational value of the time point is encoded in the file name and shown above the key grid.

      (In contrast to the tabstaff paper, "hand" has been propagated explicitly when parsing, and "finger" is propagated because here the most recent event is processed anyhow.)

    • writeToDynamicSVG

      public void writeToDynamicSVG(File file) throws IOException
      Service Access Point: Write to one single file which contains the animated SVG stepping through the time points. The tempo is given by the configuration parameter secondsPerWhole. // FIXME param ?
      Throws:
      IOException
    • writeSvgEvent

      void writeSvgEvent(Graphics2D gr, Event e)
      Generate the graphic representation of one particular event from the score. If global var end == FLOAT.POSITIVE_INFINITY then NO ANIMATION AT ALL shall be applied.
    • putAnimation

      void putAnimation()
      Set the last created svg element to non-transparent (= visible) only for the time interval from start to end. Add no animation at all iff end == POSITIVE_INFINITY.
    • initGraphics

      void initGraphics()
      Initialize the resources needed for drawing.
    • col2coord

      int col2coord(int column)
      Get the x coord of a given column number (from 1 to 8). This coordinate is used as the left edge of the painted button.
    • row2coord

      int row2coord(int row)
      Get the y coord of a given row number (from 1 to 8). This coordinate is used as the top edge of the painted button (= numerically lower and optically higher).
    • svgFullGrid

      public void svgFullGrid(Graphics2D gr, PitchGrid pitchGrid)
      Construct the graphics for the display of a complete grid of pads.
      Parameters:
      pitchGrid - gives the roles of the pads w.r.t. the current scale.
    • diamond

      Path2D diamond(double x, double y)
    • xDiamond

      public void xDiamond(Graphics2D gr, boolean attack, int column, int row)
      Generate the svg code for a diamond symbol for a key press.
    • xSquare

      public void xSquare(Graphics2D gr, boolean attack, int column, int row)
      Generate the svg code for a diamond symbol for a key press.
    • xCircle

      public void xCircle(Graphics2D gr, boolean attack, int column, int row)
      Generate the svg code for a diamond symbol for a key press.
    • tie

      void tie(Graphics2D gr, int column, int row)
      Generate an "arriving" tie symbol. This decorates silent fingerchange events.
    • number

      public void number(Graphics2D gr, int column, int row, int finger, Color color)
      Generate the svg source for printing the finger number.