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) floatDuration (in seconds) subtracted from the end of a keypress, to visually indicate key repetitions.(package private) Font(package private) intConfiguration parameter: Size of the circle which stands for events by arbitrary hands.(package private) ColorConfiguration parameter: Color of all diatonic keys.(package private) ColorConfiguration parameter: Color of all key-press symbols.(package private) ColorConfiguration parameter: Color of all keys between the diatonic keys.(package private) ColorConfiguration parameter: Color of numbers on filled keypress symbols.(package private) intConfiguration parameter: offset between two adjacent squares which represent the keys.(package private) intConfiguration parameter: offset between two adjacent squares which represent the keys.(package private) floatGlobal input register for adding the transparency animation.(package private) intConfiguration parameter: border of squares representing keys which are root.(package private) intConfiguration parameter: border of squares representing keys which are not root.final intHighest index for columns.final intHighest index for rows.(package private) final SimpleMessage.Sender<XMLDocumentIdentifier> Target of all messages.(package private) intConfiguration parameter: Offset from the left margin of the graphic area to the very first square which represents a key.(package private) intConfiguration parameter: Offset from the top margin of the graphic area to the very first square which represents a key.(package private) intConfiguration parameter: Size of the rotated square which stands for left-hand events.(package private) intConfiguration parameter: Radius of the rounded corner.(package private) intConfiguration 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) ScalaNumAbstrPOctsfinal TabstaffThe score data which will be rendered.(package private) intConfiguration parameters: Duration of one 1/1 note in seconds.(package private) intConfiguration parameter: width of the squares which represent the keys.(package private) intConfiguration parameter: height of the squares which represent the keys.(package private) intConfiguration parameter: Size of the upright square which stands for right-hand events.(package private) floatGlobal input register for adding the transparency animation.(package private) BasicStroke(package private) BasicStroke(package private) BasicStroke(package private) com.jsevy.jsvg.SVGDocumentNeeded as global reference for adding the transparency animation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedChartGraphics2(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) intcol2coord(int column) Get the x coord of a given column number (from 1 to 8).(package private) Path2Ddiamond(double x, double y) (package private) voidInitialize the resources needed for drawing.(package private) booleanService Access Point: Write to a sequence of distinct files which contain the graphics for different time points as static SVG.voidnumber(Graphics2D gr, int column, int row, int finger, Color color) Generate the svg source for printing the finger number.(package private) void(package private) introw2coord(int row) Get the y coord of a given row number (from 1 to 8).voidsvgFullGrid(Graphics2D gr, PitchGrid pitchGrid) Construct the graphics for the display of a complete grid of pads.(package private) voidtie(Graphics2D gr, int column, int row) Generate an "arriving" tie symbol.(package private) booleanupdatePitchGrid(PitchGrid pg, Event e) (package private) Vox[]voidwriteSequenceOfSvgs(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) voidwriteSvgEvent(Graphics2D gr, Event e) Generate the graphic representation of one particular event from the score.voidwriteToDynamicSVG(File file) Service Access Point: Write to one single file which contains the animated SVG stepping through the time points.voidxCircle(Graphics2D gr, boolean attack, int column, int row) Generate the svg code for a diamond symbol for a key press.voidxDiamond(Graphics2D gr, boolean attack, int column, int row) Generate the svg code for a diamond symbol for a key press.voidxSquare(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.
-