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
Author:
Nick Didkovsky , copyright 2000 Nick Didkovsky
  • 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

      public static CopyBuffer copyBuffer
    • auxCopyBuffer1

      public static CopyBuffer auxCopyBuffer1
    • auxCopyBuffer2

      public static CopyBuffer 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
  • 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 interface XMLCreatable
    • create

      public java.lang.Object create()
      XMLCreatable Interface
      Specified by:
      create in interface XMLCreatable
    • setScoreCanvas

      public void setScoreCanvas​(ScoreCanvas scoreCanvas)
    • getMusicCurveRenderer

      public 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.
      Returns:
      Returns the musicCurveRenderer, may be null.
    • setMusicCurveRenderer

      public 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.
      Parameters:
      musicCurveRenderer - The musicCurveRenderer to set.
    • addMusicGlyphRenderer

      public void addMusicGlyphRenderer​(MusicGlyphRenderer mgr)
      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()
    • useSharedCanvas

      public static void useSharedCanvas​(boolean f)
      If true, all scores render to the same static canvas. If false, each Score gets its own canvas (you may quickly run out of memory doing this). Shared = true by default
    • getSelectionBuffer

      public SelectionBuffer 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

      public void copy​(CopyBuffer buf)
      Copy selected notes into specified copy buffer
    • load

      public static Score load​(java.lang.String filename) throws java.io.IOException
      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.IOException
      Load 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

      public 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 method
      Parameters:
      listener -
    • removeNumTracksPerStaffChangedListener

      public 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 method
      Parameters:
      listener -
    • rebuildSectionNames

      public void rebuildSectionNames()
    • setOrchestra

      public void setOrchestra​(Orchestra orch)
    • getOrchestra

      public Orchestra getOrchestra()
    • setInstruments

      public void setInstruments()
      Run through every staff and assign ins# from Orchestra to it
    • getPlayLurkerPatchManager

      public PlayLurkerPatchManager 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

      public void addDirtyListener​(DirtyListener listener)
      Add a listener to be notified when this score has been edited
    • removeDirtyListener

      public void removeDirtyListener​(DirtyListener listener)
    • 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

      public ScoreSection getCurrentScoreSection()
    • setSectionStart

      public void setSectionStart​(int n)
    • getScoreSections

      public ScoreSection[] 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

      public ScoreCanvas getScoreCanvas()
    • getControlPanel

      public ScoreControlPanel getControlPanel()
    • getScoreEditPanel

      public ScoreEditPanel getScoreEditPanel()
    • getScoreCollection

      public ScoreCollection getScoreCollection()
      Returns:
      the underlying playable structure
    • getEditManager

      public EditManager getEditManager()
      Returns:
      this Score's editmanager
    • setSelectedStaff

      public void setSelectedStaff​(Staff s)
      useful for mouse editing
    • getSelectedStaff

      public Staff getSelectedStaff()
      useful for mouse editing
    • getScoreAnnotation

      public ScoreAnnotation getScoreAnnotation()
      Returns:
      the scoreAnnotation
    • setScoreAnnotation

      public void setScoreAnnotation​(ScoreAnnotation scoreAnnotation)
      Parameters:
      scoreAnnotation - the scoreAnnotation to set
    • getStaffSpacing

      public StaffSpacing getStaffSpacing​(int s)
      Returns:
      the spacing information for staff#
    • setStaffSpacing

      public void setStaffSpacing​(int index, StaffSpacing ss)
      replace StaffSpacing at index
    • getTieManager

      public TieManager getTieManager​(int s, int t)
      Returns:
      the TieManager for staff#, track#
    • setSelectedMeasure

      public void setSelectedMeasure​(Measure m)
      useful for mouse editing
    • getSelectedMeasure

      public Measure getSelectedMeasure()
      useful for mouse editing
    • getAccidentalLevelManager

      public AccidentalLevelManager 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 class java.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

      public Note addNote​(Note n, int measureNum, int staffNum, int trackNum)
    • addNote

      public 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. Copies all other dimensions straight across
    • addNote

      public 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. Copies all other dimensions straight across
    • addInterval

      public Note addInterval​(DimensionNameSpace dimensionNameSpace, double[] dar)
      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

      public Note addNote​(double dur, double midipitch, double vel, double hold)
    • addNote

      public Note addNote​(Note note)
    • getLastAddedNote

      public Note getLastAddedNote()
    • addMeasure

      public Measure addMeasure()
    • addMeasure

      public Measure addMeasure​(int tsNumer, int tsDenom)
    • 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

      public Measure insertMeasure​(Measure measure)
      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 measureNumber
    • notifyAddMeasure

      public void notifyAddMeasure()
    • notifyDeleteMeasure

      public void notifyDeleteMeasure()
    • getMeasure

      public Measure getMeasure​(int n)
    • getScoreLayoutManager

      public ScoreLayoutManager 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 canvas
    • getScorePainter

      public ScorePainter getScorePainter()
    • setScorePainter

      public void setScorePainter​(ScorePainter sp)
    • 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 Mixer
    • addScoreLayoutListener

      public void addScoreLayoutListener​(ScoreLayoutListener listener)
    • removeScoreLayoutListener

      public void removeScoreLayoutListener​(ScoreLayoutListener listener)
    • 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 interface XMLWritable
      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.IOException
      Save 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

      public UndoStack 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

      public static void openNewScoreDialog​(java.awt.Frame f, NewScoreListener listener)
    • 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 each
    • getNumTracksPerStaff

      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 not
    • useAntiAliasingHints

      public static boolean useAntiAliasingHints()
      Flag to determine whether Score graphics use antialiasing hints or not
    • setupAntiAliasedGraphics

      public static void setupAntiAliasedGraphics​(java.awt.Graphics2D g)
    • getStaffAndLedgerLineVisibilityManager

      public StaffAndLedgerLineVisibilityManager 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()