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 voidaddDirtyListener(DirtyListener listener)Add a listener to be notified when this score has been editedNoteaddInterval(DimensionNameSpace dimensionNameSpace, double[] dar)Add an interval to the last added note, specifying dimension name space and data[].MeasureaddMeasure()MeasureaddMeasure(int tsNumer, int tsDenom)java.util.VectoraddMeasures(int numMeasures)java.util.VectoraddMeasures(int numMeasures, int tsNumer, int tsDenom)add numMeasures of indicated timesignaturevoidaddMusicGlyphRenderer(MusicGlyphRenderer mgr)Add your glyph renderers in the priority you want them to be asked to draw glyphs.NoteaddNote(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.NoteaddNote(double dur, double midipitch, double vel, double hold)NoteaddNote(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.NoteaddNote(Note note)NoteaddNote(Note n, int measureNum, int staffNum, int trackNum)voidaddNumTracksPerStaffChangedListener(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 methodvoidaddScoreLayoutListener(ScoreLayoutListener listener)voidaddUserBean(java.lang.Object bean)Add a bean to a Score.voidbuild(int numStaves, int layoutWidth, int layoutHeight, java.lang.String name)voidclearMixer()removes all instruments from Orchestra's Mixervoidcopy(CopyBuffer buf)Copy selected notes into specified copy bufferjava.lang.Objectcreate()XMLCreatable Interfacestatic voiddeleteCanvas()Set static canvas to null to force new upon next build()voiddeleteStaff(int position)voiddeselectAll()Deselect all notes in scorestatic booleandoStopWithHalt()AccidentalLevelManagergetAccidentalLevelManager()used to hide/show/change accidentals of notes on a TrackdoublegetBottomMargin()booleangetClefsVisible()java.lang.StringgetComposer()ScoreControlPanelgetControlPanel()java.lang.StringgetCopyright()intgetCurrentMeasureNumber()ScoreSectiongetCurrentScoreSection()intgetCurrentStaffNumber()intgetCurrentTrackNumber()booleangetDirty()booleangetDrawAllMeasureNumbers()EditManagergetEditManager()intgetFirstStaffToRender()doublegetFirstSystemIndent()java.lang.StringgetHierarchy()booleangetInstrumentNamesVisible()booleangetKeySignaturesVisible()NotegetLastAddedNote()intgetLayoutHeight()intgetLayoutWidth()doublegetLeftMargin()MeasuregetMeasure(int n)java.lang.StringgetMeasureNumberFontName()doublegetMeasureNumberFontScaler()intgetMeasureNumberOffset()measure number offset is a number added to measure indexes (which are zero based), for displaying measure numbers in score.booleangetMeasureNumbersVisible()MusicCurveRenderergetMusicCurveRenderer()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.VectorgetMusicGlyphRenderers()java.lang.StringgetName()intgetNumStaffs()Deprecated.use getNumStaves()intgetNumStaves()intgetNumTracksPerStaff()OrchestragetOrchestra()PlayLurkerPatchManagergetPlayLurkerPatchManager()static doublegetRenderDelay()doublegetRightMargin()ScoreAnnotationgetScoreAnnotation()ScoreCanvasgetScoreCanvas()ScoreCollectiongetScoreCollection()ScoreEditPanelgetScoreEditPanel()ScoreLayoutManagergetScoreLayoutManager()ScorePaintergetScorePainter()ScoreSection[]getScoreSections()java.lang.StringgetScoreSubtitle()same as getSubtitle()java.lang.StringgetScoreSubtitleFontName()doublegetScoreSubtitleFontScaler()java.lang.StringgetScoreTitleFontName()doublegetScoreTitleFontScaler()booleangetSectionBracketsVisible()MeasuregetSelectedMeasure()useful for mouse editingStaffgetSelectedStaff()useful for mouse editingSelectionBuffergetSelectionBuffer()StaffAndLedgerLineVisibilityManagergetStaffAndLedgerLineVisibilityManager()booleangetStaffNumbersVisible()StaffSpacinggetStaffSpacing(int s)java.lang.StringgetSubtitle()booleangetTempoVisible()java.lang.StringgetTextFontName()doublegetTextFontScaler()TieManagergetTieManager(int s, int t)java.lang.StringgetTimesigFontName()doublegetTimesigFontScaler()booleangetTimeSignaturesVisible()booleangetTitleVisible()doublegetTopMargin()doublegetTopMarginOfFirstPage()booleangetTurnPages()UndoStackgetUndoStack()intgetUndoStackMemoryThresholdMB()java.util.VectorgetUserBeans()doublegetWorkingTopMargin(boolean isFirstPage)voidhandleAttribute(java.lang.String name, java.lang.String value)XMLCreatable Interfacestatic java.lang.Stringindent()voidinsertMeasure(int measureNumber)Insert a new empty measure before measureNumber.MeasureinsertMeasure(Measure measure)Insert a new empty measure before indicated MeasurevoidinsertStaff(int position)booleanisDrawCourtesyClefs()booleanisHighlightSelectedStaff()booleanisLedgerLineVisible(int staffIndex)booleanisRenderAllowed()booleanisStaffLineVisible(int staffIndex, int lineIndex)booleanisUndoStackEnabled()booleanisUseLegacyMultiTrackOrientation()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.booleanisWindowsAndBravura()This method is needed to adjust stem placement on Windows when using Bravura music fontvoidkillAllNotes()Enumerate through all Notes in a Score and call ins.off(JMSL.realTime(), 1.0, note.getPerformanceData()); on eachstatic Scoreload(java.lang.String filename)Load a Score from an XML file.static Scoreload(java.lang.String filename, boolean renderAllowedAfterLoading)Load a Score from an XML file.static voidmain(java.lang.String[] args)voidnotifyAddMeasure()voidnotifyDeleteMeasure()voidnotifySectionSelectChange(int n)change section for playbackvoidopenEditScoreDialog(java.awt.Frame f)static voidopenNewScoreDialog(java.awt.Frame f, NewScoreListener listener)voidownCanvas()voidpaste()paste from copy buffer to current locationvoidpasteFreeFlow()free flow paste from copy buffer to current locationvoidpasteWithMeasureInfo()paste from copy buffer to current location, preserve measure info like repeats, time sig, etcvoidpatchLurkers()Run through Vector of Patches in playLurkerPatchManager.voidrebuildSectionNames()voidremoveAllPlayLurkers()remove all playLurkers from all tracks of all staves of all measuresvoidremoveAllUserBeans()voidremoveDirtyListener(DirtyListener listener)voidremoveNumTracksPerStaffChangedListener(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 methodvoidremoveScoreLayoutListener(ScoreLayoutListener listener)voidremoveUserBean(java.lang.Object bean)intrender()intrender(int startingMeasure)intrender(int startingMeasure, double playTime, boolean scheduled)voidrewind()Set current insertion measure to 0, used by addNote().voidsave(java.lang.String filename)Save as XML or as ZIP depending on suffixvoidsaveToUndoStack()voidsaveToUndoStack(java.lang.String msg)voidselectAll()Select all notes in scorestatic voidsetAntiAliasingHints(boolean flag)Flag to determine whether Score graphics use antialiasing hints or notvoidsetBottomMargin(double bottomMargin)voidsetClefsVisible(boolean b)voidsetComposer(java.lang.String scoreComposer)voidsetCopyright(java.lang.String scoreCopyright)voidsetCurrentMeasureNumber(int m)set measure number for adding/editingvoidsetCurrentStaffNumber(int s)set staff number for adding/editingvoidsetCurrentTrackNumber(int t)set track number for adding/editingvoidsetDirty(boolean f)voidsetDirty(boolean f, java.lang.String msg)set T/F if score has been edited or otherwise changedstatic voidsetDoStopWithHalt(boolean flag)voidsetDrawAllMeasureNumbers(boolean drawAllMeasureNumbers)voidsetDrawCourtesyClefs(boolean drawCourtesyClefs)voidsetFirstStaffToRender(int n)voidsetFirstSystemIndent(double firstSystemIndent)voidsetHighlightSelectedStaff(boolean highlightSelectedStaff)voidsetInstrumentNamesVisible(boolean b)voidsetInstruments()Run through every staff and assign ins# from Orchestra to itvoidsetKeySignaturesVisible(boolean b)voidsetLayoutHeight(int layoutHeight)Set the canvas height.voidsetLayoutWidth(int layoutWidth)Set the canvas width.voidsetLedgerLinesVisible(int staffIndex, boolean visible)voidsetLeftMargin(double leftMargin)voidsetMeasureBar(int measureNumber)voidsetMeasureNumberFontName(java.lang.String measureNumberFontName)voidsetMeasureNumberFontScaler(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 .voidsetMeasureNumberOffset(int measureNumberOffset)voidsetMeasureNumbersVisible(boolean showMeasureNumbers)voidsetMusicCurveRenderer(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.voidsetName(java.lang.String name)voidsetNoteFlash(boolean flash)voidsetNumTracksPerStaff(int numTracksPerStaff)Set the number of Tracks each new Staff will create in its constructor.voidsetOrchestra(Orchestra orch)voidsetRenderAllowed(boolean renderAllowed)static voidsetRenderDelay(double d)Set how far in the future a render() is scheduled.voidsetRightMargin(double rightMargin)voidsetScoreAnnotation(ScoreAnnotation scoreAnnotation)voidsetScoreCanvas(ScoreCanvas scoreCanvas)voidsetScorePainter(ScorePainter sp)voidsetScoreSection(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.voidsetScoreSubtitle(java.lang.String scoreSubtitle)voidsetScoreSubtitleFontName(java.lang.String scoreSubtitleFontName)voidsetScoreSubtitleFontScaler(double scoreSubtitleFontScaler)voidsetScoreTitleFontName(java.lang.String scoreTitleFontName)voidsetScoreTitleFontScaler(double scoreTitleFontScaler)voidsetSectionBracketsVisible(boolean showSectionBrackets)voidsetSectionEnd(int n)voidsetSectionStart(int n)voidsetSelectedMeasure(Measure m)useful for mouse editingvoidsetSelectedStaff(Staff s)useful for mouse editingvoidsetStaffLineVisible(int staffIndex, int lineIndex, boolean visible)voidsetStaffNumbersVisible(boolean showStaffNumbers)voidsetStaffSpacing(int index, StaffSpacing ss)replace StaffSpacing at indexvoidsetSystemWrap(boolean flag)When true, will layout as many systems vertically as there is space.voidsetTempoVisible(boolean b)voidsetTextFontName(java.lang.String textFontName)voidsetTextFontScaler(double textFontScaler)voidsetTimesigFontName(java.lang.String timesigFontName)voidsetTimesigFontScaler(double timesigFontScaler)voidsetTimeSignaturesVisible(boolean b)voidsetTitleVisible(boolean b)voidsetTopMargin(double topMargin)voidsetTopMarginOfFirstPage(double topMarginOfFirstPage)voidsetTurnPages(boolean f)voidsetUndoStackEnabled(boolean isUndoStackEnabled)voidsetUndoStackMemoryThresholdMB(int undoStackMemoryThresholdMB)static voidsetupAntiAliasedGraphics(java.awt.Graphics2D g)voidsetUseLegacyMultiTrackOrientation(boolean useLegacyMultiTrackOrientation)intsize()java.lang.StringtoString()static booleanuseAntiAliasingHints()Flag to determine whether Score graphics use antialiasing hints or notstatic voiduseSharedCanvas(boolean f)If true, all scores render to the same static canvas.booleanusingMusicGlyphRenderer()voidwriteXML(java.io.PrintWriter out)voidwriteXMLOrchestra(java.io.PrintWriter out)voidwriteXMLPatchLurkers(java.io.PrintWriter out)static voidwriteXMLPreamble(java.io.PrintWriter out)voidwriteXMLScoreAnnotation(java.io.PrintWriter out)voidwriteXMLScoreAttributes(java.io.PrintWriter out)voidwriteXMLScoreSections(java.io.PrintWriter out)voidwriteXMLScoreTagEnd(java.io.PrintWriter out)voidwriteXMLScoreUserBeans(java.io.PrintWriter out)voidwriteXMLStaffLineVisibility(java.io.PrintWriter out)voidwriteXMLStaffSpacing(java.io.PrintWriter out)static voidwriteXMLWrapup(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:
handleAttributein interfaceXMLCreatable
-
create
public java.lang.Object create()XMLCreatable Interface- Specified by:
createin 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:
toStringin 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:
writeXMLin 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()
-