feat(viz): gate audio-scene keys off by default
CI build oscope-of / build-check (push) Has been cancelled

qsdfghjkl fired auto-synth scenes on stray keypresses during matrix
performance — same gate as wxcvbn (VIZ_AUDIO_KEYS=1 re-enables). The
m matrix-mode shortcut (scene stop + openpos) stays active.
This commit is contained in:
L'électron rare
2026-07-02 16:53:27 +02:00
parent 6d43120c0a
commit 8d93163766
3 changed files with 19 additions and 3 deletions
+5
View File
@@ -43,6 +43,7 @@ ARKIT_BONE_MAX 0.5 float max bone length (norm) for ARKit sk
ARKIT_FULL_SKELETON "1" bool draw full 91-joint ARKit body (!=0 = True)
VIZ_HUD "0" bool show debug HUD overlay
VIZ_SOURCE_KEYS "0" bool wxcvbn source-bundle shortcuts (off: perf safety)
VIZ_AUDIO_KEYS "0" bool qsdfghjkl audio-scene shortcuts (off: perf safety; m stays)
IPHONE_OSC_PORT 57128 int UDP port for iPhone ARBodyTracker /body3d/kp
CONCERT_MIRROR "1" bool mirror video horizontally (!=0 = True)
ICP_FUSION "0" bool enable ICP LiDAR fusion (only "1" = True)
@@ -137,6 +138,9 @@ class VizConfig:
# keypress during a matrix performance switches the audio scene
# (user-disabled live 2026-07-02). VIZ_SOURCE_KEYS=1 re-enables.
viz_source_keys: bool = False
# Audio-scene row (qsdfghjkl): same perf-safety gate, same date. The
# special m key (matrix mode: scene stop + openpos viz) stays active.
viz_audio_keys: bool = False
# ---- iPhone OSC ------------------------------------------------------
iphone_osc_port: int = 57128
@@ -285,6 +289,7 @@ class VizConfig:
arkit_full_skeleton=_bool_ne0("ARKIT_FULL_SKELETON", True),
viz_hud=_bool_std("VIZ_HUD", False),
viz_source_keys=_bool_std("VIZ_SOURCE_KEYS", False),
viz_audio_keys=_bool_std("VIZ_AUDIO_KEYS", False),
iphone_osc_port=_int("IPHONE_OSC_PORT", 57128),
concert_mirror=_bool_ne0("CONCERT_MIRROR", True),
# ICP_FUSION / MULTIHMR_AUTOCAST use strict "1" convention
+8 -3
View File
@@ -72,7 +72,9 @@ class AppDelegate(NSObject):
self._scClient = SimpleUDPClient("127.0.0.1", opts.sclang_port)
self._pose_worker = None
from .config import VizConfig as _VizConfig
self._source_keys = _VizConfig.from_env().viz_source_keys
_kcfg = _VizConfig.from_env()
self._source_keys = _kcfg.viz_source_keys
self._audio_keys = _kcfg.viz_audio_keys
return self
def applicationDidFinishLaunching_(self, notification): # noqa: N802
@@ -635,8 +637,11 @@ class AppDelegate(NSObject):
self._user_viz_lock_t = _t.monotonic()
LOG.info("[key] m -> scene stop + viz openpos (matrix mode)")
return None
# qsdfghjkl -> audio (scene SC)
for kk, scene in KEYMAP_AUDIO:
# qsdfghjkl -> audio (scene SC): gated OFF by default like wxcvbn
# (VIZ_AUDIO_KEYS=1 re-enables) — stray keys fire auto-synth scenes
# mid-performance. The m matrix-mode shortcut above stays active.
_audio_maps = KEYMAP_AUDIO if getattr(self, "_audio_keys", False) else ()
for kk, scene in _audio_maps:
if k == kk:
self._scClient.send_message("/control/doScene", [scene])
with self._state.lock():
+6
View File
@@ -413,3 +413,9 @@ def test_viz_source_keys_default_off():
cfg = VizConfig.from_env({})
assert cfg.viz_source_keys is False
assert VizConfig.from_env({"VIZ_SOURCE_KEYS": "1"}).viz_source_keys is True
def test_viz_audio_keys_default_off():
cfg = VizConfig.from_env({})
assert cfg.viz_audio_keys is False
assert VizConfig.from_env({"VIZ_AUDIO_KEYS": "1"}).viz_audio_keys is True