Spaces:
Sleeping
Sleeping
| title: AIRWAVES | |
| emoji: ๐๏ธ | |
| colorFrom: indigo | |
| colorTo: pink | |
| sdk: gradio | |
| sdk_version: 6.16.0 | |
| app_file: app.py | |
| pinned: false | |
| license: apache-2.0 | |
| models: | |
| - openbmb/VoxCPM2 | |
| tags: | |
| - track:wood | |
| - sponsor:openbmb | |
| - achievement:offbrand | |
| - build-small-hackathon | |
| # ๐๏ธ AIRWAVES | |
| **No turntables, no controller โ conduct a live set with your bare hands, and a tiny AI hype-man calls your drops in real time.** | |
| Point your webcam at your hands and *play the air*. A raised palm screams the filter open; a tilt warps the record like vinyl; a pinch drenches it in reverb; a clenched fist builds a stutter and throwing it open slams the **drop**. Bend the built-in beat โ or **capture a browser tab (YouTube, SoundCloud) and bend any song with your hands.** And riding over the top: an **AI club-MC, voiced by VoxCPM2**, that reacts to what you just did. | |
| > โถ๏ธ **Best in Chrome on desktop.** Open the direct app URL (not the embedded preview), allow the camera, and put your hands up. | |
| --- | |
| ## ๐ฎ How to play | |
| | Gesture | What it does | | |
| |---|---| | |
| | โ **Raise / lower a hand** | Open / close the low-pass filter โ pull the track up out of the floor *(the hero move)* | | |
| | โป **Tilt your hand** | Warp the record like a turntable โ speed + pitch *(built-in beat only)* | | |
| | ๐ค **Pinch** (thumb โ index) | Reverb & echo โ throw the sound into a cathedral | | |
| | โ **Clench โ throw open** | Build a beat-stutter, then **DROP** | | |
| | ๐ **Two hands** | Crossfade the mix (drums โ melody) | | |
| | ๐ฌ **"Bend a tab"** | Capture a Chrome tab's audio (YouTubeโฆ) and bend a real song live | | |
| --- | |
| ## ๐ง The "her" pattern (small model used smartly) | |
| Every real-time *fact* is owned by deterministic browser code โ the beat clock, the exact filter Hz, the gains, the loop points, which gesture maps to what. **No model is anywhere in the audio path**, so the bend is instant and never glitches. The one model, **VoxCPM2 (OpenBMB, 2.29B)**, owns only what code can't: it *designs a club-MC voice from a text description* (no reference audio) and speaks timed callouts that react to your performance. The hands make the music; the AI reacts to *you*. | |
| ## ๐ ๏ธ The tech we used | |
| **Vision (100% in-browser, camera never leaves your device)** | |
| - **MediaPipe Tasks-Vision `HandLandmarker`** โ 21 hand landmarks/hand, two hands, GPU-with-CPU fallback, ~30fps | |
| - Deterministic gesture math (palm height, pinch, fist-curl, wrist roll, two-hand position) โ EMA-smoothed control scalars | |
| **Audio (Web Audio API, ~60fps, zero model in the realtime path)** | |
| - A reggaeton/electronic bed **synthesized from scratch** (`OfflineAudioContext`) into 3 phase-locked looping stems โ no samples, no licensing | |
| - `BiquadFilterNode` resonant low-pass sweep ยท `playbackRate` turntable warp ยท parallel `ConvolverNode` reverb (procedural impulse) + `DelayNode` echo ยท a look-ahead **stutter gate** ยท per-stem `GainNode` crossfade ยท `AnalyserNode` spectrum visualizer | |
| - **`getDisplayMedia({ audio: { suppressLocalAudioPlayback } })`** to capture and bend a browser tab's audio through the same effects chain | |
| **The model** | |
| - **VoxCPM2** (OpenBMB) โ voice-design TTS, the AI hype-man, running on **ZeroGPU** | |
| **Serving** | |
| - `gr.Server` (FastAPI) on a ZeroGPU Space. The SPA is static; the only server/GPU touch is `GET /api/hype`, which synthesizes the hype-man voice bank **once** inside a single `@spaces.GPU` window, caches it, and serves it to everyone instantly. Graceful fallback: if the voice is unavailable, the hype-man uses browser speech and the hand-bending is untouched. | |
| ``` | |
| webcam โโถ MediaPipe hand landmarks (browser) โโถ smoothed gesture scalars โโ zero latency, no model | |
| โผ | |
| 3 synthesized stems / captured tab โโถ filter โโถ reverb ยท delay ยท stutter โโถ master โโถ ๐ | |
| โโ in parallel โโ | |
| musical-event detector (browser) โโถ /api/hype โโถ VoxCPM2 (ZeroGPU, cached once) โโถ AI MC | |
| ``` | |
| ## ๐ Privacy | |
| All computer vision and all audio run in your browser. The camera feed never leaves your device โ only short text lines are sent to synthesize the hype-man's voice. | |
| ## โถ๏ธ Run locally | |
| ```bash | |
| cd web && python3 -m http.server 8777 # open http://localhost:8777 in Chrome | |
| # Full app with the VoxCPM2 hype-man: | |
| AIRWAVES_BACKEND=zerogpu python app.py # (mock backend by default โ a placeholder beep) | |
| ``` | |
| --- | |
| ## ๐ Build Small Hackathon | |
| - **Track:** Thousand Token Wood ยท **Sponsor model:** OpenBMB **VoxCPM2** | |
| - ๐ฌ **Demo video:** https://youtu.be/-jkUObdYr9U | |
| - ๐ฆ **Launch post:** https://x.com/_Andresio/status/2066619396668449212 | |
| Model: [openbmb/VoxCPM2](https://huggingface.co/openbmb/VoxCPM2) ยท Built with MediaPipe Tasks-Vision + the Web Audio API. | |