Skip to main content

mscore3

A python library for opening/inspecting/modifying MuseScore3 files.

Installing

Currently only available from the PyPi repository. Make sure you have the "pip" Python package installer on your system, and run this:

$ pip install mscore3

If you don't have pip, you can install it on debian -based systems using:

$ sudo apt-get install python3-pip

Scripts

Installing this python package gives you the following command-line scripts:

  • ms-cleanup
  • ms-colorize
  • ms-concatenate
  • ms-copy-instrument
  • ms-create-template
  • ms-info
  • ms-port-partition
  • ms-stem

ms-cleanup

Removes unused elements from a MuseScore3 score.

May delete empty parts (which contain no notes in their measures). You can pass multiple file names, and only delete the empty parts which are common to all of the given scores. This is useful if you are working on a set of scores which will be concatenated using "ms-concatenate".

You can use this script to delete the "Synth" node in a score. This removes any reference to .sf2 soundfonts, useful if moving from SoundFont usage to .SFZ usage. Scores load quicker without a soundfont defined.

ms-colorize

Changes the staff colors. By default, staff colors are changed to a medium gray, allowing notes to stand out with lines still visible.

Unfortunately, there is no MuseScore style setting for these. This script works around that limitation.

ms-concatenate

Concatenates the measures from two or more scores into another score. The purpose of this script is to allow you to work on a section of a very long composition, without "lag" slowing you down. When MuseScore has to interpret and render a very long score, it gets a little slow. Breaking a long composition down into parts gets around that, making your composing experience more pleasant. Note that all sources MUST have the same part / instrument structure.

ms-copy-instrument

Allows you to copy an instrument definition from one score to another. This script will attempt to match the part name in both Source and Target, and copy the best matching part. You will be prompted to confirm the selection if there is no part name which matches exactly.

Useful if you have created a custom instrument which you would like to use in another score.

ms-create-template

Creates an empty score to use as a template from the given score. The created template is always saved in ".mscx" format. You can open it in MuseScore, and save it with an .mscz format from there.

ms-info

Show various information about a MuseScore3 score file.

Info available includes:

option what is shown
--parts part names
--instruments instrument names
--channels channel name, port, and channel numbers
--staffs the staff type, clef, and measure count
--length measure count
--meta tags, such as "composer", "copyright", and "creationDate"
--controllers the "volume", "pan" and other controllers set per channel
--channel-switches the "Staff Text" markups which change an instrument output channel

ms-port-partition

Re-assigns MIDI port/channels grouped by instrument. Every instrument's "voice" is assigned a sequential MIDI channel. If an instrument has more "voices" (arco, staccato, tremolo, etc.) than there remaining channels on a port, they are assigned to the next available port.

ms-stem

Exports each part to an individual audio file for mixing with a DAW.

Score "signatures" are saved after stemming, so that the next time this script is run, only parts which have changed since the last time are exported.

Programming API

Importing

The import name is "mscore". The package name is "mscore3", only because of a naming conflict in the pypi repository.

Usage

Setting the MIDI channel of a "Harp":

from mscore import Score

score = Score(argv[1])
for part in score.parts():
	if part.name == "Harp":
		for channel in part.channels():
			channel.port = 4
score.save()

Changing the "composer" tag on a bunch of scores:

from mscore import Score, is_score
from pathlib import Path

for path in Path().iterdir():
	if is_score(path):
		score = Score(path)
		score.meta_tag('composer').value = 'Monkey Johnson'
		score.save()

Use "pydoc" to get more details:

pydoc mscore

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mscore3-1.20.0.tar.gz (52.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mscore3-1.20.0-py2.py3-none-any.whl (59.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mscore3-1.20.0.tar.gz.

File metadata

  • Download URL: mscore3-1.20.0.tar.gz
  • Upload date:
  • Size: 52.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for mscore3-1.20.0.tar.gz
Algorithm Hash digest
SHA256 5ab8a7f644e0cf79199b81eb3487237176f1ef38ed762e8f5ac605e910b26a7f
MD5 9cf3212af95b3d546c69591560193413
BLAKE2b-256 094d457c394703a434befaaac5bc129879be118977e97738dee6b3d88f1e77f2

See more details on using hashes here.

File details

Details for the file mscore3-1.20.0-py2.py3-none-any.whl.

File metadata

  • Download URL: mscore3-1.20.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 59.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for mscore3-1.20.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d8993c3a10b87a16af94fbde0fe2cff4768ed194d3db7d9f71326350ab7d1bf2
MD5 8f1b6e17506a55af6878a7ae41d47fbf
BLAKE2b-256 87bbf2f61202de1d8aa04513d15807491885ed9db9bed75f5fb809c3faa38431

See more details on using hashes here.

Release history Release notifications | RSS feed

1.20.1

2 files

This release

1.20.0 This release

2 files

1.19.0

2 files

1.18.1

2 files

1.18.0

2 files

1.17.2

2 files

1.17.1

2 files

1.17.0

2 files

1.16.3

2 files

1.16.2

2 files

1.16.1

2 files

1.16.0

2 files

1.15.1

2 files

1.15.0

2 files

1.14.0

2 files

1.13.0

2 files

1.12.0

2 files

1.11.1

2 files

1.11.0

2 files

1.10.1

2 files

1.10.0

2 files

1.9.0

2 files

1.8.0

2 files

1.7.2

2 files

1.6.0

2 files

1.5.0

2 files

1.4.1

2 files

1.3.0

2 files

1.1.1

2 files

1.0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page