Skip to main content

A parser for MuseScore files, serving as data factory for annotated music corpora.

Project description

GitHub PyPI GitHub Release Date GitHub repo size

ms3 - Parsing MuseScore 3 and 4

Welcome to ms3, a Python library for parsing MuseScore files.

Statement of need

Here comes a list of functionalities to help you decide if this library could be useful for you.

  • parses MuseScore 3 and 4 files, dispensing with lossy conversion to musicXML. The file formats in question are

    • uncompressed *.mscx files,

    • compressed *.mscz files,

  • extracts and processes the information contained in one or many scores in the form of DataFrames:

    • notes (start, duration, pitch etc.) and/or rests,

    • measures (time signature, lengths, repeat structure etc.)

    • labels, such as

      • guitar/Jazz chord labels

      • arbitrary annotation labels

      • expanded harmony labels following the DCML annotation standard

      • cadences (part of the same annotation syntax)

      • form_labels (annotation standard currently in press)

    • chords, that is, onset positions that have musical markup attached, e.g. dynamics, lyrics, slurs, 8va signs…

    • metadata from the respective fields, but also score statistics, such as length, number of notes, etc.

  • stores the extracted information in a uniform and interoperable tabular format (*.tsv)

  • writes information from tabular *.tsv files into MuseScore files, especially

    • chord and annotation labels

    • metadata

    • header information (title, subtitle, etc.)

    • note coloring

  • uses a locally installed or standalone MuseScore executable for

    • batch-converting files to any output format supported by MuseScore (mscz, mscx, mp3, midi, pdf etc.)

    • on-the-fly converting any file that MuseScore can read (including MuseScore 2, cap, capx, midi, and musicxml) to parse it

  • offers its functionality via the convenient ms3 commandline interface.

View the full documentation here.

For a demo video (using an old, pre-1.0.0 version) on YouTube, click here

Installation

ms3 requires Python >= 3.10 (type python3 --version to check). Once you have switched to a virtual environment that has Python 3.10 installed you can pip-install the library via one of the two commands:

python3 -m pip install ms3
pip install ms3

If successful, the installation will make the ms3 commands available in your PATH (try by typing ms3).

Quick demo

Parsing a single score

import ms3
score = ms3.Score('musescore_file.mscz')

Parsing a corpus

import ms3
corpus = ms3.Corpus('score_directory')
corpus.parse()

Parsing several corpora

import ms3
corpora = ms3.Parse('my_research_corpora')
corpora.parse()

Making Changes & Contributing

This project uses pre-commit to ensure code quality. If you are a developer, please make sure to install it before making any changes:

cd ms3
pip install -e ".[dev]" # includes "pip install pre-commit"
pre-commit install

Acknowledgements

Development of this software tool was supported by the Swiss National Science Foundation within the project “Distant Listening – The Development of Harmony over Three Centuries (1700–2000)” (Grant no. 182811). This project is being conducted at the Latour Chair in Digital and Cognitive Musicology, generously funded by Mr. Claude Latour.

Project generated with PyScaffold

Project details


Download files

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

Source Distribution

ms3-2.2.1.tar.gz (10.0 MB view details)

Uploaded Source

Built Distribution

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

ms3-2.2.1-py3-none-any.whl (329.5 kB view details)

Uploaded Python 3

File details

Details for the file ms3-2.2.1.tar.gz.

File metadata

  • Download URL: ms3-2.2.1.tar.gz
  • Upload date:
  • Size: 10.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for ms3-2.2.1.tar.gz
Algorithm Hash digest
SHA256 842b258fb152bee3b28e2065a5f71ee334ee9cd255cd0e1778e9cee18d64b17c
MD5 34e0cacf816f2479dba43bb9ddee1a38
BLAKE2b-256 dfc5ce7fee8dc5549021c33d4e100093da7e6d8eea31fb5a05a06a5b4fc19e60

See more details on using hashes here.

File details

Details for the file ms3-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: ms3-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 329.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for ms3-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba6170704a816dd9e12741c7960658c85e2c167307395b3f62b110e77dbed3b8
MD5 7a3412cca29235b25cc8348e41edd9d5
BLAKE2b-256 73364da3ea6bd9ee3aff814dbf4ffd0c3c79e92d4f1c9534750e7db304713cda

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page