Menu

Let the Score Meter Set the Count-In, Not Just the Label
📰

Let the Score Meter Set the Count-In, Not Just the Label

DEV Community: typescript·Giang Pham Truong·16 days ago
#X27OrHsV
#devtotypescript#devto#dev#count#measure
Reading 0:00
15s threshold

I build Pianory, a browser-based piano practice app. AI helped draft this article; I checked the implementation claims against the current source.

A 2/4 score has two quarter-note beats per complete bar. If the player displays 2/4 but schedules four count-in clicks, the entrance cue contradicts the score. The meter needs to reach the click scheduler, not just a label.

In Pianory's score adapter, each measure contributes its active time signature. If the source has none, the adapter falls back to [4, 4]. The timeline converts a signature into a beat count and the length of each beat in quarter-note units. For [2, 4], the conversion is { beats: 2, beatQuarters: 1 }. Each measure span stores that result.

The click grid steps through a measure by beatQuarters and marks the first beat of a complete bar as accented. Pickups are handled separately: a short opening measure aligns its clicks from the end of that measure rather than pretending it is full length.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.