Neural Harmonica — AV Entrainment Scaffolding (Spatial Motion Activated) Objective Create phase-coherent audiovisual entrainment media for any binaural frequency set with mandatory spatial motion activation. Step 1 — Define binaural parameters LEFT_FREQ = carrier frequency (Hz) BEAT_FREQ = entrainment frequency (Hz) RIGHT_FREQ = LEFT_FREQ + BEAT_FREQ DURATION = seconds Step 2 — Generate cosine-phase-aligned binaural audio L(t) = cos(2π LEFT_FREQ t) R(t) = cos(2π RIGHT_FREQ t) Step 3 — Determine visual frame rate (harmonic multiple) FPS = BEAT_FREQ × N (N ≥ 8 recommended) Step 4 — Construct phase-locked luminance envelope Brightness(t) = 0.5 × (1 + cos(2π BEAT_FREQ t)) Envelope begins at maximum luminance at t = 0 (cosine phase). Step 5 — Spatial Motion Activation Layer (MANDATORY) Directional cycle: Phase 1: Down shift Phase 2: Right shift Phase 3: Up shift Phase 4: Left shift Requirements: • Each phase begins on an integer multiple of the beat period (beat boundary) • Motion amplitude progresses smoothly across the phase duration • Sequence repeats continuously • Motion and luminance remain phase-aligned Step 6 — Render visual frames t = frame_index / FPS Compute luminance envelope Compute spatial displacement Render frame Step 7 — Audio/Video mux ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a aac output.mp4 Step 8 — Phase calibration header (research-grade) Add: • Visual frame-0 calibration marker (flash + timecode) • Audio impulse tick at t = 0 Measure playback latency (flash vs tick) on target device and compensate for device-level sync.