Members
(static, readonly) composer :String
Composer of the score, as taken from the score properties
Type:
- String
(static, readonly) duration :Number
Duration of score in seconds
Type:
- Number
(static, readonly) excerpts :Array.<Engraving.Excerpt>
List of the excerpts (linked parts)
Type:
- Array.<Engraving.Excerpt>
(static, readonly) firstMeasure :Engraving.Measure
First measure of the score
Type:
- Engraving.Measure
(static, readonly) firstMeasureMM :Engraving.Measure
First multimeasure rest measure of the score
Type:
- Engraving.Measure
- See:
-
- Engraving.Measure.nextMeasureMM
(static, readonly) harmonyCount :Number
Number of harmony items (chord symbols) in the score
Type:
- Number
(static, readonly) hasHarmonies :Boolean
Whether score has harmonies (chord symbols)
Type:
- Boolean
(static, readonly) hasLyrics :Boolean
Whether score has lyrics
Type:
- Boolean
(static, readonly) keysig :Number
Key signature at the start of the score, in number of accidentals, negative for flats, positive for sharps
Type:
- Number
(static, readonly) lastMeasure :Engraving.Measure
Last measure of the score
Type:
- Engraving.Measure
(static, readonly) lastMeasureMM :Engraving.Measure
Last multimeasure rest measure of the score
Type:
- Engraving.Measure
- See:
-
- Engraving.Measure.prevMeasureMM
(static, readonly) lastSegment :Engraving.Segment
Last score segment
Type:
- Engraving.Segment
(static) layoutMode :Number
The current layout mode, a PluginAPI::LayoutMode value.
Type:
- Number
- Since:
- 4.6
(static, readonly) lyricCount :Number
Number of lyrics items (syllables) in the score
Type:
- Number
(static, readonly) lyricist :String
Lyricist of score, as taken from the score properties.
Type:
- String
(static, readonly) lyrics :Array.<Engraving.Lyrics>
List of lyrics in this score.
Type:
- Array.<Engraving.Lyrics>
- Since:
- 4.7
(static) markIrregularMeasures :Boolean
Whether corrupted measures are marked in the score.
Type:
- Boolean
- Since:
- 4.6
(static, readonly) mscoreRevision :String
MuseScore revision the score has been last saved with (includes autosave)
Type:
- String
(static, readonly) mscoreVersion :String
MuseScore version the score has been last saved with (includes autosave)
Type:
- String
(static, readonly) nmeasures :Number
Number of measures
Type:
- Number
(static, readonly) npages :Number
Number of pages
Type:
- Number
(static, readonly) nstaves :Number
Number of staves
Type:
- Number
(static, readonly) ntracks :Number
Number of tracks
Type:
- Number
(static) pageNumberOffset :Number
Page numbering offset. The user-visible number of the given page is defined as
page.pagenumber + 1 + score.pageNumberOffset
Type:
- Number
(static, readonly) pages :Array.<Engraving.Page>
List of pages in this score.
Type:
- Array.<Engraving.Page>
- Since:
- 4.6
(static, readonly) parts :Array.<Engraving.Part>
The list of parts
Type:
- Array.<Engraving.Part>
(static) scoreName :String
Name of the score, without path leading to it and extension.
Type:
- String
(static, readonly) selection :Engraving.Selection
Current selections for the score.
Type:
- Engraving.Selection
(static) showFrames :Boolean
Whether frames are displayed in the score.
Type:
- Boolean
- Since:
- 4.6
(static) showInstrumentNames :Boolean
Whether instrument names are displayed
Type:
- Boolean
- Since:
- 4.6
(static) showInvisible :Boolean
Whether invisible elements are shown in the score.
Type:
- Boolean
- Since:
- 4.6
(static) showPageborders :Boolean
Whether page borders are displayed in the score.
Type:
- Boolean
- Since:
- 4.6
(static) showSoundFlags :Boolean
Whether sound flags are displayed in the score.
Type:
- Boolean
- Since:
- 4.6
(static) showUnprintable :Boolean
Whether formatting elements are displayed in the score.
Type:
- Boolean
- Since:
- 4.6
(static) showVerticalFrames :Boolean
Whether vertical frames are visible in the current layout mode.
Type:
- Boolean
- Since:
- 4.6
(static, readonly) spanners :Array.<Engraving.Spanner>
List of spanners (hairpins, slurs, etc.) in this score.
Type:
- Array.<Engraving.Spanner>
- Since:
- 4.7
(static, readonly) staves :Array.<Engraving.Staff>
List of staves in this score.
Type:
- Array.<Engraving.Staff>
(static, readonly) style :Engraving.Style
Style settings for this score.
Type:
(static, readonly) systems :Array.<Engraving.System>
List of systems in this score.
Type:
- Array.<Engraving.System>
- Since:
- 4.6
(static, readonly) title :String
Title of score, as taken from the score properties workTitle
Type:
- String
Methods
(static) addRemoveSystemLocks(interval, lock)
Add or remove system locks to the current selection.
Parameters:
| Name | Type | Description |
|---|---|---|
interval |
Number | Specifies after how many measures locks should be added. |
lock |
boolean | If |
- Since:
- 4.6
(static) addText(type, text)
Add the text
Parameters:
| Name | Type | Description |
|---|---|---|
type |
Engraving.TextStyleType | Stype type of text |
text |
String | Value of text |
(static) appendMeasures(n)
Appends a number of measures to this score.
Parameters:
| Name | Type | Description |
|---|---|---|
n |
Number | number of measures |
(static) appendPart(instrumentId)
Appends a part with the instrument defined by instrumentId to this score.
Parameters:
| Name | Type | Description |
|---|---|---|
instrumentId |
String | ID of the instrument to be added, as listed in instruments.xml |
(static) appendPartByMusicXmlId(instrumentMusicXmlId)
Appends a part with the instrument defined by the given MusicXML ID to this score.
Parameters:
| Name | Type | Description |
|---|---|---|
instrumentMusicXmlId |
String | MusicXML Sound ID of the instrument to be added. |
(static) createPlayEvents()
Create PlayEvents for all notes based on ornamentation. You need to call this if you are manipulating PlayEvent's so that all ornamentations are populated into Note's PlayEvent lists.
- Deprecated:
- PlayEvents don't have a playback effect in MuseScore 4.
(static) doLayout(startTick, endTick)
Force the score to layout itself. The score is laid out automatically at the end of a command, however this method can be called to layout mid-command. Layout the whole score with:
curScore.doLayout(fraction(0, 1), fraction(-1, 1))
Parameters:
| Name | Type | Description |
|---|---|---|
startTick |
Engraving.Fraction | Fraction from which to start the layout |
endTick |
Engraving.Fraction | Fraction at which to end the layout |
- Since:
- 4.6
(static) endCmd(rollback)
For MuseScore 4 and for "dock" type plugins: to be used after score modifications to make them undoable, and to avoid corruptions or crashes. Ends an undoable command.
Parameters:
| Name | Type | Description |
|---|---|---|
rollback |
Boolean | If true, reverts all the changes made since the last |
(static) extractLyrics() → {String}
Extracts all lyrics in the score and returns them in a single string.
Returns:
lyrics string
- Type
- String
(static) findSegmentAtTick(types, tick) → {Engraving.Segment}
Looks for a segment of a given type at a given tick. Does not create a segment or modify the score.
Parameters:
| Name | Type | Description |
|---|---|---|
types |
Number | Determines the types of segments to look for. |
tick |
Engraving.Fraction | Determines where to look for the segment |
- Since:
- 4.6
Returns:
Segment object
- Type
- Engraving.Segment
(static) firstSegment(segmentType) → {Engraving.Segment}
The first segment of a given type in the score. Before MuseScore 4.6, the type could not be specified.
Parameters:
| Name | Type | Description |
|---|---|---|
segmentType |
Number | If not specified, defaults to all types. |
Returns:
Segment object
- Type
- Engraving.Segment
(static) makeIntoSystem(first, last)
Create a (locked) system from two Engraving.Measure objects.
Parameters:
| Name | Type | Description |
|---|---|---|
first |
Engraving.Measure | The first |
last |
Engraving.Measure | The last |
- Since:
- 4.6
(static) metaTag(tag) → {String}
Get the value of a meta tag by name
Parameters:
| Name | Type | Description |
|---|---|---|
tag |
String | Tag |
Returns:
Tag value
- Type
- String
(static) newCursor() → {Cursor}
Creates and returns a cursor to be used to navigate in the score
Returns:
cursor
- Type
- Cursor
(static) setMetaTag(tag, value)
Set a value of a meta tag by name
Parameters:
| Name | Type | Description |
|---|---|---|
tag |
String | Tag |
value |
String | Value |
(static) showElementInScore(item, staffIdx)
Put an item in the user's view.
Parameters:
| Name | Type | Description |
|---|---|---|
item |
Engraving.EngravingItem | The item to put into view. |
staffIdx |
Number | If provided, the specific staff to put into view. |
- Since:
- 4.6
(static) startCmd(qActionName)
For MuseScore 4 and for "dock" type plugins: to be used before score
modifications to make them undoable, and to avoid corruptions or crashes.
Starts an undoable command. Must be accompanied by a corresponding endCmd() call.
Parameters:
| Name | Type | Description |
|---|---|---|
qActionName |
String | Optional action name that appears in Undo/Redo menus, palettes, and lists. |
(static) tick2measure(tick)
The measure at a given tick in the score.
Parameters:
| Name | Type | Description |
|---|---|---|
tick |
Engraving.Fraction | Tick to search for the measure |
- Since:
- 4.6