Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redraws a bird-view under the component when key is specified. #8

Open
WojciechMat opened this issue Apr 13, 2024 · 0 comments
Open

Comments

@WojciechMat
Copy link

WojciechMat commented Apr 13, 2024

NOTE: Specifing key in below context is not advised, component works as expected when key is None (default).

When key is specified and the data changes in streamlit_pianoroll.from_fortepyan, component duplicates drawings.

import streamlit as st
import streamlit_pianoroll
from datasets import load_dataset
from fortepyan import MidiPiece


def main():

    midi_dataset = load_dataset("roszcz/maestro-sustain-v2", split="test")
    record_id = st.number_input("record id", value=0)
    record = midi_dataset[record_id]
    
    piece = MidiPiece.from_huggingface(record=record)

    streamlit_pianoroll.from_fortepyan(piece=piece, key="0")


if __name__ == "__main__":
    main()

(after changing record id several times)
image
...

@WojciechMat WojciechMat changed the title Redrawing a bird-view under the component when key is specified. Redraws a bird-view under the component when key is specified. Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant