From 764bf02dc80306f516233b409f54ac2c3c7f47a7 Mon Sep 17 00:00:00 2001 From: clement Date: Sun, 28 Jun 2026 13:17:31 +0200 Subject: [PATCH] feat: load air-piano and hook hand modulation Wire finger_piano.scd into both data-only boot paths so OSCdef /pose/finger and ~fp* API are available at runtime. Call ~fpModTick on every /pose/hands frame (~30 Hz) for continuous air-piano modulation. Document FINGER_PIANO env vars in CLAUDE.md. --- CLAUDE.md | 3 +++ sound_algo/boot.data-only.scd | 1 + sound_algo/control/data_feeds.scd | 1 + sound_algo/data_only/boot.scd | 1 + 4 files changed, 6 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index e7a2caa..98e7537 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -68,6 +68,9 @@ Toujours répondre en français à l'utilisateur. Code, commentaires de code, co | `ICP_LIDAR_HOST` | _(unset)_ | iPhone ARBodyTracker IP when `ICP_FUSION=1` | | `ICP_LIDAR_PORT` | `5500` | iPhone ARMesh TCP port | | `ICP_LIDAR_EXTRINSIC` | `~/.config/av-live/lidar_extrinsic.json` | extrinsic JSON path | +| `FINGER_PIANO` | `0` | `1` enables air-piano finger strike emission from data_only_viz | +| `FINGER_STRIKE_VEL` | `0.02` | downward relative-velocity threshold for a strike (normalized image units/frame) | +| `FINGER_STRIKE_REFRACTORY_MS` | `120` | min ms between strikes per finger | ## Conventions globales diff --git a/sound_algo/boot.data-only.scd b/sound_algo/boot.data-only.scd index 98c96e4..0f719b3 100644 --- a/sound_algo/boot.data-only.scd +++ b/sound_algo/boot.data-only.scd @@ -38,6 +38,7 @@ Routine({ "[boot.data-only] loading data_feeds OSCdef...".postln; (~base ++ "control/data_feeds.scd").load; + (~base ++ "control/finger_piano.scd").load; 1.0.wait; "[boot.data-only] loading web_bridge OSCdef + sync push...".postln; diff --git a/sound_algo/control/data_feeds.scd b/sound_algo/control/data_feeds.scd index 84a69fe..6ee64c7 100644 --- a/sound_algo/control/data_feeds.scd +++ b/sound_algo/control/data_feeds.scd @@ -509,6 +509,7 @@ OSCdef(\poseHands, { |msg| ~handFeat[\ropen] = msg[8]; ~handFeat[\rspeed] = msg[9]; ~handFeat[\dist] = msg[10]; + ~fpModTick !? { ~fpModTick.value }; // air-piano modulation continue }, '/pose/hands'); // Body wrists (skeleton, tracked even when hands are occluded/too small). diff --git a/sound_algo/data_only/boot.scd b/sound_algo/data_only/boot.scd index a952e67..4603f6d 100644 --- a/sound_algo/data_only/boot.scd +++ b/sound_algo/data_only/boot.scd @@ -149,6 +149,7 @@ Routine({ // -- 5) OSCdef des flux data_feeds ----- (~repoRoot ++ "control/data_feeds.scd").load; + (~repoRoot ++ "control/finger_piano.scd").load; 0.5.wait; // -- 6) Bibliotheque de scenes -----