A lot of piano music asks one hand to play two parts at once. A melody note is held while a line moves underneath it, or an alto part runs below the tune. On paper, the two parts are written as separate voices on the same stave: the upper voice with its stems pointing up, the lower voice with its stems pointing down, each with its own rests and beams.
Drawing that well is harder than it looks. Engravers have refined the conventions for it over a long time, and the standard reference, Elaine Gould’s Behind Bars, spends many pages on it. It matters for sight-reading in particular: if a stem runs through another note, or two rests sit on top of each other, you read it as a wrong note or a missing beat, and on a first reading you have no way of knowing better.
In November we put a lot of work into getting this right, and it’s what let us add the third and hardest book of Schäfer’s sight-reading exercises to the library. This post goes through what changed. Every comparison shows the same bars twice: as SightReader drew them before, and as it draws them now. The rings mark what to look at, and the numbers match the captions.
Stems that point the right way
The first convention is the simplest: in two-voice writing, the upper voice’s stems go up and the lower voice’s go down, whatever the notes would do on their own. Where a file didn’t say which way each voice should go, both voices got stems pointing up, and their beams ran from one voice into the other.

We now set the directions on every two-voice bar. The dots of two voices that start together line up as well, so they read as belonging together.
Where the voices cross, so the upper voice dips below the lower one, the two chords used to be drawn in the same spot, and a stem ran straight through a notehead of the other voice. An engraver would nudge the upper voice’s chord a little to the right, and that’s what SightReader does now.

Across the whole library, this change alone cleared 249 collisions and created none.
Rests that belong to their voice
Each voice has its own rests, and they sit with that voice: the upper voice’s rests high on the stave, the lower voice’s low. They used to be drawn on top of each other at times, so two rests looked like one, or they dropped well below the stave, away from the notes they belonged with.

Now each voice’s rests move away from the other voice, a space at a time, until they are clear.
Beams and stems
Stems have a natural length of about an octave, and a beam should lean only gently, sitting on or between the staff lines rather than floating in a space. Before, stems were all one fixed length, and sometimes a beam lay right across a notehead in the other voice.

Stem lengths and beam slopes now follow those rules, and a beam that would land on the other voice moves towards its own notes. In Book 3 we also beamed the voices with semiquavers beat by beat, as the printed edition has them, rather than across the whole bar.
Ties
Ties were the thing readers mentioned most. A tie should curve away from the stems, stop short of the next note’s accidental, and keep its arc off the staff lines, where it is easy to miss. Ours ran into the next note’s sharp, along staff lines and over barlines, and the ties in a chord were drawn on top of each other. Each tie now follows those conventions, and a chord’s ties are kept apart. We also found that a tie from one voice into the other was sometimes never drawn at all, and those are drawn now too.

Slurs and accidentals
A slur should pass over the notes it joins, never through them. Some of ours ran through a notehead or an accidental, most often a short slur over a higher middle note, which reads like a wrong note or a tie. A slur now lifts and eases its ends only as far as the notes need.
Accidentals are a smaller change, but they add up. Where a chord has several sharps or flats, printed music stacks them in a zig-zag, tucking each sign as close to the chord as it will go. SightReader used to give each one a column of its own, which pushed the chord away from the note before it. They now stack the printed way, and the room that saves goes back to the spacing of the bar.

Spacing
The last change is the one you notice without knowing why. In printed music, a note takes room according to its length, so a beat looks the same width wherever it falls, and the rhythm can be read at a glance. Before, bars were sized by how much ink they held and then stretched, so a beat could change width from bar to bar, and a dot or accidental in one hand could widen the gap in the other.

Now each note gets room by its length, never less than its ink needs, and each hand is spaced on its own while notes that start together stay lined up. Lines still break in the same places as before.
Schäfer’s Book 3 is in the library

All this work started because I wanted to add the third book of Christian Schäfer’s sight-reading exercises, which is full of two-part writing. It’s the hardest of the three books, with two voices in one hand throughout and keys up to four flats, and it’s now in the library with all 32 exercises. It’s part of Pro, and you’ll find it in Studies, alongside the rest of Schytte’s 25 Melodious Studies, which also arrived this month.
Why this is hard
SightReader draws its scores with OpenSheetMusicDisplay, a fantastic open-source library that reads MusicXML and engraves it with VexFlow. It does most of the work, and does it well: it lays out notes, clefs, keys, beams and lines so that the great majority of music comes out looking right, and SightReader couldn’t exist without it.
But a general-purpose engraver has to make a lot of choices locally, one voice and one note at a time, and on its own it doesn’t settle what happens when two voices share a stave. It doesn’t know that the other voice’s stem is in the way of this rest, or that this beam has landed on another note. Resolving that means looking at the whole bar at once and applying the rules engravers use, which is what the changes in this post do. They sit on top of OpenSheetMusicDisplay rather than replacing it, and to keep it that way we now run an engraving check over the whole library, so a change that makes things worse is caught before it ships.
There is more to do. If you spot a bar that still looks wrong, tap the flag on the piece and tell us which bar: those reports are how most of these problems were found. And if you’d like the rest of what changed this month, the November round-up has it all.
Bret