Class TablatureGraphics
java.lang.Object
eu.bandm.music.applications.tabstaff.TablatureGraphics
Generates a tablature-style graphic representation of a tabstaff
score.
Each instance is a one-shot device: construct an instance and
invoke
showInteractiveGraphic()
and writeToFile(String) (repeatedly).
The real work is done by DisplayTablature.
(Experimental state: Currently only the very first measure is
rendered, which must be in 4-4 meter, between timepoints 0/1 to 1/1.)
This code uses the SVG library JSVG by Jonathan Sevy.
It needs version jsvg_1.2_beta_2, see the
JSVG homepage.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Tabstaff.Configuration(package private) @Opt DisplayTablatureCreated when initializing the graphic conversion.(package private) Tabstaff.SubAreaFor drawing the staves use the very first clef event(package private) final SimpleMessage.Sender<XMLDocumentIdentifier> protected final MSplitterPROVIS one and only metric splitter currently in use.static final MTreeSpecPROVIS only metric currently supported.(package private) final Tabstaff(package private) MSplitter.ResultCreated when initializing the graphic conversion.(package private) MSplitter.ResultCreated when initializing the graphic conversion.All events played by the left hand, sorted by time points.All events played by the left hand, sorted by time points. -
Constructor Summary
ConstructorsConstructorDescriptionTablatureGraphics(Tabstaff score, SimpleMessage.Sender<XMLDocumentIdentifier> msg, Tabstaff.Configuration configuration) -
Method Summary
Modifier and TypeMethodDescriptionprotected static booleanmergeIsEmpty(Map<Tp, Set<Event>> map) protected voidCommon calculations for print and interactive graphics.voidGenerate a tablature graphic and show it in an interactive window.protected MSplitter.ResultsplitOneHand(Map<Tp, Set<Event>> map) Calculate the metric split result for one set of events, which contains all events in one hand in the first measure.voidMerge all left- and right-hand events into one single set each.voidwriteToFile(String filename)
-
Field Details
-
msg
-
score
-
configuration
-
sumRightHand
All events played by the left hand, sorted by time points. Since this data is needed for tablature-style notation, all events with no hands specified are put here or intosumLeftHandby default. -
sumLeftHand
All events played by the left hand, sorted by time points. Since this data is needed for tablature-style notation, all events with no hands specified are put here or intosumRightHandby default. -
displayTablature
Created when initializing the graphic conversion. Re-used for interactive graphics and file graphics. -
splitResultLeft
Created when initializing the graphic conversion. Re-used for interactive graphics and file graphics. -
splitResultRight
Created when initializing the graphic conversion. Re-used for interactive graphics and file graphics. -
initialAreaSelection
For drawing the staves use the very first clef event -
MTREE_4_4
PROVIS only metric currently supported. -
mSplitter
PROVIS one and only metric splitter currently in use.
-
-
Constructor Details
-
TablatureGraphics
TablatureGraphics(Tabstaff score, SimpleMessage.Sender<XMLDocumentIdentifier> msg, Tabstaff.Configuration configuration)
-
-
Method Details
-
prepareGraphics
protected void prepareGraphics()Common calculations for print and interactive graphics. -
sumUpHands_2
public void sumUpHands_2()Merge all left- and right-hand events into one single set each. Note with unspecified hand are treated as RIGHT hand. This will be used to generate one voice each, with multiple "note heads". Pauses are ignored, unless there are ONLY pauses at this time point. A B C % % D E % ------------------------------------------- A Da Bd CE c % -
mergeIsEmpty
-
splitOneHand
Calculate the metric split result for one set of events, which contains all events in one hand in the first measure. -
showInteractiveGraphic
public void showInteractiveGraphic()Generate a tablature graphic and show it in an interactive window. -
writeToFile
-