From 47249d5a12f5f9392e5c0f5c33f3e4425307647f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 13:54:00 +0000 Subject: [PATCH] TEMPO GUARD on: a plain turn of VALUE is ENERGY The second review (2026-11-30), proposal 10: the knob the guard keeps off the tempo becomes the performance knob. With the guard on, a plain turn where VALUE would set the tempo is ENERGY, as FUNC + turn is, under any clock (ENERGY is not the tempo); a tap still shows the tempo and leaves it. Help, the scenario, the docs and W99 follow. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Tw2EaEK2oaJWJMdGQTNLPf --- CHANGELOG.md | 4 ++++ app/ui_gestures.hpp | 16 +++++++++------- core/help.cpp | 6 +++--- docs/CHEATSHEET.md | 4 ++-- docs/CONTROLS.md | 5 +++-- docs/FEATURES.md | 2 +- docs/MANUAL.md | 7 ++++--- docs/UNIT_CHECKLIST.md | 5 +++-- tests/scenario_tempoguard.sh | 17 +++++++++-------- tests/test_ui.cpp | 31 +++++++++++++++++++++---------- 10 files changed, 59 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f87175c2..1e2e91bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -83,6 +83,10 @@ the project file format or the controls. original is never written over; slice points move with the trim. ### Changed +- **With TEMPO GUARD on, a plain turn of VALUE is ENERGY** where it would have been the tempo, as + FUNC + turn is, under any clock (the second review, 2026-11-30). A tap still shows the tempo + and leaves it. + - **VA POLY and WAVE POLY: the filter follows the keys.** Above middle C the cutoff rises three quarters of an octave for each octave played, so the top notes of a chord keep their harmonics. Middle C and everything below it sound as before. Projects with high chords on diff --git a/app/ui_gestures.hpp b/app/ui_gestures.hpp index eb12b083..298abf07 100644 --- a/app/ui_gestures.hpp +++ b/app/ui_gestures.hpp @@ -76,10 +76,12 @@ } // TEMPO GUARD (FUNC menu; review 2026-11-29, proposal 9): VALUE is the tempo on most screens, - // and a hand brushing it moved the BPM mid-set. With the guard on, a plain turn or a tap of - // VALUE where it would set the tempo shows the tempo and changes nothing; the row is turned - // off to change it (Roland, 2026-11-30, over push + turn, which is swing). The nudge, - // VariSpeed and a section's BPM are moves of their own and still play. True if refused. + // and a hand brushing it moved the BPM mid-set. With the guard on, a tap of VALUE where it + // would set the tempo shows the tempo and changes nothing, and a plain turn there is ENERGY, + // as FUNC + turn is (the second review, 2026-11-30, proposal 10: the knob the guard frees is + // the performance knob). The row is turned off to change the tempo (Roland, 2026-11-30, over + // push + turn, which is swing). The nudge, VariSpeed and a section's BPM are moves of their + // own and still play. True if refused. bool tempo_guarded() const { return engine_.project().settings.tempo_guard; } bool tempo_guard_refuses() { @@ -184,11 +186,12 @@ post(Cmd::set_pattern_swing, 0, 0, 0, clamp_delta(delta), kDeltaFlag); return; } - if (fn) { + if (fn || tempo_guarded()) { // FUNC + VALUE is ENERGY (core/energy.hpp), on every screen, an effect picked or // not: the signature move gets the one gesture that needs no screen (the 2026-11-29 // review, proposal 2). It was the master DJ filter until 2026-11-25 (backlog D1), - // then VariSpeed until it moved to PERFORM's FUNC + C, where ENERGY was. + // then VariSpeed until it moved to PERFORM's FUNC + C, where ENERGY was. With + // TEMPO GUARD on, the plain turn too, under any clock: ENERGY is not the tempo. energy_turn_by(delta); return; } @@ -201,7 +204,6 @@ notice("EXT CLOCK"); return; } - if (tempo_guard_refuses()) return; // Clamped as a SIGNED value, before the cast. `tempo_tenths_` is unsigned, so a // delta large enough to take the sum below zero used to wrap to about four billion // and then clamp to 3000 -- 300 BPM -- when the user was turning the knob DOWN. Not diff --git a/core/help.cpp b/core/help.cpp index 7168694b..31a53d64 100644 --- a/core/help.cpp +++ b/core/help.cpp @@ -467,9 +467,9 @@ constexpr Text kMenu = {"FUNC MENU:", { // TEMPO GUARD, the FUNC menu's row that keeps VALUE off the tempo during a set. constexpr Text kTempoGuard = {"TEMPO GUARD:", { - "ON: VALUE TURN OR TAP", - "SHOWS THE TEMPO AND", - "LEAVES IT", + "ON: A VALUE TURN IS", + "ENERGY A TAP SHOWS", + "THE TEMPO", "OFF TO CHANGE TEMPO", "STILL PLAY: NUDGE", "VARISPEED AND SWING", diff --git a/docs/CHEATSHEET.md b/docs/CHEATSHEET.md index 870c923f..de021b24 100644 --- a/docs/CHEATSHEET.md +++ b/docs/CHEATSHEET.md @@ -95,7 +95,7 @@ each line means. | VALUE push + turn | Pattern swing | | Tap VALUE, three times or more | Tap tempo where VALUE turns the tempo (`TAP 128.0`) once two gaps agree, from the last four taps; a 2 s gap starts again | | FUNC + SEL< / SEL> | **TRANSPOSE**: the melodic tracks (VAs, WAVEs, FM4, GRAIN, unsliced SAMPLE) a scale step down / up, -12..+12, on every screen (`TRANSPOSE +2 IN KEY`); the FUNC menu's TRANSPOSE row on SEMI makes it semitones, the key moving too (`TRANSPOSE +3 C`). Both screen keys together back to 0. Drums, sliced samples and MID stay. Not saved; in a LOCK | -| FUNC + VALUE turn | **ENERGY**, on every screen: from a breakdown (-64) to the peak (+64), two counts a click (`ENERGY -20`). Rest is a detent; FUNC + tap VALUE (no effect picked) drops back to 0. A turn keeps FUNC's layer until the knob rests, so FUNC let go mid-turn moves no tempo | +| FUNC + VALUE turn | **ENERGY**, on every screen (with TEMPO GUARD on, the plain turn too, where VALUE would be the tempo): from a breakdown (-64) to the peak (+64), two counts a click (`ENERGY -20`). Rest is a detent; FUNC + tap VALUE (no effect picked) drops back to 0. A turn keeps FUNC's layer until the knob rests, so FUNC let go mid-turn moves no tempo | | FUNC + push VALUE + turn | Nudge: 4% faster or slower for 250 ms a detent, then back to the set tempo (`NUDGE FASTER`) | | Push VALUE + STEP, CLR, LEFT/RIGHT | The performance mixer (below) | | FUNC + push A / B / C | Master kill EQ: kill LOW / MID / HI, again to bring it back (`KILL LOW`, `LOW BACK`). Performance only: not saved, and a load brings every band back | @@ -214,7 +214,7 @@ three throw away unsaved work, so each needs OK twice within 2 s (OK AGAIN: RELO NEW, OK AGAIN: DEMO). NEW is empty; LOAD DEMO is the factory demo a first start plays. **FUNC menu (FUNC+HOME):** SAVE, JAM REC, ARR REC, CLICK, COUNT-IN, REC MODE, QUANTIZE, AUTO-FILL, FX GLIDE, TRANSPOSE (SCALE or SEMI), LOOP LEN, CHAIN, CHAIN END, ARR UNDO, PROG CHG OUT, -TEMPO GUARD (ON: VALUE's turn and tap leave the tempo; saved), SAVE AS, +TEMPO GUARD (ON: VALUE's turn is ENERGY and its tap shows the tempo; saved), SAVE AS, OPEN PROJECT, KITS, NEW PROJECT, RELOAD PROJECT, CLEAR PATTERN, LOAD DEMO, GEN ALL. It always opens on SAVE: DOWN once is JAM REC, twice ARR REC, three times CLICK; the list wraps, so UP once is GEN ALL (GENERATE on every unmuted track, each of its own TYPE, one undo level; OK again diff --git a/docs/CONTROLS.md b/docs/CONTROLS.md index cce79fce..6b836b6b 100644 --- a/docs/CONTROLS.md +++ b/docs/CONTROLS.md @@ -110,7 +110,8 @@ HOME "system", PLAY "◀◀", STOP "▶▶", MIXER "fx", EDIT "rec src". two gaps agree within 25%, the tempo follows the last four taps (`TAP TEMPO` twice, then `TAP 128.0`), set and saved as a turn sets it; two stray taps set nothing. A gap over 2 s or a tap at half or twice the pace starts a new count. **TEMPO GUARD** (FUNC menu) on: the - turn and the tap leave the tempo and say `TEMPO GUARD 130.0`. + turn is ENERGY, as FUNC + turn is, under any clock (review 2026-11-30, proposal 10), and the + tap leaves the tempo and says `TEMPO GUARD 130.0`. - **STEP keys:** the sixteen of whatever the pad-row keys chose. **On every playing screen, PERFORM and KEYS included, they are steps** (D12, 2026-11-25): tap, hold + knob, hold + OK work as on GRID. MUTE MODE (STEP 1-8 the mute states), a held scene pad, push VALUE (the @@ -188,7 +189,7 @@ FUNC + EDIT twice is KIT. | CHAIN END | | SONG (play once) / LOOP | | ARR UNDO | swaps the chain the last ARR REC take replaced back in (`ARR UNDONE`); OK again brings the take back (`ARR REDONE`), unless the take captured launched lanes: then the undo also empties the slots it captured into and is final. `NO ARR TO UNDO` with none, or during a take | | | PROG CHG OUT | | `OFF` (a new project) / `ON`: a program change on MIDI CH every time the playing pattern changes, the pattern's number 0-127. Saved with the project | -| TEMPO GUARD | | `OFF` (a new project) / `ON`: a plain turn or tap of VALUE where it would set the tempo changes nothing and says `TEMPO GUARD 130.0`; turn the row off to change the tempo. The nudge, VariSpeed, swing and a section's BPM still play (review 2026-11-29, proposal 9; Roland chose this over push + turn, which is swing, 2026-11-30). `EXT CLOCK` first under an outside clock. Saved with the project | +| TEMPO GUARD | | `OFF` (a new project) / `ON`: a plain turn of VALUE where it would set the tempo is ENERGY (`ENERGY +12`; review 2026-11-30, proposal 10), and a tap there changes nothing and says `TEMPO GUARD 130.0`; turn the row off to change the tempo. The nudge, VariSpeed, swing and a section's BPM still play (review 2026-11-29, proposal 9; Roland chose this over push + turn, which is swing, 2026-11-30). A tap says `EXT CLOCK` first under an outside clock; the turn is ENERGY under any clock. Saved with the project | | SAVE AS | PROJECTS page with the name entry open | | | OPEN PROJECT | PROJECTS page; OK twice there opens | | | KITS | the kit browser | | diff --git a/docs/FEATURES.md b/docs/FEATURES.md index 24dfc9a4..85d4c85c 100644 --- a/docs/FEATURES.md +++ b/docs/FEATURES.md @@ -244,7 +244,7 @@ FM4 and GRAIN machines. | --- | --- | --- | --- | | Follows the unit's clock: internal, MIDI clock, SYNC IN; refuses tempo/transport under external clock | v0.1.0 | ○ (M7) | STRATA cannot set CLOCK SRC (Enaga has no setter). SYNC polarity not selectable (Enaga) | | Tap tempo on VALUE, nudge on FUNC + push VALUE + turn | v0.6.0 | ○ (W72, W80) | Internal clock only; nothing set until three taps agree within 25%; the nudge is 4% for 250 ms a detent | -| TEMPO GUARD (FUNC menu): VALUE's plain turn and tap show the tempo and leave it | Unreleased | ○ (W99), E (scenario_tempoguard.sh) | Off by default; saved with the project (one byte on the end of PROJECT.BIN's MIDI section). Nudge, VariSpeed, swing and section BPMs still play | +| TEMPO GUARD (FUNC menu): VALUE's plain turn is ENERGY (review 2026-11-30, proposal 10) and its tap shows the tempo; both leave it | Unreleased | ○ (W99), E (scenario_tempoguard.sh) | Off by default; saved with the project (one byte on the end of PROJECT.BIN's MIDI section). Nudge, VariSpeed, swing and section BPMs still play | | **Song tempo kept apart from the project's**: a section's BPM plays without becoming the saved tempo; ARR REC writes BPM only where the tempo changed (and the take's start tempo on its first entry); VariSpeed held back near 300 BPM says so and returns at a slower tempo | v0.6.0 | ○ (W80), E (scenario_sections.sh, scenario_arrrec.sh) | The clock no longer jumps back for a moment after a section BPM, a VALUE turn or a tap | | MIDI OUT per track (OFF/1-16): steps, chords, ratchets, arp, note repeat, pads, KEYS, MIDI IN | v0.1.0 | ○ (8d) | **On Enaga 0.2.0 (v0.1.0-v0.3.1):** with USB connected to a computer not reading, DIN out stalls; unplug USB. Fixed in Enaga 0.3.0, which `main` needs | | Every note gets its note-off; second STOP sends All Notes Off | v0.1.0 | ○ (8d) | Slide is not sent as legato | diff --git a/docs/MANUAL.md b/docs/MANUAL.md index d4ac4ab3..231cb7b6 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -1576,9 +1576,10 @@ up a little earlier or later and the tempo stays put, which is how to line STRAT a turntable or a band that sends no clock. Both are refused under an outside clock (`EXT CLOCK`). **TEMPO GUARD** (FUNC menu, `OFF` or `ON`) keeps VALUE off the tempo during a set, where a hand -brushing the knob would move the BPM on any screen. With it on, a turn or a tap of VALUE where it -would set the tempo changes nothing and shows the tempo instead (`TEMPO GUARD 128.0`). To change -the tempo, turn the row off. The nudge, VariSpeed, swing (push + turn) and a section's BPM are +brushing the knob would move the BPM on any screen. With it on, a plain turn of VALUE where it +would set the tempo is **ENERGY**, as FUNC + turn is (`ENERGY +12`), so the knob under your hand +is the build and the drop, and a tap there changes nothing and shows the tempo +(`TEMPO GUARD 128.0`). To change the tempo, turn the row off. The nudge, VariSpeed, swing (push + turn) and a section's BPM are moves of their own and still play, and VALUE still turns a picked effect, the morph and the fields it edits. Under an outside clock `EXT CLOCK` comes first. It is off in a new project and saved with the project. diff --git a/docs/UNIT_CHECKLIST.md b/docs/UNIT_CHECKLIST.md index 990238d0..1c2a8738 100644 --- a/docs/UNIT_CHECKLIST.md +++ b/docs/UNIT_CHECKLIST.md @@ -1322,8 +1322,9 @@ DEMO), A01 playing. **W99. TEMPO GUARD (3 min).** Beat playing, A01, on GRID. - FUNC menu, DOWN to TEMPO GUARD (under PROG CHG OUT), RIGHT: `TEMPO GUARD ON`, the row reads `ON`. CLR. `____` -- Turn VALUE either way and tap it four times in time: `TEMPO GUARD 130.0` (the project's tempo) - each time, the top bar's tempo and the beat unchanged. `____` +- Turn VALUE up a few clicks: `ENERGY +6` or so, the part fills, the tempo unchanged; back down + to `ENERGY 0` (review 2026-11-30, proposal 10). Tap it four times in time: `TEMPO GUARD 130.0` + (the project's tempo) each time, the top bar's tempo and the beat unchanged. `____` - Push + turn VALUE still moves the swing; FUNC + push + turn still nudges (`NUDGE FASTER`); push VALUE + STEP 4 then a turn still moves that effect. `____` - SAVE, turn the unit off and on, open the project: the row reads `ON`. Turn it off (OK on the diff --git a/tests/scenario_tempoguard.sh b/tests/scenario_tempoguard.sh index f5ad41a3..ffc12746 100755 --- a/tests/scenario_tempoguard.sh +++ b/tests/scenario_tempoguard.sh @@ -2,14 +2,14 @@ # TEMPO GUARD in the emulator (FUNC menu; docs/CONTROLS.md, "The FUNC menu"): the beat running, # the guard switched on, then VALUE turned and tapped, then the guard switched off again. # -# What it proves is what the host cannot: the menu row draws and switches on the C674x, and the -# refusal (app/ui_gestures.hpp, a notice built with the tempo in it) runs from VALUE's turn and -# its release without a crash, an overrun or a stall. That the tempo stays put is host-tested (tests/test_ui.cpp, +# What it proves is what the host cannot: the menu row draws and switches on the C674x, VALUE's +# turn is ENERGY (review 2026-11-30, proposal 10) and the refusal (app/ui_gestures.hpp, a notice +# built with the tempo in it) runs from VALUE's release without a crash, an overrun or a stall. That the tempo stays put is host-tested (tests/test_ui.cpp, # ui_the_tempo_guard_holds_the_tempo_against_value), since the emulator cannot read the screen. # -# Observable through Enaga's log (notice_logged): `TEMPO GUARD ON`, then `TEMPO GUARD 130.0` (the -# tempo, whatever it is) for the turn and each tap, never a `TAP ...` line, then -# `TEMPO GUARD OFF`; `run int` from the transport. +# Observable through Enaga's log (notice_logged): `TEMPO GUARD ON`, then `ENERGY +2` or more for +# the turn, `TEMPO GUARD 130.0` (the tempo, whatever it is) for each tap, never a `TAP ...` line, +# then `TEMPO GUARD OFF`; `run int` from the transport. # # Keys (third_party/enaga/include/enaga/abi.h): F5 = 22 (PLAY), F1 = 19, F4 = 27 (HOME), DOWN = 25, # RIGHT = 18, OK = 23, CLR = 30, PUSH_VALUE = 4. The row is found by name (tools/menu_rows.py), so @@ -103,9 +103,10 @@ check(report.get("app_status") == "APP RUNNING", "app is running", check(not report.get("crash_reason"), "no crash", f'reason={report.get("crash_reason")!r}') check("run int" in log, "the transport started", f"log={log}") check("TEMPO GUARD ON" in log, "the FUNC menu row switched the guard on", f"log={log}") +energy = [l for l in log if re.fullmatch(r"ENERGY \+\d+", l)] +check(len(energy) >= 1, "VALUE's turn was ENERGY", f"lines={energy}") refused = [l for l in log if re.fullmatch(r"TEMPO GUARD \d+\.\d", l)] -# The turn may arrive as one event or three; the taps are four more. -check(len(refused) >= 5, "VALUE's turn and its four taps were refused", f"lines={refused}") +check(len(refused) >= 4, "VALUE's four taps were refused", f"lines={refused}") check(len(set(refused)) == 1, "every refusal names the same tempo", f"lines={refused}") taps = [l for l in log if l.startswith("TAP ")] check(not taps, "no tap was counted towards a tempo", f"lines={taps}") diff --git a/tests/test_ui.cpp b/tests/test_ui.cpp index 365c89bf..cd5872e5 100644 --- a/tests/test_ui.cpp +++ b/tests/test_ui.cpp @@ -15091,8 +15091,9 @@ TEST(ui_value_taps_set_the_tempo_and_it_is_saved) { CHECK_EQ(UiProbe::tempo_tenths(app), before); } -// TEMPO GUARD (FUNC menu, review 2026-11-29 proposal 9): on, VALUE's plain turn and its taps show -// the tempo and leave it; the nudge, VariSpeed and swing still move. Off again, VALUE turns it. +// TEMPO GUARD (FUNC menu, review 2026-11-29 proposal 9): on, VALUE's taps show the tempo and leave +// it, and its plain turn is ENERGY (review 2026-11-30, proposal 10); the nudge, VariSpeed and swing +// still move. Off again, VALUE turns the tempo. TEST(ui_the_tempo_guard_holds_the_tempo_against_value) { Strata &app = fresh(); FakeHost &host = FakeHost::the(); @@ -15110,17 +15111,21 @@ TEST(ui_the_tempo_guard_holds_the_tempo_against_value) { key(ENAGA_KEY_CLR); CHECK_EQ(UiProbe::mode(app), int(Mode::grid)); - // A plain turn: refused, the tempo named, the clock and the project untouched. + // A plain turn: ENERGY, as FUNC + turn is; the clock and the project untouched. app.on_encoder(4, 5); pump(2); - char expect[24]; - std::snprintf(expect, sizeof(expect), "TEMPO GUARD %u.%u", unsigned(before / 10), - unsigned(before % 10)); - CHECK(std::strcmp(UiProbe::notice(app), expect) == 0); + CHECK(std::strncmp(UiProbe::notice(app), "ENERGY +", 8) == 0); + CHECK(int(app_engine().energy()) > 0); CHECK_EQ(UiProbe::tempo_tenths(app), before); CHECK_NEAR(host.tempo(), float(before) * 0.1f, 0.01f); CHECK_EQ(int(app_engine().project().settings.tempo_centi_bpm), int(before * 10)); - check_layout(app, "GRID, TEMPO GUARD refusing a turn"); + check_layout(app, "GRID, TEMPO GUARD: a turn is ENERGY"); + app.on_encoder(4, -5); // and back to rest + pump(2); + CHECK_EQ(int(app_engine().energy()), 0); + char expect[24]; + std::snprintf(expect, sizeof(expect), "TEMPO GUARD %u.%u", unsigned(before / 10), + unsigned(before % 10)); // Taps that agree: refused too, none of them counted. tap_value_after(app, 3000); @@ -15176,7 +15181,8 @@ TEST(ui_the_tempo_guard_holds_the_tempo_against_value) { pump(2); } -// Under an outside clock the tempo is not STRATA's: EXT CLOCK says so before the guard does. +// Under an outside clock the tempo is not STRATA's: a tap says EXT CLOCK before the guard does, +// and a turn is ENERGY all the same, which is not the tempo. TEST(ui_the_tempo_guard_gives_way_to_ext_clock) { Strata &app = fresh(); FakeHost &host = FakeHost::the(); @@ -15184,8 +15190,13 @@ TEST(ui_the_tempo_guard_gives_way_to_ext_clock) { post_cmd(Cmd::set_tempo_guard, 1); pump(2); host.set_source(ENAGA_CLOCK_MIDI); - app.on_encoder(4, 3); + tap_value_after(app, 3000); CHECK_EQ(UiProbe::notice(app), "EXT CLOCK"); + app.on_encoder(4, 3); + pump(2); + CHECK(std::strncmp(UiProbe::notice(app), "ENERGY +", 8) == 0); + app.on_encoder(4, -3); + pump(2); host.set_source(ENAGA_CLOCK_INTERNAL); post_cmd(Cmd::set_tempo_guard, 0); pump(2);