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_scoreFeed a musicxml string directlymusic_score_fileRead a file. It loads it first with music21. Accepts any file format that music21 acceptsmusic_score_streamParse 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 (default540).key: Optional Streamlit widget key.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c03525f466e811ccd6f8ebc0fea76a866c79fd56595a5036a16a3f5ffeb07027
|
|
| MD5 |
5810a8183187c44af1fc3aeed0e1e742
|
|
| BLAKE2b-256 |
fbb04c652c49e24538aa5e272ee69ffbf157a4f95b4bc3764eafaf9e8acbba4e
|
File details
Details for the file streamlit_music_score-1.0.0-py3-none-any.whl.
File metadata
- Download URL: streamlit_music_score-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcf0053a61330f1ffd594a00abf7eea040416ad16a74ece4d3358be735bf809a
|
|
| MD5 |
b4dafd73123673017ee8f36016f9c19a
|
|
| BLAKE2b-256 |
80d69a8011c33437fd7f6f8719e175dfe25932bef3bfd5cbbcdc9701df28674b
|