Neural data sonification for the Phantom BCI stack.
Transform brain signals into an interactive musical experience. PhantomMusic streams neural data from PhantomLink and converts neuron firing patterns into real-time synthesized music.
- 🎹 Neural Orchestra — 142 neurons mapped to 4 instrument groups (synth, drums, bass, pad)
- 🎯 Target Chords — MC_Maze targets trigger harmonic chord progressions
- 📊 Live Visualization — Real-time neural activity display with color-coded neuron groups
- 🔬 Diagnostic Tools — Mapping inspector and scientific target protocols
- 🎛️ Audio Controls — Multiple scales (pentatonic, minor, major, blues), volume, mute
- 🔗 PhantomLink Integration — Direct WebSocket streaming from neural datasets
# Install dependencies
npm install
# Start dev server
npm run devOpen http://localhost:5173 and enter a PhantomLink session code.
| Neuron Group | Channels | Instrument | Sound |
|---|---|---|---|
| Synth | 0-35 | PolySynth | Melodic leads |
| Drums | 36-70 | MembraneSynth + MetalSynth | Kick & hi-hat |
| Bass | 71-105 | MonoSynth | Deep bass lines |
| Pad | 106-141 | FMSynth | Ambient textures |
When the target position changes in the dataset, a corresponding chord plays:
- Target 0 → C Major
- Target 1 → D Major
- Target 2 → E Major
- Vite + React 19 + TypeScript
- Tone.js — Web Audio synthesis
- Zustand — State management
- Framer Motion — Animations
- Tailwind CSS v4 — Styling
- msgpack-lite — Binary WebSocket decoding
PhantomMusic connects to PhantomLink's binary WebSocket stream:
wss://phantomlink.fly.dev/stream/binary/{sessionCode}
Messages are MessagePack-encoded StreamPacket objects containing:
spike_data.spike_counts— 142-channel spike countskinematics.velocity— Movement velocityintention.target— Predicted target (0, 1, or 2)
| Project | Description |
|---|---|
| PhantomCore | C++ real-time neural decoder |
| PhantomLink | Python streaming server |
| PhantomLoop | React visualization dashboard |
| PhantomX | PyTorch neural network training |
| PhantomSpecs | Protocol specifications |
| PhantomZip | Rust neural compression codec |
| PhantomMusic | 🎵 Neural sonification (you are here) |
This project was developed with assistance from AI coding assistants and workflows:
- Claude Opus 4.5 (Anthropic)
- Claude Sonnet 4.5 (Anthropic)
- Gemini 3.0 Pro (Google)
- Grok code fast 1 (xAI)
MIT