fix: restore rev mod target in matModPairs

The rev (reverb send) modulation target was dropped from ~matModPairs
when factoring capture effects. This branch now emits a 0..1 reverb
send scaled by mod depth, matching the previous engine behavior.
This commit is contained in:
clement
2026-06-29 00:30:21 +02:00
parent df04d8d051
commit dcb35772ae
3 changed files with 34 additions and 5 deletions
@@ -415,12 +415,31 @@ mod/pose/steps per color); drop the separate `mod`/`steps`/`pose` keys.
the old top-level mod/steps/pose keys). Default-guard `matColorDefs[vi][c].mod`
(may be undefined in old cache) in `renderPattern`.
- [ ] **Step 5: CSS + verify**
- [ ] **Step 5: Restore the per-row LIVE instrument select (left of each matrix row)**
For fast live access, re-add a per-voice instrument `<select>` on the LEFT of each
matrix row (it was removed when controls moved into the modal). It sets the VOICE
DEFAULT instrument (`~matInstruments[vi]`, used by any color whose own `inst` is
nil) — per-color overrides stay in the modal. In `renderMatrix`'s voice-row loop,
after the `.mvoice-label` (before the `.minst-edit` "..." button), insert:
```javascript
const vinst = document.createElement("select");
vinst.className = "minst"; vinst.dataset.vi = vi;
[["default","default"]].concat((MATRIX_INST_CHOICES[MATRIX_VOICES[vi]]||[]).map(s=>[s,s]))
.forEach(([val,txt])=>{const o=document.createElement("option");o.value=val;o.textContent=txt;vinst.appendChild(o);});
vinst.value = matInst[vi] || "default";
vinst.addEventListener("change", ()=>{ matInst[vi]=vinst.value; saveMatState(); send("/matrix/instrument", vi, vinst.value); });
row.appendChild(vinst);
```
Re-add the header spacer so bar numbers stay aligned: in the header-row build, after
the voice-label corner, append `const ih=document.createElement("span"); ih.className="minst-head"; headerRow.appendChild(ih);` and restore the `.minst`/`.minst-head` CSS (sticky-left, 78px). Keep `matInst[vi]` in sync from the existing `/matrix/instrument` WS handler (update the row select by `.minst[data-vi]`).
- [ ] **Step 6: CSS + verify**
`.cd-colorsel { display:flex; gap:4px; margin:6px 0; } .cd-colorsel button.on { outline:2px solid #fff; } .cd-pattern { display:flex; flex-direction:column; gap:6px; }`
plus reuse `.seq-*`, `.cd-*` rules. Run `node --check`. Manual: the color selector
switches the pattern; editing one color's instrument/variation/sequence/effect/pose
only affects that color and round-trips; audition cycles colors.
plus restore `.minst { position:sticky; left:54px; z-index:2; width:78px; font-size:10px; background:#1a1a1a; color:#ccc; border:1px solid #333; flex-shrink:0; }` and `.minst-head { width:78px; flex-shrink:0; }`, and reuse `.seq-*`/`.cd-*` rules. Run `node --check`. Manual: the row-left instrument select changes the voice default live; the color selector switches the pattern; editing a color's instrument/variation/sequence/effect/pose only affects that color and round-trips; audition cycles colors.
- [ ] **Step 6: Commit**
+5 -1
View File
@@ -149,7 +149,11 @@ File.exists(~matDir).not.if({ ("mkdir -p " ++ ~matDir.quote).systemCmd });
(tgt == \pan).if({
[\pan, Pfunc { (~matModSourceVal.(src) * 2 - 1) * d }]
}, {
[\amp, Pfunc { ((spec[\amp] ? 1.0) * volOf.value) * (1 + (d * (~matModSourceVal.(src) * 2 - 1))).max(0) }]
(tgt == \rev).if({
[\rev, Pfunc { (~matModSourceVal.(src) * d).clip(0, 1) }]
}, {
[\amp, Pfunc { ((spec[\amp] ? 1.0) * volOf.value) * (1 + (d * (~matModSourceVal.(src) * 2 - 1))).max(0) }]
})
})
})
})
@@ -444,6 +444,12 @@ pass = pass and: { ~matModPairs.notNil };
~ev = ~matVariation.(\acid, 2, 5).asStream.next(());
pass = pass and: { ~ev[\cutoff].notNil and: { ~ev[\cutoff] > 3000 } };
~matColorDefs[5][2][\mod] = nil;
// a color with a rev mod -> the produced event has a \rev key
~matModCache = IdentityDictionary[ \rHandY -> 1.0 ];
~matColorDefs[0][1][\mod] = (source: \rHandY, target: \rev, depth: 0.5);
~revEv = ~matVariation.(\kick, 1, 0).asStream.next(());
pass = pass and: { ~revEv[\rev].notNil };
~matColorDefs[0][1][\mod] = nil;
// per-voice ~matMod removed
pass = pass and: { ~matMod.isNil };
pass = pass and: { ~matPoseBindings.isNil };