
OSCILLATION
Ghojualamanchu → MIDI → Harmonic Robotics
A cognitive agent that thinks in oscillations, bridged to physical actuators via MIDI.
What Is Oscillation?
Oscillation is a project to build a closed-loop bridge between a cognitive agent (Ghojualamanchu) and physical actuators (servos, motors, drones), using MIDI as the transmission protocol and harmonic oscillation as the unified control language.
The core bet: Ghojualamanchu thinks in oscillations. MIDI carries oscillations. Harmonic oscillation — ω, amplitude, phase, damping — is the same math whether describing a brain wave, a musical note, or a robot’s gait.
Architecture
Ghojualamanchu (cognition)
↓ writes oscillation_target.json
↓ mido / USB MIDI
USB MIDI → ESP32-S3 (hopf_cpg_firmware.ino)
CC1=ω CC2=A CC3=φ CC4=ζ | Note#=servo | PitchBend=fine ω
↓ Hopf CPG @ 500 Hz → SimpleFOC → PWM
SG90 Servo ↔ MPU6050 / AS5600
↓ serial / OSC telemetry
resonance_monitor.py (FFT → ω_measured)
↓ writes resonance_report.json
← Ghojualamanchu (observe / correct)
↓ writes oscillation_target.json
↓ mido / USB MIDI
USB MIDI → ESP32-S3 (hopf_cpg_firmware.ino)
CC1=ω CC2=A CC3=φ CC4=ζ | Note#=servo | PitchBend=fine ω
↓ Hopf CPG @ 500 Hz → SimpleFOC → PWM
SG90 Servo ↔ MPU6050 / AS5600
↓ serial / OSC telemetry
resonance_monitor.py (FFT → ω_measured)
↓ writes resonance_report.json
← Ghojualamanchu (observe / correct)
Oscillation Parameters
| Symbol | Name | MIDI Equivalent | Range |
|---|---|---|---|
ω | Angular frequency | CC74 (log-mapped) | 0.1–25 rad/s |
A | Amplitude | Note velocity | 0.0–1.0 |
φ | Phase offset | CC3 / pitch bend | 0–2π rad |
ζ | Damping ratio | CC4 | 0.0–1.0 |
Two-Speed Loop
| Loop | Rate | Runs On | What It Does |
|---|---|---|---|
| Slow (cognitive) | ~1 Hz | Ghojualamanchu | Reads resonance_report.json, updates oscillation_target.json, logs to hippocampus |
| Fast (motor) | 500 Hz | ESP32 firmware | Hopf CPG integration, SimpleFOC closed-loop, encoder/IMU feedback |
Build Stages
| Stage | Goal | Cost | Status |
|---|---|---|---|
| ooze | Ghojualamanchu → MIDI → one servo moves | ~€25 | Next |
| pwm_test | Encoder feedback → FFT → ω_measured within 5% | +€8 | Todo |
| midi_hopfcpg | Hopf CPG firmware running on ESP32, driven by MIDI CC | Software | Todo |
| telemetry | MPU6050 → ESP32 → OSC → Ghojualamanchu observes | Software | Todo |
| full_loop | Ghojualamanchu closes the loop | Software | Todo |
| multi_joint | 4 servos, MIDI clock sync, correct phase offsets | +€25 | Todo |
| swarm | N drones, Kuramoto coupling, order parameter r | Varies | Todo |
MIDI CC Protocol
| Channel | Use |
|---|---|
| Ch 1 | Servos 1–8: CC1=ω, CC2=A, CC3=φ, CC4=ζ per servo |
| Ch 4 | System: CC64=EMERGENCY_STOP, CC65=RESET, CC66=MODE, CC67=CLOCK_PHASE_MASTER |
Frequency mapping:
CC=0 → 0.1 rad/s | CC=64 → 1.6 rad/s | CC=96 → 6.4 rad/s | CC=127 → 25.6 rad/s
ω = 0.1 × 2^(CC/16) rad/sCC=0 → 0.1 rad/s | CC=64 → 1.6 rad/s | CC=96 → 6.4 rad/s | CC=127 → 25.6 rad/s
Key Files
FLUX Codec Integration
FLUX (physics-based video compression at /home/workspace/flux-codec/) provides motion fields as the oscillation parameter source:
Video / Physics Sim
↓ FLUX Block 3 (optical flow)
↓ flux_to_omega.py (FFT → ω, A, φ, γ)
↓ oscillation_target.json
→ Ghojualamanchu → MIDI CC → Servo
↓ FLUX Block 3 (optical flow)
↓ flux_to_omega.py (FFT → ω, A, φ, γ)
↓ oscillation_target.json
→ Ghojualamanchu → MIDI CC → Servo
Note on Exanima: Exanima was originally referenced as a physics training source. It is a medieval combat ARPG — not a robotics simulator, no API, no motion capture export. Use MuJoCo or Genesis for sim-to-real training instead.
Research Key Findings
- MIDI → servo is proven — MidiBanger, Adafruit Robot Lyre, jammotors all confirm this works
- The novel contribution is closed-loop feedback: sensor → Ghojualamanchu → parameter correction → MIDI → CPG
- CPG on microcontroller is standard — MIDI is configuration, not streaming; firmware interpolates at 1–10 kHz
- Kuramoto model for swarm sync: Ghojualamanchu broadcasts MIDI clock, computes order parameter r, adjusts tempo
- MPU6050 + ESP32 = €4–8 sensor stack for full oscillator state (position, velocity, acceleration)
Budget
| Stage | Cost |
|---|---|
| ooze (first servo) | ~€25 |
| Full project (4 servos) | ~€60–80 |
Next Actions
- Buy hardware: ESP32-S3-DevKitC-1 + SG90 + AS5600 + MPU6050 (~€20–25)
- Flash hopf_cpg_firmware.ino to ESP32-S3, verify serial MIDI parsing
- Install
mido+rtmidion Zo Computer, test MIDI out to ESP32 - Wire SG90 to ESP32, verify servo responds to MIDI CC
- Connect AS5600 via I2C, verify encoder reads via serial
- Run resonance_monitor.py, verify FFT ω_measured accuracy
- Integrate into Ghojualamanchu — read resonance_report.json on heartbeat
Oscillation SOP v1.0 — built from 18 research cycles
Ghojualamanchu × MIDI × Harmonic Robotics
