Class ChartGraphics2
java.lang.Object
eu.bandm.music.applications.tabstaff.ChartGraphics2
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
or
{{a=b;}}
, (3) call
invalid reference
#makeeSequenceOfSvgs()
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
FieldsModifier and TypeFieldDescription(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.(package private) final SimpleMessage.Sender
<XMLDocumentIdentifier> 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) PitchAndOctave
<OctaveRegister, FunctionalPitchModOctave> (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
ConstructorsModifierConstructorDescriptionprotected
ChartGraphics2
(int rows, int cols, Tabstaff score, SimpleMessage.Sender<XMLDocumentIdentifier> msg) Basic constructor which defines fundamental input and output data. -
Method Summary
Modifier and TypeMethodDescription(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
(package private) int
row2coord
(int row) Get the y coord of a given row number (from 1 to 8).void
svgFullGrid
(Graphics2D gr, PitchGrid pitchGrid) 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
updatePitchGrid
(PitchGrid pg, Event e) (package private) Vox[]
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.(package private) void
writeSvgEvent
(Graphics2D gr, Event e) Generate the graphic representation of one particular event from the score.void
writeToDynamicSVG
(File file) 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.
-
Field Details
-
score
The score data which will be rendered. -
msg
Target of all messages. -
maxRow
public final int maxRowHighest index for rows. -
maxCol
public final int maxColHighest index for columns. -
secondsPerWhole
int secondsPerWholeConfiguration parameters: Duration of one 1/1 note in seconds. Determins the tempo of the animated rendering. -
linewidthSlim
int linewidthSlimConfiguration parameter: border of squares representing keys which are not root. -
linewidthFat
int linewidthFatConfiguration parameter: border of squares representing keys which are root. -
sizeX
int sizeXConfiguration parameter: width of the squares which represent the keys. -
distX
int distXConfiguration parameter: offset between two adjacent squares which represent the keys. -
sizeY
int sizeYConfiguration parameter: height of the squares which represent the keys. -
distY
int distYConfiguration parameter: offset between two adjacent squares which represent the keys. -
roundX
int roundXConfiguration parameter: Radius of the rounded corner. -
roundY
int roundYConfiguration parameter: Radius of the rounded corner. -
offsetX
int offsetXConfiguration 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 offsetYConfiguration 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 squareSizeConfiguration parameter: Size of the upright square which stands for right-hand events. -
rotSquareSize
int rotSquareSizeConfiguration parameter: Size of the rotated square which stands for left-hand events. -
circleRadius
int circleRadiusConfiguration parameter: Size of the circle which stands for events by arbitrary hands. -
colorKeypress
Color colorKeypressConfiguration parameter: Color of all key-press symbols. -
colorDiatonic
Color colorDiatonicConfiguration parameter: Color of all diatonic keys. -
colorNumberOnFill
Color colorNumberOnFillConfiguration parameter: Color of numbers on filled keypress symbols. -
colorNotDiatonic
Color colorNotDiatonicConfiguration parameter: Color of all keys between the diatonic keys. -
svgDocument
com.jsevy.jsvg.SVGDocument svgDocumentNeeded as global reference for adding the transparency animation. -
start
float startGlobal input register for adding the transparency animation. -
end
float endGlobal input register for adding the transparency animation. -
runningHorizontal
boolean runningHorizontal -
runningFixed
boolean runningFixed -
runningInKey
boolean runningInKey -
runningScale
ScalaNumAbstrPOcts runningScale -
runningDistance
Tabstaff.distance runningDistance -
runningBasePitch
PitchAndOctave<OctaveRegister,FunctionalPitchModOctave> runningBasePitch -
articulationDistance
float articulationDistanceDuration (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
-
updatePitchGrid
-
writeSequenceOfSvgs
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
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
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 parametersecondsPerWhole
. // FIXME param ?- Throws:
IOException
-
writeSvgEvent
Generate the graphic representation of one particular event from the score. If global varend
== FLOAT.POSITIVE_INFINITY then NO ANIMATION AT ALL shall be applied. -
putAnimation
void putAnimation() -
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
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
-
xDiamond
Generate the svg code for a diamond symbol for a key press. -
xSquare
Generate the svg code for a diamond symbol for a key press. -
xCircle
Generate the svg code for a diamond symbol for a key press. -
tie
Generate an "arriving" tie symbol. This decorates silent fingerchange events. -
number
Generate the svg source for printing the finger number.
-