cifkao / html-midi-player

🎹 Play and display MIDI files on the web
https://cifkao.github.io/html-midi-player/
BSD 2-Clause "Simplified" License
630 stars 56 forks source link

Allow staff visualizers to be split into multiple lines #79

Open Cheezer1656 opened 3 months ago

Cheezer1656 commented 3 months ago

Added a line parameter to the midi-visualizer element that determines how many lines the notes are split into.

Also updated some packages to fix some vulnerabilities.

cifkao commented 2 months ago

Looks like a cool contribution. Do you have a demo I could look at?

Also, please don't update yarn.lock/package-lock.json in the same PR. These are long diffs and it's hard to see what's going on there. I would prefer if you could make an issue listing what needs to be updated and why, and I can take care of it.

Cheezer1656 commented 2 months ago

Sure! I removed the yarn.lock and package.lock changes and added an example of the multi-lined visualizer to the demo (index.html). Is this ok?

cifkao commented 1 month ago

Sorry, it took me a while to get around to this! Thanks for the demo, I now see better what this is doing.

I agree it would be useful to have the staff visualizer split into multiple lines. However, I see a couple of issues with the approach:

In short, it seems intricate to do this right and it would require some interaction with the actual score rendering logic, which is not accessible from here. Therefore I think it would be preferable to add this feature directly to staffrender, which is what is used to render the scores. I think it's better to keep the visualizers here as thin wrappers around the ones defined in @magenta/music (unless we fully implement a new visualizer type here, which would also be fine).