From 513808a6d2af468f569756de66c92f70389806d5 Mon Sep 17 00:00:00 2001 From: Benjamin Hardy Date: Sat, 26 Sep 2026 12:46:27 +0200 Subject: [PATCH] Grid can now be nudged by one beat --- frontend/src/components/GridControls.tsx | 6 ++++++ frontend/src/components/PrepStrip.tsx | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/frontend/src/components/GridControls.tsx b/frontend/src/components/GridControls.tsx index 52c6467..fa434f0 100644 --- a/frontend/src/components/GridControls.tsx +++ b/frontend/src/components/GridControls.tsx @@ -211,6 +211,7 @@ export function GridEditStrip({ onPrevMarker, onNextMarker, onNudgeMarker, + onNudgeMarkerBeats, onAddMarker, onDeleteMarker, onDeleteGrid, @@ -225,6 +226,7 @@ export function GridEditStrip({ onPrevMarker: () => void onNextMarker: () => void onNudgeMarker: (deltaMs: number) => void + onNudgeMarkerBeats: (beats: number) => void onAddMarker: () => void onDeleteMarker: () => void onDeleteGrid: () => void @@ -273,6 +275,8 @@ export function GridEditStrip({
{/* Phase nudges move the GOVERNING marker — not gated on atMarker, since the drift is heard at the playhead, not at the marker. */} + + + +
{/* Only a marker you are standing on can be deleted, so one scrolled diff --git a/frontend/src/components/PrepStrip.tsx b/frontend/src/components/PrepStrip.tsx index 2e5dba4..0d36e3b 100644 --- a/frontend/src/components/PrepStrip.tsx +++ b/frontend/src/components/PrepStrip.tsx @@ -881,6 +881,11 @@ export function PrepStrip({ // in this panel — a section can be octave-wrong on its own. const halveBpm = () => activeMarker && setBpm(activeMarker.bpm / 2) const doubleBpm = () => activeMarker && setBpm(activeMarker.bpm * 2) + // A beat is the governing marker's own beat: moving a marker by whole beats + // shifts which beat is the downbeat without changing the phase. + const nudgeGridBeats = (beats: number) => { + if (activeMarker) nudgeGrid((beats * 60000) / activeMarker.bpm) + } const nudgeGrid = (deltaMs: number) => { if (!activeMarker) return editMarker(activeMarkerIndex, { start: Math.max(0, activeMarker.start + deltaMs / 1000) }) @@ -1363,6 +1368,7 @@ export function PrepStrip({ onPrevMarker={prevMarker} onNextMarker={nextMarker} onNudgeMarker={nudgeGrid} + onNudgeMarkerBeats={nudgeGridBeats} onAddMarker={addMarkerHere} onDeleteMarker={deleteMarkerHere} onDeleteGrid={deleteGrid}