Skip to content

Quarter-note (crotchet) triplets cannot be created from the UI — tuplet buttons require pre-existing same-duration notes #301

Description

@MaximeTuab

Wording note: "quarter-note triplet" (US) / "crotchet triplet" (UK) — three quarter notes in the time of two.

Summary

Quarter-note triplets cannot be created from the editor UI, even though the data model, imperative API, and tuplet validation all support them. The toolbar tuplet controls only work when three consecutive same-duration notes already exist, and the pre-conversion footprint of three quarter notes (3 beats) frequently does not fit the space where the resulting triplet (2 beats) would — so a quarter-note triplet is effectively unreachable from the UI.

What already works (verified against the shipped alpha.16 bundle)

  • The model supports any tuplet base: ScoreEvent.tuplet.baseDuration (index.d.ts ~123-127).
  • makeTuplet(numNotes, inSpaceOf) / applyTuplet(ratio, groupSize) infer baseDuration from the selected event (index.js ~20016, ~11219).
  • Validation accepts a quarter base: isValidTupletRatio("quarter", [3,2]) is true (span = NOTE_TYPES.quarter.duration 16 × 2 = 32 quants, an integer) — identical acceptance to eighth. So api.makeTuplet(3, 2) over three selected quarter notes does produce a quarter-note triplet.

So this is a UI-entry gap, not a model/validation limitation.

The UI gap

  • The only tuplet affordances are the toolbar Triplet (3:2) and Quintuplet (5:4) buttons (TupletControls, index.js ~17606), each dispatching a fixed ratio with groupSize 3 / 5.
  • canApplyTuplet(groupSize) (index.js ~11292) enables them only when eventIndex + groupSize <= events.length and the next groupSize events are uniform (isUniformTupletSelection). Base duration is taken from the selection.
  • Net: the only route to a quarter-note triplet is "enter 3 quarter notes → select the first → Triplet". Those 3 quarter notes occupy 3 beats of un-tupleted footprint, which often will not fit the available space even though the resulting 2-beat triplet would. For eighth-note triplets the pre-footprint (1.5 beats) is small, so it usually fits — which is why eighth triplets are practically reachable and quarter/half triplets are not.

Requested enhancement

A duration-first tuplet entry: choose a base duration (e.g. quarter) → Triplet → fill the reserved span with 3 notes — so the tuplet reserves only its own footprint (2 beats) rather than requiring the full un-tupleted group (3 beats) to pre-exist. The reserved trailing tuplet slot mechanism (#242) may already provide part of the machinery for this.

Environment

  • riffscore@1.0.0-alpha.16 (current latest).

Context

We embed RiffScore as the score editor in a jazz lead-sheet app; quarter-note triplets are common in jazz melodies, and curators currently cannot notate them on the staff.


Disclosure: investigated with an AI coding assistant (Claude Code) against the shipped alpha.16 package; reviewed and filed by me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions