Package com.softsynth.jmsl.score
Class Score
java.lang.Object
com.softsynth.jmsl.score.Score
- All Implemented Interfaces:
XMLCreatable
,XMLWritable
public class Score extends java.lang.Object implements XMLWritable, XMLCreatable
Score has a handle to a ScoreCollection.
ScoreCollection is a SequentialCollection of Measure.
Measure is a ParallelCollection of Staff.
Staff is a Parallel Collection of Track.
Track is a MusicList of Note
Note implements InstrumentPlayable, and contains musical data as well as graphic info.
JMSL Notation Project
ScoreCollection is a SequentialCollection of Measure.
Measure is a ParallelCollection of Staff.
Staff is a Parallel Collection of Track.
Track is a MusicList of Note
Note implements InstrumentPlayable, and contains musical data as well as graphic info.
JMSL Notation Project
- Author:
- Nick Didkovsky , copyright 2000 Nick Didkovsky
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Score()
no arg constructor used by XMLCreatableScore(int numStaves)
Specify number of staves.Score(int numStaves, int systemsPerPage)
Specify number of staves.Score(int numStaves, int layoutWidth, int layoutHeight)
Score(int numStaves, int layoutWidth, int layoutHeight, java.lang.String name)
Score(int numStaves, int layoutWidth, int layoutHeight, java.lang.String name, boolean renderAllowed)
This constructor offers the option of delaying the call to ownCanvas() when the Score builds itself.Score(int numStaves, int layoutWidth, int layoutHeight, java.lang.String name, ScoreCanvas scoreCanvas)
Score(int numStaves, int layoutWidth, int layoutHeight, java.lang.String name, ScoreCanvas scoreCanvas, boolean enableUndoStack)
Score(int numStaves, int systemsPerPage, java.lang.String title)
Specify number of staves.Score(int numStaves, java.lang.String title)
Specify number of staves and title. -
Method Summary
Modifier and Type Method Description void
addDirtyListener(DirtyListener listener)
Add a listener to be notified when this score has been editedNote
addInterval(DimensionNameSpace dimensionNameSpace, double[] dar)
Add an interval to the last added note, specifying dimension name space and data[].Measure
addMeasure()
Measure
addMeasure(int tsNumer, int tsDenom)
java.util.Vector
addMeasures(int numMeasures)
java.util.Vector
addMeasures(int numMeasures, int tsNumer, int tsDenom)
add numMeasures of indicated timesignaturevoid
addMusicGlyphRenderer(MusicGlyphRenderer mgr)
Add your glyph renderers in the priority you want them to be asked to draw glyphs.Note
addNote(double[] dar)
Expects length >= 4, where dar[0] is dur ( qtr = 1.0), dar[1] is pitch (1..127), dar[2] is amp (0..1), dar[3] is hold Rounds data[0] to nearest recognized duration.Note
addNote(double dur, double midipitch, double vel, double hold)
Note
addNote(DimensionNameSpace dimensionNameSpace, double[] dar)
Expects length >= 4, where dar[0] is dur ( qtr = 1.0), dar[1] is pitch (1..127), dar[2] is amp (0..1), dar[3] is hold Rounds data[0] to nearest recognized duration.Note
addNote(Note note)
Note
addNote(Note n, int measureNum, int staffNum, int trackNum)
void
addNumTracksPerStaffChangedListener(NumTracksPerStaffChangedListener listener)
objects interested in being notified when the number of tracks per staff has been changed (like the ScoreEditPanel) should implement NumTracksPerStaffChangedListener and register itself with the score using this methodvoid
addScoreLayoutListener(ScoreLayoutListener listener)
void
addUserBean(java.lang.Object bean)
Add a bean to a Score.void
build(int numStaves, int layoutWidth, int layoutHeight, java.lang.String name)
void
clearMixer()
removes all instruments from Orchestra's Mixervoid
copy(CopyBuffer buf)
Copy selected notes into specified copy bufferjava.lang.Object
create()
XMLCreatable Interfacestatic void
deleteCanvas()
Set static canvas to null to force new upon next build()void
deleteStaff(int position)
void
deselectAll()
Deselect all notes in scorestatic boolean
doStopWithHalt()
AccidentalLevelManager
getAccidentalLevelManager()
used to hide/show/change accidentals of notes on a Trackdouble
getBottomMargin()
boolean
getClefsVisible()
java.lang.String
getComposer()
ScoreControlPanel
getControlPanel()
java.lang.String
getCopyright()
int
getCurrentMeasureNumber()
ScoreSection
getCurrentScoreSection()
int
getCurrentStaffNumber()
int
getCurrentTrackNumber()
boolean
getDirty()
boolean
getDrawAllMeasureNumbers()
EditManager
getEditManager()
int
getFirstStaffToRender()
double
getFirstSystemIndent()
java.lang.String
getHierarchy()
boolean
getInstrumentNamesVisible()
boolean
getKeySignaturesVisible()
Note
getLastAddedNote()
int
getLayoutHeight()
int
getLayoutWidth()
double
getLeftMargin()
Measure
getMeasure(int n)
java.lang.String
getMeasureNumberFontName()
double
getMeasureNumberFontScaler()
int
getMeasureNumberOffset()
measure number offset is a number added to measure indexes (which are zero based), for displaying measure numbers in score.boolean
getMeasureNumbersVisible()
MusicCurveRenderer
getMusicCurveRenderer()
MusicCurveRenderer is an aux class which can be used to draw staff lines, ties, slurs, cresc/decresc If null, JMSL will use line drawing.java.util.Vector
getMusicGlyphRenderers()
java.lang.String
getName()
int
getNumStaffs()
Deprecated.use getNumStaves()int
getNumStaves()
int
getNumTracksPerStaff()
Orchestra
getOrchestra()
PlayLurkerPatchManager
getPlayLurkerPatchManager()
static double
getRenderDelay()
double
getRightMargin()
ScoreAnnotation
getScoreAnnotation()
ScoreCanvas
getScoreCanvas()
ScoreCollection
getScoreCollection()
ScoreEditPanel
getScoreEditPanel()
ScoreLayoutManager
getScoreLayoutManager()
ScorePainter
getScorePainter()
ScoreSection[]
getScoreSections()
java.lang.String
getScoreSubtitle()
same as getSubtitle()java.lang.String
getScoreSubtitleFontName()
double
getScoreSubtitleFontScaler()
java.lang.String
getScoreTitleFontName()
double
getScoreTitleFontScaler()
boolean
getSectionBracketsVisible()
Measure
getSelectedMeasure()
useful for mouse editingStaff
getSelectedStaff()
useful for mouse editingSelectionBuffer
getSelectionBuffer()
StaffAndLedgerLineVisibilityManager
getStaffAndLedgerLineVisibilityManager()
boolean
getStaffNumbersVisible()
StaffSpacing
getStaffSpacing(int s)
java.lang.String
getSubtitle()
boolean
getTempoVisible()
java.lang.String
getTextFontName()
double
getTextFontScaler()
TieManager
getTieManager(int s, int t)
java.lang.String
getTimesigFontName()
double
getTimesigFontScaler()
boolean
getTimeSignaturesVisible()
boolean
getTitleVisible()
double
getTopMargin()
double
getTopMarginOfFirstPage()
boolean
getTurnPages()
UndoStack
getUndoStack()
int
getUndoStackMemoryThresholdMB()
java.util.Vector
getUserBeans()
double
getWorkingTopMargin(boolean isFirstPage)
void
handleAttribute(java.lang.String name, java.lang.String value)
XMLCreatable Interfacestatic java.lang.String
indent()
void
insertMeasure(int measureNumber)
Insert a new empty measure before measureNumber.Measure
insertMeasure(Measure measure)
Insert a new empty measure before indicated Measurevoid
insertStaff(int position)
boolean
isDrawCourtesyClefs()
boolean
isHighlightSelectedStaff()
boolean
isLedgerLineVisible(int staffIndex)
boolean
isRenderAllowed()
boolean
isStaffLineVisible(int staffIndex, int lineIndex)
boolean
isUndoStackEnabled()
boolean
isUseLegacyMultiTrackOrientation()
Legacy orientation for multitrack scores with N tracks, puts all notes in tracks 0..N/2 in the 'bottom' stem down and all notes on track N/2..N in the 'top' stem up.boolean
isWindowsAndBravura()
This method is needed to adjust stem placement on Windows when using Bravura music fontvoid
killAllNotes()
Enumerate through all Notes in a Score and call ins.off(JMSL.realTime(), 1.0, note.getPerformanceData()); on eachstatic Score
load(java.lang.String filename)
Load a Score from an XML file.static Score
load(java.lang.String filename, boolean renderAllowedAfterLoading)
Load a Score from an XML file.static void
main(java.lang.String[] args)
void
notifyAddMeasure()
void
notifyDeleteMeasure()
void
notifySectionSelectChange(int n)
change section for playbackvoid
openEditScoreDialog(java.awt.Frame f)
static void
openNewScoreDialog(java.awt.Frame f, NewScoreListener listener)
void
ownCanvas()
void
paste()
paste from copy buffer to current locationvoid
pasteFreeFlow()
free flow paste from copy buffer to current locationvoid
pasteWithMeasureInfo()
paste from copy buffer to current location, preserve measure info like repeats, time sig, etcvoid
patchLurkers()
Run through Vector of Patches in playLurkerPatchManager.void
rebuildSectionNames()
void
removeAllPlayLurkers()
remove all playLurkers from all tracks of all staves of all measuresvoid
removeAllUserBeans()
void
removeDirtyListener(DirtyListener listener)
void
removeNumTracksPerStaffChangedListener(NumTracksPerStaffChangedListener listener)
objects no longer interested in being notified when the number of tracks per staff has been changed (like the ScoreEditPanel) should remove itself from the score's listeners using this methodvoid
removeScoreLayoutListener(ScoreLayoutListener listener)
void
removeUserBean(java.lang.Object bean)
int
render()
int
render(int startingMeasure)
int
render(int startingMeasure, double playTime, boolean scheduled)
void
rewind()
Set current insertion measure to 0, used by addNote().void
save(java.lang.String filename)
Save as XML or as ZIP depending on suffixvoid
saveToUndoStack()
void
saveToUndoStack(java.lang.String msg)
void
selectAll()
Select all notes in scorestatic void
setAntiAliasingHints(boolean flag)
Flag to determine whether Score graphics use antialiasing hints or notvoid
setBottomMargin(double bottomMargin)
void
setClefsVisible(boolean b)
void
setComposer(java.lang.String scoreComposer)
void
setCopyright(java.lang.String scoreCopyright)
void
setCurrentMeasureNumber(int m)
set measure number for adding/editingvoid
setCurrentStaffNumber(int s)
set staff number for adding/editingvoid
setCurrentTrackNumber(int t)
set track number for adding/editingvoid
setDirty(boolean f)
void
setDirty(boolean f, java.lang.String msg)
set T/F if score has been edited or otherwise changedstatic void
setDoStopWithHalt(boolean flag)
void
setDrawAllMeasureNumbers(boolean drawAllMeasureNumbers)
void
setDrawCourtesyClefs(boolean drawCourtesyClefs)
void
setFirstStaffToRender(int n)
void
setFirstSystemIndent(double firstSystemIndent)
void
setHighlightSelectedStaff(boolean highlightSelectedStaff)
void
setInstrumentNamesVisible(boolean b)
void
setInstruments()
Run through every staff and assign ins# from Orchestra to itvoid
setKeySignaturesVisible(boolean b)
void
setLayoutHeight(int layoutHeight)
Set the canvas height.void
setLayoutWidth(int layoutWidth)
Set the canvas width.void
setLedgerLinesVisible(int staffIndex, boolean visible)
void
setLeftMargin(double leftMargin)
void
setMeasureBar(int measureNumber)
void
setMeasureNumberFontName(java.lang.String measureNumberFontName)
void
setMeasureNumberFontScaler(double scaler)
default is 1.5 This scaler is multiplied by the distance between adjacent staff lines to create the size of the font for measure numbering .void
setMeasureNumberOffset(int measureNumberOffset)
void
setMeasureNumbersVisible(boolean showMeasureNumbers)
void
setMusicCurveRenderer(MusicCurveRenderer musicCurveRenderer)
MusicCurveRenderer is an aux class which can be used to draw staff lines, ties, slurs, cresc/decresc If null, JMSL will use line drawing.void
setName(java.lang.String name)
void
setNoteFlash(boolean flash)
void
setNumTracksPerStaff(int numTracksPerStaff)
Set the number of Tracks each new Staff will create in its constructor.void
setOrchestra(Orchestra orch)
void
setRenderAllowed(boolean renderAllowed)
static void
setRenderDelay(double d)
Set how far in the future a render() is scheduled.void
setRightMargin(double rightMargin)
void
setScoreAnnotation(ScoreAnnotation scoreAnnotation)
void
setScoreCanvas(ScoreCanvas scoreCanvas)
void
setScorePainter(ScorePainter sp)
void
setScoreSection(int sectionIndex, java.lang.String sectionName, int start, int end)
Set the name and the start/end measures (zero based) of section whose index is sectionIndex.void
setScoreSubtitle(java.lang.String scoreSubtitle)
void
setScoreSubtitleFontName(java.lang.String scoreSubtitleFontName)
void
setScoreSubtitleFontScaler(double scoreSubtitleFontScaler)
void
setScoreTitleFontName(java.lang.String scoreTitleFontName)
void
setScoreTitleFontScaler(double scoreTitleFontScaler)
void
setSectionBracketsVisible(boolean showSectionBrackets)
void
setSectionEnd(int n)
void
setSectionStart(int n)
void
setSelectedMeasure(Measure m)
useful for mouse editingvoid
setSelectedStaff(Staff s)
useful for mouse editingvoid
setStaffLineVisible(int staffIndex, int lineIndex, boolean visible)
void
setStaffNumbersVisible(boolean showStaffNumbers)
void
setStaffSpacing(int index, StaffSpacing ss)
replace StaffSpacing at indexvoid
setSystemWrap(boolean flag)
When true, will layout as many systems vertically as there is space.void
setTempoVisible(boolean b)
void
setTextFontName(java.lang.String textFontName)
void
setTextFontScaler(double textFontScaler)
void
setTimesigFontName(java.lang.String timesigFontName)
void
setTimesigFontScaler(double timesigFontScaler)
void
setTimeSignaturesVisible(boolean b)
void
setTitleVisible(boolean b)
void
setTopMargin(double topMargin)
void
setTopMarginOfFirstPage(double topMarginOfFirstPage)
void
setTurnPages(boolean f)
void
setUndoStackEnabled(boolean isUndoStackEnabled)
void
setUndoStackMemoryThresholdMB(int undoStackMemoryThresholdMB)
static void
setupAntiAliasedGraphics(java.awt.Graphics2D g)
void
setUseLegacyMultiTrackOrientation(boolean useLegacyMultiTrackOrientation)
int
size()
java.lang.String
toString()
static boolean
useAntiAliasingHints()
Flag to determine whether Score graphics use antialiasing hints or notstatic void
useSharedCanvas(boolean f)
If true, all scores render to the same static canvas.boolean
usingMusicGlyphRenderer()
void
writeXML(java.io.PrintWriter out)
void
writeXMLOrchestra(java.io.PrintWriter out)
void
writeXMLPatchLurkers(java.io.PrintWriter out)
static void
writeXMLPreamble(java.io.PrintWriter out)
void
writeXMLScoreAnnotation(java.io.PrintWriter out)
void
writeXMLScoreAttributes(java.io.PrintWriter out)
void
writeXMLScoreSections(java.io.PrintWriter out)
void
writeXMLScoreTagEnd(java.io.PrintWriter out)
void
writeXMLScoreUserBeans(java.io.PrintWriter out)
void
writeXMLStaffLineVisibility(java.io.PrintWriter out)
void
writeXMLStaffSpacing(java.io.PrintWriter out)
static void
writeXMLWrapup(java.io.PrintWriter out)
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
JMSL_SCORE_BUILD
public static final int JMSL_SCORE_BUILD- See Also:
- Constant Field Values
-
LITE
public static final boolean LITE- See Also:
- Constant Field Values
-
JSYN_INSTRUMENT
public static final int JSYN_INSTRUMENT- See Also:
- Constant Field Values
-
MIDI_INSTRUMENT
public static final int MIDI_INSTRUMENT- See Also:
- Constant Field Values
-
QUIET_INSTRUMENT
public static final int QUIET_INSTRUMENT- See Also:
- Constant Field Values
-
JSYN_ORCHESTRA
public static final int JSYN_ORCHESTRA- See Also:
- Constant Field Values
-
MIDI_ORCHESTRA
public static final int MIDI_ORCHESTRA- See Also:
- Constant Field Values
-
JSYN_MIDI_ORCHESTRA
public static final int JSYN_MIDI_ORCHESTRA- See Also:
- Constant Field Values
-
printIndent
public static int printIndent -
copyBuffer
-
auxCopyBuffer1
-
auxCopyBuffer2
-
DEFAULT_LEFT_MARGIN
public static final double DEFAULT_LEFT_MARGIN- See Also:
- Constant Field Values
-
DEFAULT_RIGHT_MARGIN
public static final double DEFAULT_RIGHT_MARGIN- See Also:
- Constant Field Values
-
DEFAULT_TOP_MARGIN
public static final double DEFAULT_TOP_MARGIN- See Also:
- Constant Field Values
-
DEFAULT_TOP_MARGIN_OF_FIRST_PAGE
public static final double DEFAULT_TOP_MARGIN_OF_FIRST_PAGE- See Also:
- Constant Field Values
-
DEFAULT_BOTTOM_MARGIN
public static final double DEFAULT_BOTTOM_MARGIN- See Also:
- Constant Field Values
-
DEFAULT_FIRST_SYSTEM_INDENT
public static final double DEFAULT_FIRST_SYSTEM_INDENT- See Also:
- Constant Field Values
-
MAX_LITE_MEASURES
public static final int MAX_LITE_MEASURES- See Also:
- Constant Field Values
-
DEFAULT_TEXT_FONT_SCALER
public static final double DEFAULT_TEXT_FONT_SCALER- See Also:
- Constant Field Values
-
DEFAULT_SCORE_SUBTITLE_FONT_SCALER
public static final double DEFAULT_SCORE_SUBTITLE_FONT_SCALER- See Also:
- Constant Field Values
-
DEFAULT_SCORE_TITLE_FONT_SCALER
public static final double DEFAULT_SCORE_TITLE_FONT_SCALER- See Also:
- Constant Field Values
-
DEFAULT_TIMESIG_FONT_SCALER
public static final double DEFAULT_TIMESIG_FONT_SCALER- See Also:
- Constant Field Values
-
DEFAULT_MEASURE_NUMBER_FONT_SCALER
public static final double DEFAULT_MEASURE_NUMBER_FONT_SCALER- See Also:
- Constant Field Values
-
DEFAULT_TEXT_FONT_NAME
public static final java.lang.String DEFAULT_TEXT_FONT_NAME- See Also:
- Constant Field Values
-
DEFAULT_SCORE_TITLE_FONT_NAME
public static final java.lang.String DEFAULT_SCORE_TITLE_FONT_NAME- See Also:
- Constant Field Values
-
DEFAULT_SCORE_SUBTITLE_FONT_NAME
public static final java.lang.String DEFAULT_SCORE_SUBTITLE_FONT_NAME- See Also:
- Constant Field Values
-
DEFAULT_TIMESIG_FONT_NAME
public static final java.lang.String DEFAULT_TIMESIG_FONT_NAME- See Also:
- Constant Field Values
-
DEFAULT_MEASURE_NUMBER_FONT_NAME
public static final java.lang.String DEFAULT_MEASURE_NUMBER_FONT_NAME- See Also:
- Constant Field Values
-
UNDO_DEBUG
public boolean UNDO_DEBUG -
MB
public static final int MB- See Also:
- Constant Field Values
-
COPYRIGHT
public static final java.lang.String COPYRIGHT- See Also:
- Constant Field Values
-
-
Constructor Details
-
Score
public Score()no arg constructor used by XMLCreatable -
Score
public Score(int numStaves, int layoutWidth, int layoutHeight, java.lang.String name) -
Score
public Score(int numStaves, int layoutWidth, int layoutHeight, java.lang.String name, boolean renderAllowed)This constructor offers the option of delaying the call to ownCanvas() when the Score builds itself. That way you can create a Score "off screen" without it getting hold of the common rendering context when Score is using a shared canvas- Parameters:
numStaves
-layoutWidth
-layoutHeight
-name
-permitOwnCanvasInBuild
-
-
Score
public Score(int numStaves, int layoutWidth, int layoutHeight, java.lang.String name, ScoreCanvas scoreCanvas) -
Score
public Score(int numStaves, int layoutWidth, int layoutHeight, java.lang.String name, ScoreCanvas scoreCanvas, boolean enableUndoStack) -
Score
public Score(int numStaves, int layoutWidth, int layoutHeight) -
Score
public Score(int numStaves, java.lang.String title)Specify number of staves and title. Score dimensions are calculated as: width = 80% of your display's width, height = the number of staves multiplied by (Staff.DEFAULT_STAFF_SPACE_ABOVE + Staff.DEFAULT_STAFF_SPACE_BELOW + Staff.getStaffHeight()) -
Score
public Score(int numStaves)Specify number of staves. Score dimensions are calculated as: width = 80% of your display's width, height = the number of staves multiplied by (Staff.DEFAULT_STAFF_SPACE_ABOVE + Staff.DEFAULT_STAFF_SPACE_BELOW + Staff.getStaffHeight()) -
Score
public Score(int numStaves, int systemsPerPage, java.lang.String title)Specify number of staves. Calculate page height so it can display specified number of systems per page -
Score
public Score(int numStaves, int systemsPerPage)Specify number of staves. Calculate page height so it can display specified number of systems per page
-
-
Method Details
-
handleAttribute
public void handleAttribute(java.lang.String name, java.lang.String value)XMLCreatable Interface- Specified by:
handleAttribute
in interfaceXMLCreatable
-
create
public java.lang.Object create()XMLCreatable Interface- Specified by:
create
in interfaceXMLCreatable
-
setScoreCanvas
-
getMusicCurveRenderer
MusicCurveRenderer is an aux class which can be used to draw staff lines, ties, slurs, cresc/decresc If null, JMSL will use line drawing.- Returns:
- Returns the musicCurveRenderer, may be null.
-
setMusicCurveRenderer
MusicCurveRenderer is an aux class which can be used to draw staff lines, ties, slurs, cresc/decresc If null, JMSL will use line drawing.- Parameters:
musicCurveRenderer
- The musicCurveRenderer to set.
-
addMusicGlyphRenderer
Add your glyph renderers in the priority you want them to be asked to draw glyphs. For example if you have an accidentals font and a general music font and you like the accidentals rendered by the former, add the former first. If it successfully renders a glyph then the next renderer will not be asked to render it.- Parameters:
mgr
-
-
getMusicGlyphRenderers
public java.util.Vector getMusicGlyphRenderers() -
isWindowsAndBravura
public boolean isWindowsAndBravura()This method is needed to adjust stem placement on Windows when using Bravura music font -
isUseLegacyMultiTrackOrientation
public boolean isUseLegacyMultiTrackOrientation()Legacy orientation for multitrack scores with N tracks, puts all notes in tracks 0..N/2 in the 'bottom' stem down and all notes on track N/2..N in the 'top' stem up. Non-legacy orientaion as of 2020-09-15 means even numbered tracks are in the bottom, stem down and odd numbered track are in the top stem up. That way track 1 is always 'top', stem up, whether the score has 2 or 4 or more tracks.- Returns:
- the useLegacyMultiTrackOrientation
-
setUseLegacyMultiTrackOrientation
public void setUseLegacyMultiTrackOrientation(boolean useLegacyMultiTrackOrientation)- Parameters:
useLegacyMultiTrackOrientation
- the useLegacyMultiTrackOrientation to set
-
usingMusicGlyphRenderer
public boolean usingMusicGlyphRenderer() -
getSelectionBuffer
- Returns:
- SelectionBuffer containing selected notes
-
setInstrumentNamesVisible
public void setInstrumentNamesVisible(boolean b) -
getInstrumentNamesVisible
public boolean getInstrumentNamesVisible() -
setTempoVisible
public void setTempoVisible(boolean b) -
getTempoVisible
public boolean getTempoVisible() -
setKeySignaturesVisible
public void setKeySignaturesVisible(boolean b) -
getKeySignaturesVisible
public boolean getKeySignaturesVisible() -
setTimeSignaturesVisible
public void setTimeSignaturesVisible(boolean b) -
getTimeSignaturesVisible
public boolean getTimeSignaturesVisible() -
setClefsVisible
public void setClefsVisible(boolean b) -
getClefsVisible
public boolean getClefsVisible() -
setTitleVisible
public void setTitleVisible(boolean b) -
getTitleVisible
public boolean getTitleVisible() -
getStaffNumbersVisible
public boolean getStaffNumbersVisible()- Returns:
- Returns flag to render staff numbers or not
-
setStaffNumbersVisible
public void setStaffNumbersVisible(boolean showStaffNumbers)- Parameters:
flag
- to render staff numbers or not
-
getMeasureNumbersVisible
public boolean getMeasureNumbersVisible()- Returns:
- Returns flag to render measure numbers or not
-
getFirstSystemIndent
public double getFirstSystemIndent()- Returns:
- the firstSystemIndent
-
setFirstSystemIndent
public void setFirstSystemIndent(double firstSystemIndent)- Parameters:
firstSystemIndent
- the firstSystemIndent to set
-
setMeasureNumbersVisible
public void setMeasureNumbersVisible(boolean showMeasureNumbers)- Parameters:
flag
- to render measure numbers or not
-
getSectionBracketsVisible
public boolean getSectionBracketsVisible()- Returns:
- Returns flag to render section brackets numbers or not
-
setSectionBracketsVisible
public void setSectionBracketsVisible(boolean showSectionBrackets)- Parameters:
flag
- to render section brackets or not
-
deleteCanvas
public static void deleteCanvas()Set static canvas to null to force new upon next build() -
ownCanvas
public void ownCanvas() -
selectAll
public void selectAll()Select all notes in score -
deselectAll
public void deselectAll()Deselect all notes in score -
paste
public void paste()paste from copy buffer to current location -
pasteWithMeasureInfo
public void pasteWithMeasureInfo()paste from copy buffer to current location, preserve measure info like repeats, time sig, etc -
pasteFreeFlow
public void pasteFreeFlow()free flow paste from copy buffer to current location -
copy
Copy selected notes into specified copy buffer -
load
Load a Score from an XML file. Prints messages to console. This is a convenience method which simply uses ScoreXMLLoader- Returns:
- new Score
- Throws:
java.io.IOException
-
load
public static Score load(java.lang.String filename, boolean renderAllowedAfterLoading) throws java.io.IOExceptionLoad a Score from an XML file. Prints messages to console if JMSL.verbosity == JMSL.VERBOSE. This is a convenience method which simply uses ScoreXMLLoader If you do not want the Score to gain rendering ownership of the shared canvas or respond to render() messages after loading, make the second arg false, and call ownCanvas(true) and setRenderAllowed(true) by hand later- Returns:
- new Score
- Throws:
java.io.IOException
-
setLayoutWidth
public void setLayoutWidth(int layoutWidth)Set the canvas width. Call myScore.ownCanvas() after changing width and height to resize -
setLayoutHeight
public void setLayoutHeight(int layoutHeight)Set the canvas height. Call myScore.ownCanvas() after changing width and height to resize -
getLayoutWidth
public int getLayoutWidth() -
getLayoutHeight
public int getLayoutHeight() -
build
public void build(int numStaves, int layoutWidth, int layoutHeight, java.lang.String name) -
addNumTracksPerStaffChangedListener
objects interested in being notified when the number of tracks per staff has been changed (like the ScoreEditPanel) should implement NumTracksPerStaffChangedListener and register itself with the score using this method- Parameters:
listener
-
-
removeNumTracksPerStaffChangedListener
objects no longer interested in being notified when the number of tracks per staff has been changed (like the ScoreEditPanel) should remove itself from the score's listeners using this method- Parameters:
listener
-
-
rebuildSectionNames
public void rebuildSectionNames() -
setOrchestra
-
getOrchestra
-
setInstruments
public void setInstruments()Run through every staff and assign ins# from Orchestra to it -
getPlayLurkerPatchManager
-
isDrawCourtesyClefs
public boolean isDrawCourtesyClefs() -
setDrawCourtesyClefs
public void setDrawCourtesyClefs(boolean drawCourtesyClefs) -
getMeasureNumberOffset
public int getMeasureNumberOffset()measure number offset is a number added to measure indexes (which are zero based), for displaying measure numbers in score. Graphical only, no method calls refer to this (ie first measure is always measure 0 even if offset is non-zero- Returns:
- Returns the measureNumberOffset.
-
setMeasureNumberOffset
public void setMeasureNumberOffset(int measureNumberOffset)- Parameters:
measureNumberOffset
- The measureNumberOffset to set.
-
setTurnPages
public void setTurnPages(boolean f) -
getTurnPages
public boolean getTurnPages() -
addDirtyListener
Add a listener to be notified when this score has been edited -
removeDirtyListener
-
setDirty
public void setDirty(boolean f) -
setDirty
public void setDirty(boolean f, java.lang.String msg)set T/F if score has been edited or otherwise changed -
getDirty
public boolean getDirty()- Returns:
- T/F if score has been edited or otherwise changed
-
setNoteFlash
public void setNoteFlash(boolean flash) -
patchLurkers
public void patchLurkers()Run through Vector of Patches in playLurkerPatchManager. Each Patch stores a staff index and an instrument index. For each track of each staff of each measure, add the playlurking instrument. Call removeAllPlayLurkers() first if lurkers need to be removed -
removeAllPlayLurkers
public void removeAllPlayLurkers()remove all playLurkers from all tracks of all staves of all measures -
notifySectionSelectChange
public void notifySectionSelectChange(int n)change section for playback -
setScoreSection
public void setScoreSection(int sectionIndex, java.lang.String sectionName, int start, int end)Set the name and the start/end measures (zero based) of section whose index is sectionIndex. There are 26 user definable sections -
getCurrentScoreSection
-
setSectionStart
public void setSectionStart(int n) -
getScoreSections
-
setSectionEnd
public void setSectionEnd(int n) -
setMeasureBar
public void setMeasureBar(int measureNumber) -
getNumStaffs
public int getNumStaffs()Deprecated.use getNumStaves() -
getNumStaves
public int getNumStaves()- Returns:
- the number of staves in this Score
-
setFirstStaffToRender
public void setFirstStaffToRender(int n) -
getFirstStaffToRender
public int getFirstStaffToRender() -
isLedgerLineVisible
public boolean isLedgerLineVisible(int staffIndex) -
isStaffLineVisible
public boolean isStaffLineVisible(int staffIndex, int lineIndex) -
setStaffLineVisible
public void setStaffLineVisible(int staffIndex, int lineIndex, boolean visible) -
setLedgerLinesVisible
public void setLedgerLinesVisible(int staffIndex, boolean visible) -
getName
public java.lang.String getName() -
setName
public void setName(java.lang.String name) -
getSubtitle
public java.lang.String getSubtitle()- Returns:
- the scoreSubtitle
-
getScoreSubtitle
public java.lang.String getScoreSubtitle()same as getSubtitle() -
setScoreSubtitle
public void setScoreSubtitle(java.lang.String scoreSubtitle)- Parameters:
scoreSubtitle
- the scoreSubtitle to set
-
getScoreCanvas
-
getControlPanel
-
getScoreEditPanel
-
getScoreCollection
- Returns:
- the underlying playable structure
-
getEditManager
- Returns:
- this Score's editmanager
-
setSelectedStaff
useful for mouse editing -
getSelectedStaff
useful for mouse editing -
getScoreAnnotation
- Returns:
- the scoreAnnotation
-
setScoreAnnotation
- Parameters:
scoreAnnotation
- the scoreAnnotation to set
-
getStaffSpacing
- Returns:
- the spacing information for staff#
-
setStaffSpacing
replace StaffSpacing at index -
getTieManager
- Returns:
- the TieManager for staff#, track#
-
setSelectedMeasure
useful for mouse editing -
getSelectedMeasure
useful for mouse editing -
getAccidentalLevelManager
used to hide/show/change accidentals of notes on a Track -
size
public int size()- Returns:
- number of measures in score
-
indent
public static java.lang.String indent() -
getHierarchy
public java.lang.String getHierarchy() -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
insertStaff
public void insertStaff(int position) -
deleteStaff
public void deleteStaff(int position) -
rewind
public void rewind()Set current insertion measure to 0, used by addNote(). Same as setCurrentMeasureNumber(0) and sets last added note to null Use setCurrentStaffNumber() to set staff index for input -
setCurrentMeasureNumber
public void setCurrentMeasureNumber(int m)set measure number for adding/editing -
getCurrentMeasureNumber
public int getCurrentMeasureNumber()- Returns:
- current measure number for adding/editing. May have been set by transcriber, for example
-
setCurrentStaffNumber
public void setCurrentStaffNumber(int s)set staff number for adding/editing -
getCurrentStaffNumber
public int getCurrentStaffNumber() -
setCurrentTrackNumber
public void setCurrentTrackNumber(int t)set track number for adding/editing -
getCurrentTrackNumber
public int getCurrentTrackNumber() -
addNote
-
addNote
Expects length >= 4, where dar[0] is dur ( qtr = 1.0), dar[1] is pitch (1..127), dar[2] is amp (0..1), dar[3] is hold Rounds data[0] to nearest recognized duration. Copies all other dimensions straight across -
addNote
Expects length >= 4, where dar[0] is dur ( qtr = 1.0), dar[1] is pitch (1..127), dar[2] is amp (0..1), dar[3] is hold Rounds data[0] to nearest recognized duration. Copies all other dimensions straight across -
addInterval
Add an interval to the last added note, specifying dimension name space and data[]. Last added note's duration overwrites whatever value is in dar[0] -
addNote
-
addNote
-
getLastAddedNote
-
addMeasure
-
addMeasure
-
addMeasures
public java.util.Vector addMeasures(int numMeasures, int tsNumer, int tsDenom)add numMeasures of indicated timesignature- Returns:
- vector of measures added
-
addMeasures
public java.util.Vector addMeasures(int numMeasures)- Returns:
- addMeasures(numMeasures, 4, 4);
-
insertMeasure
Insert a new empty measure before indicated Measure -
insertMeasure
public void insertMeasure(int measureNumber)Insert a new empty measure before measureNumber. You are responsible for ensuring measureNumbernotifyAddMeasure
public void notifyAddMeasure()notifyDeleteMeasure
public void notifyDeleteMeasure()getMeasure
getScoreLayoutManager
setSystemWrap
public void setSystemWrap(boolean flag)When true, will layout as many systems vertically as there is space. When false, lays out only one system at top of canvasgetScorePainter
setScorePainter
isRenderAllowed
public boolean isRenderAllowed()setRenderAllowed
public void setRenderAllowed(boolean renderAllowed)render
public int render()render
public int render(int startingMeasure)- Returns:
- number of measures laid out
- Throws:
JustificationException
render
public int render(int startingMeasure, double playTime, boolean scheduled)- Returns:
- number of measures laid out
- Throws:
JustificationException
clearMixer
public void clearMixer()removes all instruments from Orchestra's MixeraddScoreLayoutListener
removeScoreLayoutListener
writeXMLPreamble
public static void writeXMLPreamble(java.io.PrintWriter out) throws java.io.IOException- Throws:
java.io.IOException
writeXMLWrapup
public static void writeXMLWrapup(java.io.PrintWriter out) throws java.io.IOException- Throws:
java.io.IOException
writeXML
public final void writeXML(java.io.PrintWriter out) throws java.io.IOException- Specified by:
writeXML
in interfaceXMLWritable
- Throws:
java.io.IOException
writeXMLScoreTagEnd
public void writeXMLScoreTagEnd(java.io.PrintWriter out)writeXMLScoreUserBeans
public void writeXMLScoreUserBeans(java.io.PrintWriter out) throws java.io.IOException- Throws:
java.io.IOException
writeXMLScoreSections
public void writeXMLScoreSections(java.io.PrintWriter out) throws java.io.IOException- Throws:
java.io.IOException
writeXMLPatchLurkers
public void writeXMLPatchLurkers(java.io.PrintWriter out) throws java.io.IOException- Throws:
java.io.IOException
writeXMLStaffSpacing
public void writeXMLStaffSpacing(java.io.PrintWriter out) throws java.io.IOException- Throws:
java.io.IOException
writeXMLStaffLineVisibility
public void writeXMLStaffLineVisibility(java.io.PrintWriter out) throws java.io.IOException- Throws:
java.io.IOException
writeXMLOrchestra
public void writeXMLOrchestra(java.io.PrintWriter out) throws java.io.IOException- Throws:
java.io.IOException
writeXMLScoreAnnotation
public void writeXMLScoreAnnotation(java.io.PrintWriter out) throws java.io.IOException- Throws:
java.io.IOException
writeXMLScoreAttributes
public void writeXMLScoreAttributes(java.io.PrintWriter out)save
public void save(java.lang.String filename) throws java.io.IOExceptionSave as XML or as ZIP depending on suffix- Throws:
java.io.IOException
isUndoStackEnabled
public boolean isUndoStackEnabled()- Returns:
- the isUndoStackEnabled
setUndoStackEnabled
public void setUndoStackEnabled(boolean isUndoStackEnabled)- Parameters:
isUndoStackEnabled
- the isUndoStackEnabled to set
getUndoStack
saveToUndoStack
public void saveToUndoStack()saveToUndoStack
public void saveToUndoStack(java.lang.String msg)getUndoStackMemoryThresholdMB
public int getUndoStackMemoryThresholdMB()- Returns:
- the undoStackMemoryThresholdMB
setUndoStackMemoryThresholdMB
public void setUndoStackMemoryThresholdMB(int undoStackMemoryThresholdMB)- Parameters:
undoStackMemoryThresholdMB
- the undoStackMemoryThresholdMB to set
openNewScoreDialog
openEditScoreDialog
public void openEditScoreDialog(java.awt.Frame f)main
public static void main(java.lang.String[] args)getRenderDelay
public static double getRenderDelay()- Returns:
- how many seconds in the future render() actually renders. Defaults to 0 (instant) but a little delay, say about 0.2, is needed on OS X, for example, which sometimes does not render a note when the user inserts a new one.
setRenderDelay
public static void setRenderDelay(double d)Set how far in the future a render() is scheduled. Really only needed under OSX which failed to redraw when notes added by hand. Under windows, keep it 0, for OSX try 0.2 Note that tou will experience this little delay between the time you add a note and the note is drawn.killAllNotes
public void killAllNotes()Enumerate through all Notes in a Score and call ins.off(JMSL.realTime(), 1.0, note.getPerformanceData()); on eachgetNumTracksPerStaff
public int getNumTracksPerStaff()- Returns:
- number of tracks each newly created Staff will generate in its constructor
setNumTracksPerStaff
public void setNumTracksPerStaff(int numTracksPerStaff)Set the number of Tracks each new Staff will create in its constructor. Will not automatically change the number of tracks in existing Staves. So call this right after the constructor, else manage the addition of tracks for those staves that have a different size() yourself.- Parameters:
numTracksPerStaff
-
getComposer
public java.lang.String getComposer()setComposer
public void setComposer(java.lang.String scoreComposer)getCopyright
public java.lang.String getCopyright()setCopyright
public void setCopyright(java.lang.String scoreCopyright)getUserBeans
public java.util.Vector getUserBeans()addUserBean
public void addUserBean(java.lang.Object bean)Add a bean to a Score. A bean is an object with primitive fields and matching getters and setters. These will be restored when loaded.- Parameters:
bean
- The bean to add.
removeUserBean
public void removeUserBean(java.lang.Object bean)setAntiAliasingHints
public static void setAntiAliasingHints(boolean flag)Flag to determine whether Score graphics use antialiasing hints or notuseAntiAliasingHints
public static boolean useAntiAliasingHints()Flag to determine whether Score graphics use antialiasing hints or notsetupAntiAliasedGraphics
public static void setupAntiAliasedGraphics(java.awt.Graphics2D g)getStaffAndLedgerLineVisibilityManager
- Returns:
- Returns the staffAndLedgerLineVisibilityManager.
isHighlightSelectedStaff
public boolean isHighlightSelectedStaff()- Returns:
- Returns the highlightSelectedStaff.
setHighlightSelectedStaff
public void setHighlightSelectedStaff(boolean highlightSelectedStaff)- Parameters:
highlightSelectedStaff
- The highlightSelectedStaff to set.
getWorkingTopMargin
public double getWorkingTopMargin(boolean isFirstPage)getTopMarginOfFirstPage
public double getTopMarginOfFirstPage()- Returns:
- the topMarginOfFirstPage
setTopMarginOfFirstPage
public void setTopMarginOfFirstPage(double topMarginOfFirstPage)- Parameters:
topMarginOfFirstPage
- the topMarginOfFirstPage to set
getLeftMargin
public double getLeftMargin()setLeftMargin
public void setLeftMargin(double leftMargin)getRightMargin
public double getRightMargin()setRightMargin
public void setRightMargin(double rightMargin)getTopMargin
public double getTopMargin()setTopMargin
public void setTopMargin(double topMargin)getBottomMargin
public double getBottomMargin()setBottomMargin
public void setBottomMargin(double bottomMargin)getDrawAllMeasureNumbers
public boolean getDrawAllMeasureNumbers()setDrawAllMeasureNumbers
public void setDrawAllMeasureNumbers(boolean drawAllMeasureNumbers)setMeasureNumberFontScaler
public void setMeasureNumberFontScaler(double scaler)default is 1.5 This scaler is multiplied by the distance between adjacent staff lines to create the size of the font for measure numbering .getTextFontScaler
public double getTextFontScaler()setTextFontScaler
public void setTextFontScaler(double textFontScaler)getScoreSubtitleFontScaler
public double getScoreSubtitleFontScaler()setScoreSubtitleFontScaler
public void setScoreSubtitleFontScaler(double scoreSubtitleFontScaler)getScoreTitleFontScaler
public double getScoreTitleFontScaler()setScoreTitleFontScaler
public void setScoreTitleFontScaler(double scoreTitleFontScaler)getTimesigFontScaler
public double getTimesigFontScaler()setTimesigFontScaler
public void setTimesigFontScaler(double timesigFontScaler)getTextFontName
public java.lang.String getTextFontName()setTextFontName
public void setTextFontName(java.lang.String textFontName)getScoreTitleFontName
public java.lang.String getScoreTitleFontName()setScoreTitleFontName
public void setScoreTitleFontName(java.lang.String scoreTitleFontName)getScoreSubtitleFontName
public java.lang.String getScoreSubtitleFontName()setScoreSubtitleFontName
public void setScoreSubtitleFontName(java.lang.String scoreSubtitleFontName)getTimesigFontName
public java.lang.String getTimesigFontName()setTimesigFontName
public void setTimesigFontName(java.lang.String timesigFontName)getMeasureNumberFontName
public java.lang.String getMeasureNumberFontName()setMeasureNumberFontName
public void setMeasureNumberFontName(java.lang.String measureNumberFontName)getMeasureNumberFontScaler
public double getMeasureNumberFontScaler()removeAllUserBeans
public void removeAllUserBeans()setDoStopWithHalt
public static void setDoStopWithHalt(boolean flag)doStopWithHalt
public static boolean doStopWithHalt()
-