It looks like there's a bit of duplicated code between beam and tuplet. Perhaps we can factor out some of the common code into a static function? Or better still make it a completely separate function: e.g., Formatter.AlignRests(voice) -- the voice has all the notes (including rests), and AlignRests can be called by FormatAndDraw(...) or whatever custom formatter one uses.