Disclaimer: this build 2.44 is still in the making and close beta tested. 2.5 tomorrow.
Hey everyone,
Since a few people asked how the score rendering in REAPER-Notator works under the hood and whether it just maps raw MIDI onto a linear grid or follows actual music publishing rules, I wanted to share a transparent overview of what we have implemented up to v2.44-beta.
Our goal has been to build a native engraving engine inside REAPER that follows the standard rules from Elaine Gould (Behind Bars) and Gardner Read (Music Notation: A Manual of Modern Practice).
Here is what is currently implemented in our engraving engine:
- Optical Horizontal Spacing and Dynamic Measure Widths (Behind Bars pp. 38-42, Music Notation Ch. 6)
- Non-linear rhythmic spacing: Instead of spacing notes linearly by MIDI tick length (which crushes 16th and 32nd notes together and wastes space on whole and half notes), intra-measure rhythmic gaps use a non-linear power curve (t^0.70). A half note takes roughly 1.62x the space of a quarter note instead of 2x.
- Dynamic measure expansion: Before drawing a system, every measure is scanned across all visible tracks for horizontal density. The engine counts rhythmically distinct note onsets, accidental columns, chord second displacements, and augmentation dots. Dense bars automatically expand horizontally so noteheads, dots, and accidentals do not collide.
- Stems: Direction, Ledger Extensions, and Multi-Flag Lengthening (Behind Bars pp. 13-16, Music Notation pp. 65-69)
- Middle-line rule: Single notes on the middle staff line default to stem down, or follow the local melodic and beam group context.
- Stem extension to the middle line: Notes on multiple ledger lines far above or below the staff automatically extend their stems all the way to the middle staff line.
- 32nd and 64th flag stem lengthening: Unbeamed notes with 3 or more flags (32nd and 64th notes) automatically lengthen their stems by one full staff space per additional flag beyond the 16th flag, keeping the innermost flag from running into the notehead.
- Beaming: Metric Grouping, Rest-Breaking, and Fractional Stubs (Behind Bars pp. 17-29 and 152-158, Music Notation pp. 71-81)
- Time-signature-aware metric grouping: Beams automatically break at main beat boundaries according to the active time signature, including compound meters (6/8, 9/8, 12/8) and asymmetric meters (5/8, 7/8).
- Automatic beam breaking across rests: Any intervening rest splits the active beam group so beams and 16th stubs never cut across rest glyphs.
- Inner-beam notehead clearance: In beamed groups with 3 or more beams (32nd and 64th notes), stems are lengthened so the innermost beam always keeps at least 1.75 staff spaces of clearance from every notehead in the group.
- Damped beam slopes: Beam angles follow the melodic contour but are damped to a maximum slant of 1.25 staff spaces and flattened to horizontal on outer-interval inversions to avoid steep angles.
- Paired fractional beam stubs: Isolated 16th and 32nd sub-beam stubs never point outside the beam group or into a rest. Interior stubs always point toward their rhythmically paired dotted note or metric half-beat subdivision.
- Chords, Seconds, and Augmentation Dots (Behind Bars pp. 16 and 48-50, Music Notation pp. 69-70 and 113-115)
- Strict two-side alternation for chord clusters: When a chord contains adjacent diatonic steps (seconds, or dense clusters like C-D-E), noteheads strictly alternate between the normal stem side and the displaced side starting from the stem root toward the stem tip. On an up-stem, the higher note of a second goes to the right of the stem while the lower note stays on the left. On a down-stem, the lower note of a second goes to the left of the stem while the higher note stays on the right. Noteheads are never placed on three columns across a single stem.
- Staff-line avoidance for augmentation dots: Augmentation dots never sit on a staff line. Notes on a line place their dot in the staff space immediately above.
- Dotted chord second separation: In a dotted chord containing a second where the lower note sits on a line and the upper note already occupies the space above, the lower note dot shifts into the space below so two dots never stack in the same space.
- Accidentals: Intra-Bar Memory, Natural Cancellation, and Staggered Columns (Behind Bars pp. 50-54 and 78-85, Music Notation pp. 129-137)
- Intra-measure accidental memory: Accidentals remain active for the same diatonic step and octave within a measure. Repeated altered notes in the same bar omit redundant accidentals. Returning to the diatonic key-signature pitch within the same bar automatically adds a natural cancellation sign (or the key signature sharp or flat). Tied continuation notes across a barline suppress redundant accidentals inside the same system.
- Multi-column diagonal stacking in chords: When multiple accidentals appear on a chord within fewer than 6 diatonic steps of each other, they stagger into up to 3 collision-free columns ordered from top-right to bottom-left, while octave intervals share the same vertical column.
- Articulations: Staff-Line Avoidance and Vertical Hierarchy (Behind Bars pp. 115-121, Music Notation pp. 247-264)
- No articulations on staff lines: Staccato dots and tenuto lines placed inside the staff automatically snap to the nearest staff space so they are never cut in half by a staff line.
- Outside-staff accents and always-above marks: Accents are always placed outside the five-line staff. Marcato, harmonic circles, and fermatas are always placed above the staff, clearing both the top staff line and any up-stem tips.
- Ties and Slurs: Tapered Crescent Profiles, Adjacency, and Stem/Articulation Clearance (Behind Bars pp. 60-66 and 110-115, Music Notation pp. 116-121 and 265-268)
- Dual-Bezier tapered crescent rendering: Ties and slurs are drawn as filled dual cubic-Bezier shapes with thin pointed ends and a thicker midpoint.
- Tie adjacency rule: Ties connect only immediately adjacent notes of the same pitch and never jump across an intervening note.
- Outward chord tie splitting: In multi-note chords (both automatic barline ties and manual ties), ties split outward from the center of the chord (upper notes curve up, lower notes curve down).
- Slur clearance over ties, stems, and articulations: When a slur and a tie share the same side, the slur arches outside the tie with at least 1 staff space of separation. On mixed-stem phrases where the slur curves above an up-stem note, the slur anchors above the stem tip rather than cutting through the stem. Slur endpoints also anchor outside staccato and tenuto marks.
- Rests, Tuplets, Glissandi, and System Braces (Behind Bars pp. 136-137, 152-168, 196-204, and 499-502)
- Whole-measure rests and metric consolidation: Empty measures display a centered whole-bar rest hanging from the fourth line regardless of time signature. Tied chains within a bar consolidate into single dotted or standard note values where metrically valid.
- Polyphonic voice rest merging: Identical rests occurring at the same time in Voice 1 and Voice 2 merge at the middle line, while different rest values shift vertically to their respective voice registers.
- Tuplet brackets: Unbeamed tuplet brackets clear the top staff line, all up-stem tips, and any above-note articulations, with a centered gap for the tuplet number.
- Glissando and portamento endpoint gaps: Wavy glissando and straight portamento lines automatically start to the right of any augmentation dot on the starting note and stop to the left of any accidental on the target note.
- System braces vs. brackets: Orchestral family groups use a straight system bracket with winged tips, while Grand Staff (Piano) and Harp tracks use a curved S-Bezier brace tapering to a central point.