Mus_Sim_1-beta / sim /notation_component.py
adisha1971's picture
Upload 9 files
7700c61 verified
Raw History Blame Contribute Delete
538 Bytes
from __future__ import annotations
import streamlit.components.v1 as components
from sim.notation_svg import grand_staff_svg
def notation_staff(chord_midi, prefer_sharps: bool = True):
"""
Offline notation renderer (no CDN).
Generates an SVG grand staff for the chord and embeds it via components.html.
"""
svg = grand_staff_svg(list(chord_midi), prefer_sharps=prefer_sharps)
nonce = "_".join(str(int(x)) for x in chord_midi)
components.html(svg + f"<!-- vf_offline_{nonce} -->", height=270, scrolling=False)