diff --git a/CLAUDE.md b/CLAUDE.md index a51687c..6dab54e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1522,7 +1522,7 @@ Two independent apps that talk over HTTP: position jogs that wrap; `detectEncoding` guesses from what a control sent while learning: relative REPEATS and jitters inside its zones, absolute progresses), `actions.ts` (the vocabulary: deck buttons = the deck keys' - actions, plus pitch, jog, jog touch, fast scrub, load, SYNC, keylock, + actions, plus pitch, jog, jog touch, fast scrub, load, SYNC, MASTER, keylock, loops; mixer; browse / tree; performance mode; `shiftDefault` = the keyboard's Shift meaning), `mapping.ts` (per controller, keyed by SOURCE; each control a normal + a FREE Shift binding; learning REPLACES an @@ -1535,7 +1535,9 @@ Two independent apps that talk over HTTP: encoder wins only where it has an action for the layer. A CC learned for a button waits 400 ms: one message, or any 0, = a button; several non-zero = a turn (so a two's-complement encoder's 127s are not a press). - **`router.ts`**: Shift is a learned control (an unbound Shift + **`router.ts`**: Shift is a learned control — up to TWO per controller + (`Mapping.shifts`, many have one per deck; either held = the Shift layer; + the old single `shift` field still loads) (an unbound Shift binding falls back to normal); deck B and the mixer act only in performance mode; positions JUMP (no soft takeover — "the controller always wins"); a held control releases where it was pressed; Learn sees diff --git a/frontend/src/components/MidiSettings.tsx b/frontend/src/components/MidiSettings.tsx index 4fd980b..01e49f8 100644 --- a/frontend/src/components/MidiSettings.tsx +++ b/frontend/src/components/MidiSettings.tsx @@ -5,6 +5,7 @@ import { ENCODING_LABELS, ENCODINGS } from '../lib/midi/encoding' import { DEFAULT_JOG_SENSITIVITY, DEFAULT_SCRUB_SPEED, + bindShift, emptyMapping, sanitizeMapping, setBinding, @@ -24,8 +25,8 @@ import { Modal } from './Modal' const section = 'text-[11px] font-semibold uppercase tracking-wider text-faint' const MAPPING_SUFFIX = '.konduktor-midi.json' -const sameTarget = (a: LearnTarget | null, b: LearnTarget) => - a != null && a.action === b.action && ('layer' in a ? a.layer : null) === ('layer' in b ? b.layer : null) +const which = (t: LearnTarget) => ('layer' in t ? t.layer : t.slot) +const sameTarget = (a: LearnTarget | null, b: LearnTarget) => a != null && a.action === b.action && which(a) === which(b) /** * Settings ▸ MIDI Controllers… (decided 2026-11-03): every controller is @@ -169,7 +170,7 @@ export function MidiSettings({ onClose }: { onClose: () => void }) { try { const m = sanitizeMapping((await api.midiImport(path)).mapping) if (!m) throw new Error('That file is not a MIDI mapping') - if (Object.keys(mapping.bindings).length > 0 || mapping.shift) { + if (Object.keys(mapping.bindings).length > 0 || mapping.shifts.some(Boolean)) { const ok = await askConfirm({ title: `Replace ${port}'s mapping?`, body: 'The imported mapping replaces every control learned on this controller.', @@ -253,29 +254,41 @@ export function MidiSettings({ onClose }: { onClose: () => void }) { {note &&
{note.text}
}
- Shift button -
- {sameTarget(armed, { action: 'shift' }) ? ( - - ) : mapping.shift ? ( - <> - {describeSource(mapping.shift)} - - - - ) : ( - - )} - Hold it while moving a control to learn its Shift action. -
+ {([0, 1] as const).map((slot) => { + const src = mapping.shifts[slot] + const t: LearnTarget = { action: 'shift', slot } + return ( +
+ {slot === 0 ? 'Shift button' : 'Second Shift'} +
+ {sameTarget(armed, t) ? ( + + ) : src ? ( + <> + {describeSource(src)} + + + + ) : ( + + )} + + {slot === 0 + ? 'Hold it while moving a control to learn its Shift action.' + : 'Optional — many controllers have one per deck. Either one gives the Shift layer.'} + +
+
+ ) + })} Jog sensitivity { + if (performance && d.track) makeMaster(id) + }, toggleKeylock: () => d.setKeylock(!d.keylock), pitch: d.pitch, setPitch: (v) => { diff --git a/frontend/src/components/deck/DeckTempo.tsx b/frontend/src/components/deck/DeckTempo.tsx index fe4de34..5acd960 100644 --- a/frontend/src/components/deck/DeckTempo.tsx +++ b/frontend/src/components/deck/DeckTempo.tsx @@ -62,6 +62,7 @@ export function DeckTempo({ deck, master, synced, syncBlocked, onSync, onMaster, SYNC