Tempo Lock · Food for Thought
After the Click Cuts Out
The game begins with a click that marks the tempo, then that click falls silent, and the player must keep tapping the same tempo through the silent bars.
The Structure of a Round
A round in Tempo Lock is built from a target that specifies four things: a beats-per-minute value for the tempo, a count of bars during which the click plays, a count of silent bars to follow, and the beats-per-bar value, the time-signature numerator. The engine uses these fields to construct the entire round from the first audible beat through the last silent beat. The tempo sets the pace of the click, the audible bars determine how long the player hears the metronome, and the silent bars set the challenge of holding that tempo without the click. The beats-per-bar value defines how many beats occur in each bar, and the game sets it to 4, common time, in every round.3
The engine calculates several derived values from the target to support the scoring system. It computes the beat length as sixty thousand divided by the tempo, which gives the duration of a single beat in milliseconds. It computes the total beat count as the sum of audible and silent bars multiplied by the beats per bar, which gives the total number of beats the player must tap through. It computes the silent start as the audible bars multiplied by the beats per bar, which marks the exact beat index where the click stops playing. These derived values form the mathematical foundation for the entire round.3
The Click and the Silence
The click is the audible signal that establishes the tempo for the round. It plays at the target tempo for the duration of the audible bars, marking each beat with a short sound. This click functions as a metronome, producing an audible sound at a uniform interval, though here the interval is set by the round’s target rather than by the player. A four-beat count-in plays first, and the first beat of each bar gets a higher-pitched click. Musicians use a metronome to play or practise in time, keeping a steady tempo and a regular beat. The click in the game serves this same function during the audible phase, providing a reference point for the player to match with their taps.2
When the audible bars end, the click cuts out completely. The player no longer hears the metronome and must continue tapping at the same tempo through the silent bars. This silence creates the core challenge of the game, as the player must hold the tempo in their mind without the external reference. The silence is not empty; it is filled with the memory of the tempo and the player’s attempt to maintain it. The score will later measure how well the player held that tempo during the silence.3
Raw Timestamps and Determinism
The engine operates entirely from raw tap timestamps measured in milliseconds. Each tap is recorded as an absolute time value, and all calculations derive from these timestamps together with the target. The same sequence of tap timestamps always produces the same result, which makes the engine deterministic and testable without a clock. This approach removes any ambiguity from the timing calculations and ensures that the scoring is consistent across different runs with the same inputs.3
The scoring functions in the engine take raw tap timestamps in milliseconds together with the target as their inputs. This design means that the engine can be tested with predetermined sequences of timestamps, and the outputs can be verified without needing to run the game in real time. The determinism extends to the seeded random number generator that picks the target tempo for each round. A given seed and difficulty set the same target every time, and every rule is testable from that point forward.3
Recovering Tempo from Taps
The engine recovers a tempo estimate from the average interval between consecutive taps. It calculates the inter-tap intervals, which are the time differences between each tap and the one before it, and then computes their average, skipping any interval that is zero or negative; with fewer than two taps it reports no tempo at all. The beats-per-minute value is derived from this average interval, giving a measure of the tempo that the player maintained during the tapped sequence. This function operates independently of the target tempo and provides an objective measurement of the player’s actual performance.3
The recovered tempo is shown on the result screen as “Your tempo” beside the target, so the player can see how closely they matched the intended pace. The calculation works from the raw timestamps alone, across every recorded tap, audible and silent. It is reported for information only: the score itself is computed from drift, not from the recovered tempo.3
Measuring Drift from the Grid
The scoring system rewards the player for keeping their taps close to the ideal metronome grid during the silent phase. The ideal grid consists of the beat positions that would occur if a metronome started on the player’s first tap and kept going at the target tempo. Each tap is matched to the nearest ideal beat position, and the difference between them represents the drift for that tap. Only taps whose nearest beat falls in the silent phase count, and because each is matched to its nearest beat, no single tap can drift by more than half a beat. Every silent-phase beat left without a tap is charged as a half-beat miss, the worst case, and folded into the same average, so skipping beats pushes the average drift up and the score down, and a player who taps nothing in the silence scores zero.3
This drift-based approach turns holding a tempo into a measurable quantity. The engine does not simply check whether taps fall within some window; it measures the precise deviation from the ideal positions. A perfect hold, with zero average drift, scores 1000, and the score falls in a straight line to 0 at an average drift of a quarter of a beat, so lower drift always produces a higher score. The scale is measured in beats rather than milliseconds, so it means the same thing at every tempo: at 120 beats per minute a quarter beat is 125 milliseconds, at 80 it is 187.5. A quarter beat is also what tapping at random averages, so random tapping earns roughly nothing. The result screen still reports the average drift in milliseconds, and turns the score into a verdict: “Locked in!” at 850 or more, “Tight.” at 650 or more, “Wobbly.” at 350 or more, and “Lost the beat.” below that. This creates a continuous scale of performance rather than a binary pass-fail outcome, allowing for fine-grained assessment of timing accuracy.3
Difficulty Presets
The game offers three difficulty presets, Easy, Medium and Hard, that vary the tempo range and the silent bar count. Every preset gives four audible bars. Easy draws a tempo between 70 and 100 beats per minute and asks for four silent bars; Medium draws between 90 and 130 and asks for six; Hard draws between 110 and 170 and asks for eight. These presets give players a choice of challenge, from gentle tempos with short silent sections to fast tempos with long silent holds.3
The presets operate within the same deterministic framework as the rest of the engine. Each preset defines a target with specific field values, and the engine processes that target exactly as it would any other target. The difficulty lies in the combination of tempo and silent bar count, which sets how fast the beats come and how long the player must hold them without the click. The scoring system remains consistent across all presets, measuring drift from the ideal grid regardless of the chosen difficulty, and because its scale is set in fractions of a beat, a given score stands for the same relative precision at a fast Hard tempo as at a slow Easy one.3
The Tempo Behind the Game
In music, tempo is the speed or pace of a given composition, measured in beats per minute. A tempo of 60 beats per minute signifies one beat per second, while a tempo of 120 beats per minute is twice as rapid, signifying two beats every second. The note value of each beat is typically the one indicated by the denominator of the time signature. Tempo may be indicated by Italian markings, from slow ones such as largo and andante to fast ones such as allegro and presto, or by a metronome mark giving a specific BPM. Tempo markings can convey mood as well as speed, and a tempo need not be fixed: a composer may write an accelerando to speed up or a ritardando to slow down within a piece1. The game uses this concept of tempo as a fixed value measured in beats per minute, with the target bpm setting the pace for the entire round.
The tempo in the game is the beats-per-minute value that the click plays and that the player must hold. It is a single number that defines the speed of the round, and it appears in the target alongside the bar counts. The player taps at this tempo, and the engine measures how well they maintain it. The tempo does not change during the round; it is the constant reference point against which the player’s performance is evaluated.3
The Metronome Device
A metronome is a device that produces an audible click or other sound at a uniform interval that can be set by the user, typically in beats per minute. Players and singers practise against one to hold a steady tempo and an even beat. A traditional mechanical metronome uses a weighted pendulum: sliding the weight up the rod slows the tempo and sliding it down speeds it up, and the mechanism produces a click with each swing. Johann Maelzel patented a mechanical metronome in 1815 and mass-produced it from 1816, building on an earlier spring-powered, inverted-pendulum design by Dietrich Nikolaus Winkel and adding a numerical tempo scale; modern metronomes also come as quartz electronic devices and software2.
The click in the game functions as a metronome during the audible phase, playing the target tempo for the audible bars. It provides the uniform interval that the player must match with their taps. When the click cuts out, the player must maintain the same tempo without the device, testing their ability to hold the tempo internally. The metronome’s role in the game is to establish the tempo and then remove itself, leaving the player to carry the tempo forward alone.3
The Target and Its Fields
The target is the central data structure that defines each round. It contains four fields: the tempo in beats per minute; the number of audible bars the click plays; the number of silent bars that follow; and the beats per bar, the time-signature numerator, which is 4 for common time. These fields together determine the structure of the round, from the number of beats in the audible phase to the number in the silent phase.3
The engine uses the target to compute all the derived values that govern the round. From the tempo it derives the duration of each beat in milliseconds. From the bar counts and the beats per bar it derives the total beat count and the beat at which the silence starts. The target is fixed for the round, which means the tempo and bar counts remain constant throughout. The player can only respond to the target by tapping at the appropriate tempo and timing their taps to match the ideal grid.3
From Timestamps to Score
The path from tap timestamps to final score follows a clear sequence of calculations. First, the game records each tap as a millisecond timestamp, ignoring taps made more than half a beat before the four-beat count-in ends. During the audible phase, the player taps along with the click, establishing their sense of the tempo. When the click cuts out, the player continues tapping through the silent bars. The engine then measures each silent-phase tap’s drift from the ideal metronome grid anchored on the first tap, averages those drifts, counting each untapped silent beat as a half-beat miss, and maps the average, taken as a fraction of the beat, onto a score from 0 to 1000. Alongside the score it reports the tempo recovered from the average inter-tap interval and the number of silent-phase taps.3
This pipeline is entirely deterministic. Given the same seed and difficulty, the same target is generated. Given the same target and the same tap timestamps, the same score is computed. The engine does not depend on wall-clock time or any external reference; it depends only on the timestamps and the target. This makes the system both reliable and testable, as every step can be verified with predetermined inputs and expected outputs.3
The Silent Phase as Measurement
The silent phase is where the measurement happens. During the audible phase, the click provides a reference, and the player can adjust their taps to match it. During the silent phase, no such reference exists, and the player’s taps reveal how well they have internalized the tempo. The engine measures this internalization by comparing each tap to the ideal beat position extrapolated from the player’s first tap at the target tempo. The difference between the tap and the ideal position is the drift for that tap.3
The silent phase is also where the game’s design becomes most apparent. The click plays the target tempo for the audible bars, then cuts out, and the player must keep tapping the same tempo through the silent bars. The duration of the silent phase, determined by the silent bar count and the beats per bar, sets the length of the measurement period. Longer silent phases require the player to hold the tempo for more beats, which increases the chance for drift to accumulate. The scoring system measures drift for every silent-phase tap, charges every silent beat left untapped, and averages the lot into a final score, so a small tempo error that grows over a long hold pushes the average drift up and the score down.3
Seeded Determinism
The entire system is deterministic from a seeded random number generator. A given seed sets the same target every time, and every rule is testable from that point forward. The seed determines the tempo, drawn as a whole number from the chosen difficulty’s range; the bar counts come from the difficulty preset itself. Because the seed and difficulty fully determine the target, they always produce the same round structure. This property extends to the scoring as well, since the same tap timestamps against the same target always produce the same score.3
Seeded determinism serves both the player and the developer. For the player, it means that rounds are consistent and fair; the same sequence of taps will always yield the same result. The Daily mode derives its seed from the date in UTC, so everyone playing that day at a given difficulty gets the same target, while Practice picks a fresh random seed for each round. For the developer, it means that the engine can be thoroughly tested with predetermined seeds and tap sequences. The determinism is not a constraint; it is a feature that makes the game’s timing system transparent and reliable.3
Sources & notes
- "Tempo," Wikipedia, in music, tempo is the speed or pace of a given composition, measured in beats per minute (BPM): a tempo of 60 beats per minute signifies one beat per second, while a tempo of 120 beats per minute is twice as rapid, signifying two beats every second. The note value of each beat is typically the one indicated by the denominator of the time signature. Tempo may be indicated by Italian markings, from slow ones such as largo and andante (at a walking pace) to fast ones such as allegro and presto, or by a metronome mark giving a specific BPM. Tempo markings can convey mood as well as speed, and a tempo need not be fixed: a composer may write an accelerando to speed up or a ritardando to slow down within a piece. en.wikipedia.org/wiki/Tempo.
- "Metronome," Wikipedia, a device that produces an audible click or other sound at a uniform interval that can be set by the user, typically in beats per minute. Musicians use a metronome to play or practise in time, keeping a steady tempo and a regular beat. A traditional mechanical metronome uses a weighted pendulum: sliding the weight up the rod slows the tempo and sliding it down speeds it up, and the mechanism produces a click with each swing. Johann Maelzel patented a mechanical metronome in 1815 and mass-produced it from 1816, building on an earlier spring-powered, inverted-pendulum design by Dietrich Nikolaus Winkel and adding a numerical tempo scale; modern metronomes also come as quartz electronic devices and software. en.wikipedia.org/wiki/Metronome.
- Tempo Lock game engine: a pure, deterministic timing engine with no audio and no DOM. A target sets a tempo in beats per minute, a number of audible bars while a click plays, a number of silent bars to hold after it stops, and a beats-per-bar time-signature numerator (4 for 4/4). The click plays the target tempo for the audible bars, then cuts out, and the player must keep tapping the same tempo through the silent bars. The beat length in milliseconds is sixty thousand divided by the tempo; the total beat count is the audible plus silent bars times the beats per bar; and the silent phase starts at the audible bars times the beats per bar. The scoring functions take raw tap timestamps in milliseconds together with the target, so the same inputs always give the same result and the engine is testable without a clock. The tempo is recovered from the average interval between taps. Drift is the average distance of silent-phase taps from the nearest beat of an ideal grid anchored on the first tap and stepped at the target tempo; each silent-phase beat without a tap counts as a miss of half a beat, and with fewer than two taps the drift is half a beat. The score is 1000 at zero drift, falling linearly to 0 at a quarter of a beat, so the scale is relative to the tempo; the result grades are “Locked in!” at 850 or more, “Tight.” at 650 or more, “Wobbly.” at 350 or more, and “Lost the beat.” below that. Difficulty presets: Easy 70–100 BPM with 4 audible and 4 silent bars, Medium 90–130 with 4 and 6, Hard 110–170 with 4 and 8. The tempo is drawn from a seeded random number generator; Daily mode seeds it from the UTC date, Practice from a random number. Read from the game’s own source.
- Further reading on Metronome, Re-examining Czerny’s and Moscheles’s Metronome Marks for Beethoven’s Piano Sonatas. doi.org.
- Further reading on Metronome, Turn the Beat On: An Evidenced-Based Practice Journey Implementing Metronome Use in Emergency Department Cardiac Arrest . pubmed.ncbi.nlm.nih.gov.