Blog

Improving multi-voice engraving in SightReader

When one hand plays two parts at once, the music has to be drawn carefully or it reads as wrong notes. What we changed in November, with before-and-after examples, and Schäfer’s Book 3 arriving in the library.

Bret Cameron
Founder of SightReader · 26 November 2026 · 8 min read
One bar of Schäfer’s Book 3, Exercise 24, drawn twice: on the left, the beams run from one voice into the other; on the right, each voice has its own beam

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.

Bars 6 to 8 of Schäfer’s Book 3, Exercise 24, before and after: above, the two voices’ rests are drawn as one and the beams in bar 7 join notes from both voices; below, each voice has its own rest and the upper voice’s quavers share one beam above the lower voice’s chords
Book 3, Exercise 24, bars 6 to 8. Top: before. Bottom: now. 1: the two voices’ rests, drawn as one. 2: beams joining notes from different voices.

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.

Bars 12 to 14 of Book 3, Exercise 26, before and after: above, the right hand’s two voices share stems and run together; below, the upper voice’s stems go up and the lower voice’s go down
Book 3, Exercise 26, bars 12 to 14. Top: before. Bottom: now. 1 and 2: the right hand’s two voices, drawn apart.

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.

Bars 1 and 2 of Book 3, Exercise 24, before and after: above, the left hand’s crotchet rests hang below the bass stave; below, they sit between the staves, above the left hand’s notes
Book 3, Exercise 24, bars 1 and 2. Top: before. Bottom: now. The left hand’s rests, back beside its notes.

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.

Bar 6 of Book 3, Exercise 24, close up, before and after: on the left, the lower voice’s beam slopes steeply down through the space beside the other voice; on the right, it sits flatter and clear of it
Book 3, Exercise 24, bar 6, close up. Left: before. Right: now. The lower voice’s beam, clear of 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.

Bars 4 to 6 of Book 3, Exercise 12, before and after: above, the left hand’s beams and ties are tangled across its voices; below, each voice is drawn on its own and the held notes are tied
Book 3, Exercise 12, bars 4 to 6. Top: before. Bottom: now. 1 and 2: the left hand’s voices, untangled.

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.

The left hand’s chord in bar 15 of Book 3, Exercise 8, close up, before and after: on the left, its three accidentals stand in three separate columns; on the right, they are stacked closer to the chord
Book 3, Exercise 8, bar 15, close up. Left: before. Right: now. Three accidentals, stacked the way a printed edition stacks them.

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.

Bars 13 and 14 of Book 3, Exercise 29, before and after: above, the quaver chords in bar 13 bunch unevenly; below, they are evenly spaced
Book 3, Exercise 29, bars 13 and 14. Top: before. Bottom: now. The quavers of bar 13, given even room.

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

Schäfer’s Book 3 open in the Studies library: the title page on the left and the first ten of its 32 pieces on the right

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

Bret Cameron
Bret founded SightReader. He's a software engineer learning piano on the side, and he started the project after failing to find a sight-reading tool that did what he needed.

Keep reading