diff --git a/data_only_viz/README.md b/data_only_viz/README.md new file mode 100644 index 0000000..1a7f83c --- /dev/null +++ b/data_only_viz/README.md @@ -0,0 +1,13 @@ +# data_only_viz + +Python + Metal visualiser for the AV-Live data-only patch. + +## Hand features OSC + +`/pose/hands [pid=0, lx, ly, lopen, lspeed, rx, ry, ropen, rspeed, dist]` + +- Emitted once per pipeline tick by `pose_bridge.send_hands` to sclang `:57121`. +- L = leftmost hand on screen, R = rightmost; absent hand -> its 4 floats are 0. +- Ranges: positions/openness/dist in [0,1]; speed >= 0 (normalized units/frame). +- Consumed by SuperCollider `~handFeat` (data_only) and the Metal renderer uniforms. +- Multi-person is not yet carried (pid is always 0). diff --git a/sound_algo/control/data_feeds.scd b/sound_algo/control/data_feeds.scd index 021e3ce..9e649c4 100644 --- a/sound_algo/control/data_feeds.scd +++ b/sound_algo/control/data_feeds.scd @@ -465,6 +465,7 @@ // ===================================================================== ~poseState = ~poseState ? Dictionary.new; ~poseKin = ~poseKin ? Dictionary.new; +~handFeat = ~handFeat ? Dictionary.new; OSCdef(\poseAction, { |msg| var pid = msg[1]; @@ -495,6 +496,18 @@ OSCdef(\poseLeave, { |msg| ~poseKin.removeAt(pid); }, '/pose/leave'); +OSCdef(\poseHands, { |msg| + ~handFeat[\lx] = msg[2]; + ~handFeat[\ly] = msg[3]; + ~handFeat[\lopen] = msg[4]; + ~handFeat[\lspeed] = msg[5]; + ~handFeat[\rx] = msg[6]; + ~handFeat[\ry] = msg[7]; + ~handFeat[\ropen] = msg[8]; + ~handFeat[\rspeed] = msg[9]; + ~handFeat[\dist] = msg[10]; +}, '/pose/hands'); + "[OK] action-head OSC handlers".postln; "[data_feeds] OSCdef installes (USGS, SWPC, NETZ, RTE, BLITZ, OPENSKY, BSKY, MEMPOOL, GCN).".postln; diff --git a/sound_algo/data_only/boot.scd b/sound_algo/data_only/boot.scd index 2923041..339f5c9 100644 --- a/sound_algo/data_only/boot.scd +++ b/sound_algo/data_only/boot.scd @@ -133,6 +133,10 @@ Routine({ (~base ++ "scenes.scd").load; 0.5.wait; + // -- 6b. Pose/hand -> FX mapping ----- + (~base ++ "scene_pose_action.scd").load; + 0.5.wait; + // -- 7) Demarre la scene par defaut ----- if(~doScene.isNil) { "[data-only/boot] ERREUR : ~doScene non defini".warn;