Skip to content

One Shot per track on the RC-500 - #167

Merged
AliceLafox merged 3 commits into
mainfrom
feat/oneshot-per-track
Nov 2, 2026
Merged

AliceLafox merged 3 commits into
mainfrom
feat/oneshot-per-track

Conversation

@AliceLafox

Copy link
Copy Markdown
Member

The pedal keeps One Shot as a flag of each track: <One> sits in every TRACK section of a memory. The app set the first track's flag alone and read the memory's One Shot from it. On the RC-500 the player now sets One Shot per track, and the preview plays each track by its own flag.

What changes

  • The core. commands::setOneShot(volume, slots, track, on, options) writes that track's <One> and nothing else. A track the card's model does not have, or no track at all, is refused by name before anything moves. An RC-5 write is the same bytes as before: track 1, TRACK1.One. push's oneShot stays the first track's.
  • The profile. kRc500 opens setOneShot, so a refusal on the RC-500 now lists it among what is open: "rename, set one-shot, pull, clear and restore".
  • The inspector. A two-track memory shows a One Shot card per track, "One Shot T1" and "One Shot T2". Each card shows its own track's state and writes its own track. A track keeps its flag whether or not it holds a take, as the pedal does. A one-track memory keeps its one "One Shot" card.
  • The table. On a two-track memory the One Shot cell draws a dot per track, track 1 left, filled when that track plays once. A click flips the dot it lands on, and a click on no dot writes nothing. The boundary between the dots is the middle of the gap, and SlotTable::oneShotTrackAt is the one function both the drawing and the click use. The hover says it in words: "T1 loops, T2 plays once". A one-track memory keeps its one dot, and its whole cell is the switch.
  • The history. A two-track One Shot row names the track whose flag changed, read from that track's own section: "One Shot T2 on".
  • The player. Each track of the mix carries its own flag. With Loop on, a One Shot track plays once from the start and is silent after its end, on the same clock, while every other track keeps looping on its own length. Loop off still stops them all. Loop starts off only when every take of the memory is One Shot. Turning Loop on over such a memory loops it all, as Loop does over a one-track One Shot memory. When a flag moves on the card while the memory is loaded, the preview follows it track by track, and the Loop toggle is set again the way a load sets it. The flags are atomics, so the audio thread reads them without a lock or an allocation.

Tests

  • Core. On a synthetic RC-500 card, setting track 2 changes exactly TRACK2.One. Track 1 on two memories changes exactly TRACK1.One in each, and every other memory, both takes and both SYSTEM banks stay byte for byte. Track 3, track 0 and track -1 are refused by name, and so is track 2 on the RC-5. The RC-5's own one-shot test still finds exactly TRACK1.One changed.
  • Catalog. A two-track memory reads per-track flags, and the flat field is track 1's. A track with no take keeps its flag.
  • History. One operation about the slot, whose bodies differ only in TRACK2.One, with both tracks' takes written down after it, each with its own hash.
  • Harnesses. The inspector shows three cards on a two-track memory, with the right state per track and a click that names its track. The table's geometry is pinned, the clicks land on the right dot, and the hover words are checked. The engine plays a one-second looping track under a half-second One Shot track: the short one is heard once, frame 0 to its last, and never again, the long one goes round, and the transport keeps playing. Taking the per-lane flag out of TrackMixSource fails three of these checks.

Review

An adversarial review by a fresh session found no P0, three P1s and one P2, all fixed in the last commit. The P1s: a History row read the direction from track 1; the loaded preview kept stale flags; Loop on over an all-One-Shot memory stopped at the end. The P2: a click on the empty rest of the cell wrote track 2. The review also confirmed RC-5 writes byte for byte. It built the same write sequence against the pre-change headers and the branch, every slot on and off on the real card fixture: 45,382,000 bytes, identical.

Not in this PR

  • A one-track memory's Loop toggle is still set only when the memory loads, as before.

The pedal keeps One Shot as a flag of each track (<One> in each TRACK
section), and setOneShot wrote the first track's alone. It now takes the
track; a track the card's model does not have, or no track at all, is
refused by name before anything moves, and an RC-5 write is the same bytes
as before (TRACK1.One, track 1). push's oneShot stays the first track's.

The RC-500 opens setOneShot, so its refusals now list it among what is open.
On a two-track memory the inspector shows a One Shot card per track, "One
Shot T1" and "One Shot T2", each with its own track's state and writing its
own track, whether that track holds a take or not - the pedal keeps the flag
either way. The table's One Shot cell draws a dot per track, track 1 left,
and a click flips the dot it lands on; its hover says what each track does.
A one-track memory keeps its one card and its one dot.
The player looped every track of a two-track memory or none, by the first
track's flag. Each track of the mix now carries its own One Shot flag: with
Loop on, a One Shot track plays once from the start and is silent after its
end, on the same clock, while every other track keeps looping on its own
length. Loop off still stops them all, and Loop starts off only when every
take of the memory is One Shot. The flags are fixed when the mix is loaded,
so the audio thread reads them without a lock or an allocation.

The engine harness plays a one-second looping track under a half-second One
Shot track: the short one is heard once, start to end, and never again, the
long one goes round, and the transport keeps playing.
…eview, Loop is never dead

An adversarial review of the branch.

- A History row of a two-track One Shot change read "on" or "off" from track
  1, so turning track 2 on read "One Shot off". It now names the track whose
  flag changed, from that track's own section: "One Shot T2 on". A
  one-track memory's row reads as it always has.
- The mix's flags were fixed at load, and the player reloads a memory only
  when its file changes, so a One Shot toggled while listening was not heard
  until the memory was chosen again. The flags are now atomics the card's
  flags are pushed to, and the Loop toggle is set again the way a load sets
  it.
- Loop on over a memory whose every take is One Shot stopped at the end with
  the toggle reading "on". It now loops them all, as Loop does over a
  one-track One Shot memory; with any track looping, a One Shot track still
  plays once.
- A click on the empty rest of a two-track One Shot cell flipped track 2. A
  click on no dot now writes nothing; a one-track cell is still all switch.
@AliceLafox
AliceLafox merged commit 4eed92d into main Nov 2, 2026
5 checks passed
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.

1 participant