Skip to content

feat(looper): fixed loop length in bars - #246

Merged
Siryu6 merged 1 commit into
mainfrom
feat/looper-length
Nov 20, 2026
Merged

Siryu6 merged 1 commit into
mainfrom
feat/looper-length

Conversation

@Siryu6

@Siryu6 Siryu6 commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Closes #245

Adds a Length setting to the looper: Free, 1, 2, 4 or 8 bars.

What it does

  • Free keeps the current behaviour: the recording ends when you press the switch again.
  • With a number of bars, the recording ends by itself on the last bar line, to the sample, and the loop plays at once.
  • The bars count from the first recorded beat. With the count-in on, that is the downbeat after the count-in.
  • Stop or Overdub pressed during a fixed-length recording choose what follows the end: stopped, or overdubbing. Play changes nothing. Record starts over.
  • The click and Quantize work as before. A fixed-length loop is always whole bars, so the click stays in time.
  • Overdubs keep the loop length. Loop ×2 still doubles it.
  • The setting is kept with the session. Older sessions load as Free.

The 30 s limit

The + key stops at the longest length that fits in 30 s at the current tempo and time signature.
If a tempo or time signature change later makes the chosen length too long, the recording gets the longest length that still fits, or Free when not even one bar fits.
The stored setting is not changed: the chosen length comes back once it fits again.
The page always shows the length the next recording will get.

UI

  • New Length stepper in the "Tempo and bars" row, after the time signature.
  • Encoder order: tempo 9, TAP 10, time signature 11, Length 12, Count-in 13, Quantize 14, Click 15, click level 16, volume 17.
  • During a fixed-length recording the status reads "RECORDING TO BAR 4" and the bar counter shows "2 / 4".

Tests

Unit tests in audio::looper for the bar length math, the end on the exact sample, the count-in, the 30 s cap and its fallback, keys pressed during a fixed recording, overdubs keeping the length, and old sessions loading as Free.
cargo fmt, clippy (default and minimal features) and cargo test pass locally. Checked the page in a headless run at 800 × 480.

User guide: the matching change for openrig-doc (tuner-looper page) follows separately.

A Length setting (Free, 1, 2, 4 or 8 bars) ends the first recording by
itself on the last bar line, and the loop plays at once. The bars count
from the first recorded beat, after the count-in. A length that does not
fit the 30 s at the tempo is shortened to the longest one that fits.

Closes #245
@Siryu6
Siryu6 enabled auto-merge (squash) November 20, 2026 11:16
@Siryu6
Siryu6 merged commit 74a48bb into main Nov 20, 2026
4 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Looper: fixed loop length in bars

1 participant