Skip to content

feat: EmbodiedConductor — dual-mode bio-musical orchestrator#23

Open
Copilot wants to merge 2 commits into
BJ_V1.1_Taurifrom
copilot/analyze-vivaldi-management
Open

feat: EmbodiedConductor — dual-mode bio-musical orchestrator#23
Copilot wants to merge 2 commits into
BJ_V1.1_Taurifrom
copilot/analyze-vivaldi-management

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

Summary

Implements the complete Embodied Conductor system for BrainJam — a dual-mode bio-musical orchestrator that bridges human physiology (EEG, PPG/HRV, gestures) with real-time music control.

New Modules

File Description
performance_system/embodied_conductor.py Top-level orchestrator with CREATOR/MAESTRO dual mode, 16-bar latent phrase memory, MIDI rubato engine, and unified ConductorState event
performance_system/biofeedback/ppg_hrv_pipeline.py Butterworth band-pass filter (0.7–3.5 Hz) → peak detection → rolling RMSSD → rubato control output
performance_system/mapping_models/dissonance_index.py EEG beta/alpha ratio mapped via sigmoid to harmonic tension (Creator) or velocity/articulation pressure (Maestro)
performance_system/embodied/predictive_gesture.py OLS-based 500 ms latency-compensation predictor for MediaPipe hand positions; adds hand-closure scalar
performance_system/signals/realtime/mobile_sensor_bridge.py Async WebSocket server (port 9001) ingesting phone-camera PPG frames with timestamp normalisation and jitter filtering
docs/architecture/embodied_conductor.md Architecture reference with full mathematical annotations for PhD proposal documentation

Changes to Existing Files

  • performance_system/realtime/event_bus.py — Added CONDUCTOR_STATE, PPG_UPDATE, MODE_CHANGED event types
  • performance_system/biofeedback/__init__.py — Export PPGHRVPipeline
  • performance_system/embodied/__init__.py — Export PredictiveGestureController, PredictedGestureState
  • performance_system/signals/realtime/__init__.py — Export MobileSensorBridge

Tests

  • tests/test_embodied_conductor.py51 tests, all passing
    • PPGHRVPipeline: RMSSD computation, Butterworth filter, simulate mode, quality gating
    • DissonanceIndex: band ratio normalisation, EMA smoothing, articulation thresholds
    • PredictiveGestureController: OLS prediction, hand closure, z_max boundary
    • LatentPhraseMemory: store/recall/mutation, cosine similarity threshold
    • EmbodiedConductor: dual-mode ticks, mode switching events, async lifecycle, phrase recall
    • Regressions: existing GestureController, HRVProcessor, and EventBus unchanged

Mathematical Reference (Quick Summary)

PPG → RMSSD:   rubato_factor = clip((RMSSD_ms − 15) / (80 − 15), 0, 1)
EEG tension:   D = sigmoid(k · (β/α − μ)),  k=2.5, μ=1.2
Gesture pred:  p̂(t+h) = v̄·(t+h) + p₀  via OLS (h=500 ms)
Rubato engine: BPM_mod = BPM_base / (1 + 0.25·(2R−1))
Phrase recall: cos_sim(v_current, v_stored) ≥ 0.92

Copilot AI and others added 2 commits May 13, 2026 19:42
…ine, DissonanceIndex, and PredictiveGestureController

Agent-Logs-Url: https://github.com/curiousbrutus/brainjam/sessions/e7b7bcbd-958c-4ce8-a090-7c2045ad79bc

Co-authored-by: optimedproje-oss <273952893+optimedproje-oss@users.noreply.github.com>
…gs, add z_max boundary test

Agent-Logs-Url: https://github.com/curiousbrutus/brainjam/sessions/e7b7bcbd-958c-4ce8-a090-7c2045ad79bc

Co-authored-by: optimedproje-oss <273952893+optimedproje-oss@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants