feat(data-only): ingest /pose/hands into handFeat
Add OSCdef(\poseHands) to data_feeds.scd storing lx/ly/lopen/lspeed, rx/ry/ropen/rspeed/dist into ~handFeat Dictionary (9 floats, pid=0). Initialize ~handFeat alongside existing ~poseState/~poseKin. Load scene_pose_action.scd in boot.scd after scenes.scd so ~mapPoseToFx is defined at runtime (was silently dead before). Document /pose/hands contract in data_only_viz/README.md.
This commit is contained in:
@@ -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).
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user