Skip to main content

Streamlit helper to render MusicXML scores using OpenSheetMusicDisplay

Project description

streamlit-music-score

Render MusicXML scores inside Streamlit using the OpenSheetMusicDisplay (OSMD) library.

You have three methods:

  • music_score Feed a musicxml string directly
  • music_score_file Read a file. It loads it first with music21. Accepts any file format that music21 accepts
  • music_score_stream Parse a music21 object. Useful if you are doing transformations with music21 and just want to visualize the result.

OSMD play functionality is only available for sponsors at the moment. As soon as it is released to the public this demo will be updated also to include play controls.

Quickstart

python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cd 
streamlit run example_app.py

The demo loads the sample score at examples/twinkle.musicxml and lets you upload your own MusicXML.

Usage

from streamlit_music_score import music_score, music_score_file, music_score_stream

xml = "<score-partwise>...</score-partwise>"  # MusicXML string from music21
music_score(xml, height=540)

API

  • score_xml: MusicXML string (UTF-8).
  • height: Pixel height for the component (default 540).
  • key: Optional Streamlit widget key.

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

streamlit_music_score-1.0.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

streamlit_music_score-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_music_score-1.0.0.tar.gz.

File metadata

  • Download URL: streamlit_music_score-1.0.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for streamlit_music_score-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c03525f466e811ccd6f8ebc0fea76a866c79fd56595a5036a16a3f5ffeb07027
MD5 5810a8183187c44af1fc3aeed0e1e742
BLAKE2b-256 fbb04c652c49e24538aa5e272ee69ffbf157a4f95b4bc3764eafaf9e8acbba4e

See more details on using hashes here.

File details

Details for the file streamlit_music_score-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_music_score-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bcf0053a61330f1ffd594a00abf7eea040416ad16a74ece4d3358be735bf809a
MD5 b4dafd73123673017ee8f36016f9c19a
BLAKE2b-256 80d69a8011c33437fd7f6f8719e175dfe25932bef3bfd5cbbcdc9701df28674b

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