한국어로 읽기

[Easy Score dev note] Slurs That Stretch, Bars by Right-Click, and Shortcuts in the Margin

S now stretches a slur and Shift+S pulls it back, T ties and P makes tuplets, bars are picked by right-click, and the main shortcuts sit beside the score.

Easy Score in Notes mode: a faint column of boxed shortcuts in the left margin (A to G, dot, 2 to 7, numpad + −, 0, Ctrl and Shift with the arrows, S, T, P), beside the first bars of Amazing Grace

Easy Score got two rounds of feedback on December 1. The first moved a lot of keys. The second came a few hours later, after living with the first: one new key had no way back, one change got in the way, and the new shortcut list needed a better spot. This note covers both rounds, including the part I took back.

T ties, P makes tuplets

The last dev note taught T to turn a slur into a tie, but only right after S, because the rest of the time T made tuplets. A key with two jobs is a key you have to stop and think about, so the jobs are split now:

Key What it does
S Slur from the selected note to the next one (several selected: first to last)
S again Stretch that slur to the next note
Shift+S Pull it back one note; a two-note slur is removed
T Tie to the next note, which takes the same pitch. Right after S, the slur becomes a tie
P Tuplet (was T)

With a slur or tie selected, T still switches it between the two. Ctrl+Shift+S is still Save as.

S again stretches the slur

A slur over a long run used to mean selecting the whole run first. Now you select the first note and press S until the slur reaches the last one. Rests are skipped, and the slur crosses barlines.

The first round only had the stretch. One press too many meant deleting the slur and starting over, so the second round added Shift+S, which pulls the end back one note. When only two notes are left, Shift+S removes the slur and leaves the notes selected, so S makes it again.

The same two bars of Amazing Grace three times. After S, a slur joins the first G to the next B. After S three times, it reaches the B in the next bar. After Shift+S, it ends one note earlier, on the G.
S, S, S, then Shift+S: the slur grows one note at a time and pulls back the same way.

A slur is stored as the ids of its first and last notes. To find the next or previous note, the editor lines up one voice’s notes and rests from every bar in a single row and walks along it. Here is Shift+S, trimmed a little:

export function shrinkCurve(s: Score, curveId: string): Curve | 'removed' | null {
  const c = s.curves.find((x) => x.id === curveId);
  if (!c) return null;
  const flat = laneFlatOf(s, c.to); // this staff and voice, every bar, in order
  const i0 = flat.findIndex((r) => r.item.id === c.from);
  let j = flat.findIndex((r) => r.item.id === c.to) - 1;
  while (j > i0 && flat[j].item.kind !== 'note') j--; // step over rests
  if (j <= i0) {
    s.curves = s.curves.filter((x) => x.id !== c.id); // nothing left to join
    return 'removed';
  }
  c.to = flat[j].item.id;
  return c;
}

Stretching is the same walk in the other direction. Both work on the slur S just made or on a slur you click to select, so an old slur can be fixed the same way. Ties are left alone.

The Slurs mode is gone

Easy Score had a mode just for slurs and ties. With S, Shift+S and T in Notes mode, nothing was left that only the Slurs mode could do, so it’s gone. The modes are now F1 to F6: Notes, Barlines, Chords, Lyrics, Form and Bars.

Its one mouse gesture moved too. In Notes mode, drag a note and hold it right on top of another note: a band previews the slur between them, and letting go makes it. The notes stay where they were. Dropped anywhere else, a note still moves to that bar. To change or delete a slur or tie, click it.

Bars: right-click, not hover

In Notes mode, pointing at a bar used to highlight it and turn the cursor into a hand, and clicking empty space in a bar selected it so you could type A to G into it. The first round built on that: Shift+←→ to select more bars, Ctrl+C and Ctrl+V for whole bars, and dragging across bars to select a run.

The second round pointed at the real problem. A note is small and the bar around it is big, so most of the time the pointer is over a bar, not a note. The highlight kept saying “bar” while you were reaching for a note, and dragging notes got harder. A hover effect should make the next action easier, and this one made the most common action harder.

So bars wait for a right-click now:

  • Pointing at a bar shows nothing; the cursor stays an arrow.
  • Right-click a bar to select it. Shift+right-click another bar or press Shift+←→ to select a run.
  • Ctrl+C, then select another bar and press Ctrl+V: the copied bars are pasted from there, over as many bars as you copied.
  • Right-click a selected bar again for the bar menu: insert a bar, change the time or key from here, make it a pickup bar, clear it, delete it. That menu used to open on the first right-click.
  • Click empty space to clear the selection. Drag from empty space to draw a box around notes, which now works anywhere, on the staff too.
  • A pen or a finger has no right-click, so a tap on a bar still selects it.
The first line of Amazing Grace with bars 2, 3 and 4 shaded blue as one selection
Right-click bar 2, then Shift+→ twice: bars 2 to 4 are selected, ready for Ctrl+C.

None of this shows on the page, so the first right-click also brings up a one-time hint: Shift+←→ for more bars, Ctrl+C and Ctrl+V to copy, right-click again for the menu.

D.S. and Fine sit under the bar

D.S., D.C., Fine and To Coda used to be printed above the staff, where the chord symbols are. They now go under the bar, at its right end: under the last line of lyrics if the line has lyrics, or under the staff if it doesn’t. The segno and coda signs stay above, raised so they don’t run into chord diagrams.

Shortcuts beside the score

On a screen at least 1100 pixels wide, Notes mode now lists the main shortcuts in the left margin: the twelve in the picture at the top, the ones worth knowing in your first hour. In the first round they were a panel fixed to the left edge of the window. The second round asked for them in the middle of the margin, a little below the top, faint until you point at them, with every shortcut in its own box.

The guide sits inside the scrolling area, so it scrolls away with the page instead of following you down. Its position is plain CSS. --page-w is the page’s width, set from React, and 100% is the width of the scrolling area.

.canvas-wrap.with-keys .page {
  /* centered when there's room, otherwise pushed right to make room for the guide */
  margin-left: max((100% - var(--page-w)) / 2, var(--kg-w) + 40px);
}
.key-guide {
  position: absolute;
  top: 40px;
  /* the middle of the left margin: a quarter of the leftover width */
  left: max(20px, (100% - var(--page-w)) / 4 - var(--kg-w) / 2);
  width: var(--kg-w);
  opacity: 0.5;
}
.key-guide:hover,
.key-guide:focus-within {
  opacity: 1;
}

On a smaller laptop where the margin is narrower than the guide, the page moves right instead of the guide covering it. The pitch rows follow the setting “Pitch keys move by semitones”, so the guide always matches what the keys do. The × hides it, and “Main shortcuts beside the score” in Settings brings it back.

Try it

Open Easy Score, select a note, press S a few times, then Shift+S. Then right-click a bar. If right-clicking is awkward for you, or the guide gets in your way, write to me at inyourcareallen@gmail.com.

Written by

Allen

Independent app developer in South Korea. I write about the apps I make, the piano I practice, the anime I watch, and a fantasy world I'm building.

More from Practical Trivia