OSMD 1.9.0 brings courtesy accidentals and many other improvements!

OSMD 1.9.0 was just released and brings many improvements like courtesy accidentals, as the changelog shows. Let’s give you an overview of the changes:

Courtesy Accidentals are now shown

A courtesy accidental (♭) in measure 12, which helps the musician remember that the natural accidental (♮) in measure 11 is automatically cancelled at the end of the measure, and the key signature’s flat accidental is in force again.

Courtesy accidentals were tricky to handle in OSMD, because you can transpose the score at any time, and obviously a flat (♭) courtesy accidental doesn’t make sense when the note was transposed to a sharp (♯) accidental.
But now we handle courtesy accidentals differently when the score is not transposed, allowing us to show them as given in the MusicXML file.

Set the number of measures per line / staff

You can now make OSMD render 4 measures per line, for example:

OSMD options set to render no more than 4 measures per line

This is achieved by setting the following option:

osmd.EngravingRules.RenderXMeasuresPerLineAkaSystem = 4;
osmd.render();

Note that if there is not enough space for 4 measures, OSMD can break the line / system beforehand. If you still want exactly 4 measures per system and not less, consider reducing the zoom (osmd.Zoom).

Note: The terminology for the “line” is a bit confusing: We intuitively think of lines and line breaks, like lines in a book or on a website. In music, this is usually called a staff or a system, though the term system doesn’t seem to be found commonly. In OSMD, we call this unit a MusicSystem. But we think that the most intuitive term for developers is “line”.

Tabs: 3-string instruments are now supported

OSMD can now show 3-string tabs (tablature):

The (Cuban) Tres is a 3-course (3 sets of 2 strings) guitar originating from Cuba.

This was previously not supported in Vexflow, but now renders correctly.
We had not encountered a 3-staffline score before, but the OSMD community always surprises us with new scores!
On that topic, if you have a 2-staffline tab score for us, we would love to test it in OSMD, so feel free to open an issue on Github or comment below this 3-staffline comment!

The End – not!

There are quite a few other improvements in 1.9.0, again, see the changelog for a complete list.
But we are of course not done here, as we keep improving OSMD, with a 1.9.1 release on the horizon.

In our public OSMD demo, we have added a button to enable dark mode – try it out! You can also open the demo with dark mode enabled by default with this link, which we added after a user requested a dark mode sheet music viewer for their seeing impaired brother.

In the demo, we have also fixed an issue where re-rendering or changing settings like dark mode scrolled the page to the top of the screen, which could be annoying when you scrolled the page manually beforehand. Now, the same (relative) scroll position is maintained, and to the human eye, there is usually no scrolling noticeable during re-rendering.

So, stay tuned for the next changes, and please keep giving us feedback and suggestions, e.g. via Github, our contact form, or our Discord chat server, where more and more developers discuss programming and using OSMD for their projects or websites every day. Especially for developers, you’ll find a lot of tips for using OSMD there, including example code.

If you find our work to make sheet music open for everyone valuable, please consider sponsoring us on Github – thank you very much! This will also give you access to our audio player, which enables OSMD to play the score interactively. You can try it on our demos page. We’ve also recently added many improvements to it, like being able to start playback from or set the position to a time in milliseconds, which now also correctly includes repetitions.

And that’s it for this update, we hope you enjoy using OSMD!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top