85 comments
adrianh · 20 days ago
Impressive hack — kudos from a fellow sheet music software developer!

I've spent more than 10 years now building Soundslice, which does web-based sheet music rendering. I believe we were the first to do "responsive" web notation (that part of the site launched in 2014).

Here's a tech talk I gave with a lot of details: https://www.youtube.com/watch?v=XH5EtQge_Bg

Here's an example of responsive Soundslice notation: https://www.soundslice.com/slices/zzNlc/ (in the settings, set the stave width to maximum to get "Fit to screen" for the true responsive effect)

We've got a whole suite of tools built around this, including an excellent web-based editor, rich practice functionality and a relatively new scanning feature (extracting the musical data from a photo or PDF).

I agree with other commenters here that this CSS Grid approach could be handy for lightweight projects but it likely isn't up to snuff for the incredibly subtle and complex world of full scores. With that said, I just want to stress again that this is super cool and I'm glad it exists!

Show replies

vintagedave · 20 days ago
This is extraordinary. While JavaScript is needed now, I’d encourage the author to see what needs to be added to CSS to allow a CSS-only solution, and promote it in the CSS community. For example, repeating the clef when wrapping is akin to a sticky table header, and would have more applications than only music.

Some CSS notation is wholly new to me:

> .stave > [data-pitch^="A"][data-pitch$="5"] { grid-row-start: A5; }

I’ve never seen CSS selectors with square brackets before. Apparently it’s an attribute selector: https://css-tricks.com/attribute-selectors/

Show replies

thrtythreeforty · 20 days ago
I started the article thinking "ohhh the horror, this will not go well." And I ended up being mildly impressed with the typesetting quality, especially for the relative simplicity of the approach. So kudos to the author for demonstrating the flexibility of CSS.

I am concerned that there are lots of edge cases, essentially ligatures for engraving, that might not compose so well. A triad, or the author's called-out relative head spacing of 8th and 16th notes, or letting the program align different parts across different grids - would this also work well? Lilypond has proven to be exceptionally flexible for these kinds of complexities.

Show replies

alnvdl · 20 days ago

Show replies

spankalee · 20 days ago
This is very cool! Like the author, I'm pretty impressed that just CSS can get you this far.

I'm very excited to see the <scribe-music> custom element too! I had an intern work on wrapping VexFlow with web components a few years back, but the summer ended before everything was finished, and it hasn't been maintained: https://github.com/PolymerLabs/vexflow-elements/blob/web-com...

A maintained and easy-to-use library could do a lot of good for music notation on the web.

Show replies