Audio metronome system that provides rhythmic timing assistance during gameplay, including note-synced mode.
[heading: "Description"]Metronome provides audible timing assistance by playing tick sounds at various rhythmic divisions. It can sync to the song's beat structure or trigger on specific note timings (Note mode).
[heading: "Key Features"] [list] * Multiple timing modes (Off, Note, Quarters, Eighths, Sixteenths, Thirty-seconds) * Configurable beat divisions * Note-synced timing option (triggers on actual note beats) * Toggleable activation [/list] [heading: "Constructor"] [table header] [ Parameter | Type | Description ] [ scene | Play | Gameplay scene reference ] [/table] [heading: "Methods"] [table header] [ Method | Parameters | Description ] [ update | () | Updates metronome timing ] [ updateBeatMode | () | Handles beat-based timing ] [ updateNoteMode | () | Handles note-synced timing ] [ initializeNotes | () | Prepares note timing data from chart ] [ getCurrentDivisionValue | (beat) | Calculates beat division ] [ playTick | () | Plays metronome tick sound ] [ toggle | () | Toggles metronome on/off ] [ resetNoteMode | () | Resets note timing state ] [ setMode | (mode) | Changes metronome mode ] [ destroy | () | Cleans up metronome resources ] [/table] [heading: "Properties"] [table header] [ Property | Type | Description ] [ scene | Play | Gameplay scene reference ] [ mode | String | Current metronome mode ] [ enabled | Boolean | Whether metronome is active ] [ beatDivisions | Object | Beat division mappings ] [ currentDivision | Number/String | Current division setting ] [ lastDivisionValue | Number | Previous division state ] [ noteIndex | Number | Current note index for note mode ] [ lastNoteBeat | Number | Last note beat that triggered tick ] [ notes | Array | Unique note beat timings from chart ] [/table] [heading: "Metronome Modes"] [table header] [ Mode | Timing | Description ] [ OFF | - | No metronome ] [ Note | Note-triggered | Triggers on each unique note beat in chart ] [ Quarters | Every 1 beat | 1, 2, 3, 4... ] [ Eighths | Every 0.5 beat | 1, 1.5, 2, 2.5... ] [ Sixteenths | Every 0.25 beat | 1, 1.25, 1.5, 1.75... ] [ Thirty-seconds | Every 0.125 beat | 1, 1.125, 1.25, 1.375... ] [/table] [heading: "Note Mode Behavior"]In Note mode, the metronome triggers on each unique note beat in the chart:
[list] * Processes all regular notes (tap, hold, roll) * Ignores mine notes and hold ends * Groups notes with identical beat timing (triggers once per beat) * Provides precise rhythmic feedback tied to actual chart notes [/list] [heading: "Example Usage"] [codeblock javascript] // Metronome is automatically created in Play state const metronome = scene.metronome; // Toggle on/off with Select button metronome.toggle(); // Change mode metronome.setMode("Eighths"); // Check if enabled if (metronome.enabled) { console.log("Metronome active"); } [/codeblock] [footer: "© Retora 2026"]