Project Info
Inspiration
We’re an international team, and music is one of the few languages everyone on our team shares. No matter where we’re from, we’ve all used everyday objects, desks, bottles, and brooms to make rhythm or pretend instruments. We wanted to build something that lets anyone express themselves musically and develop their musical skills without needing expensive gear or formal training.
What it does
Maestro turns a broom into a playable guitar and music studio. Using a camera, hand tracking, and sound mapping, we detect a broom and map your hand movements to musical notes so you can instantly play it like a real instrument. An iPhone companion detects pressed “strings,” letting you form chords and control pitch while strumming in the air. If you have a broom, you have an instrument. Maestro also acts as a music coach and generator. After you play, the system analyzes your posture, timing, and sound, then gives short, actionable feedback through an AI tutor. In generation mode, what you play on the broom becomes the seed for a fully produced track: your performance is analyzed and expanded into new music. The goal is to make music creation accessible, expressive, and global, from a single everyday object to unlimited instruments and songs.
How we built it
We built Maestro as a real-time multimodal system combining computer vision, hand tracking, audio analysis, and multi-agent AI. Instrument mapping + tracking: MediaPipe hand tracking provides 21 landmarks per hand each frame Wrist + strum fingertip are smoothed to form a virtual guitar “neck” Magenta tape on the broom pole is detected with OpenCV Fretting hand position projected along the pole gives a 0–1 value that drives pitch/octave Strums are detected when the strumming fingertip crosses the neck line with enough velocity An iPhone app detects pressed “strings” and sends chord data to the system Real-time system + web interface: A Python server streams webcam frames over WebSocket Browser UI sends commands (like “get coaching”) and recorded audio The system captures sound-to-feature data and maps gestures to notes live Dual-agent AI coaching: On “stop playing,” the latest fra:me and audio are sent to a GX10 server Qwen2.5-VL analyzes posture and technique from video NVIDIA Music Flamingo analyzes rhythm, timing, and musical style Both agents run in parallel and return structured feedback Feedback is merged into a single script and delivered via on-screen text and TTS Hardware + generation pipeline: Models run on an ASUS GX10 with an NVIDIA Blackwell GPU Separate services handle vision+audio and audio-only flows In generation mode, Music Flamingo analyzes your performance The output is passed to a Suno API pipeline to generate a full track based on what you played
Challenges we ran into
Getting low-latency tracking so strums feel instant and musical Making hand tracking stable across lighting, camera angles, and different brooms Mapping gestures to notes in a way that feels intuitive Syncing iPhone string detection with webcam tracking in real time Running vision + audio models together without slowing feedback Designing short, useful coaching instead of overwhelming users
Accomplishments we're proud of
Turning a literal broom into a playable guitar that feels responsive Creating a system anyone can understand in seconds Making something expressive across cultures and skill levels Getting real-time interaction working end-to-end
What we learned
Latency matters more than model size for musical interaction Multimodal AI (vision + audio) creates much richer feedback Real-time systems require tight coordination between frontend, backend, and models The best demos are immediately understandable and fun
What's next
Support more objects beyond a broom Add multiplayer and collaborative jam mode Personal practice tracking and adaptive coaching Expand generation mode into full song creation tools
Maestro is a real-time air instrument system that combines computer vision (hand tracking + strum detection on a laptop) with a mobile fretboard app (multi-touch on iPhone). The two talk over WebSocket; on each strum, MIDI notes are generated and played through the laptop via FluidSynth. An optional Next.js web app streams the camera feed to the browser and connects to an AI coaching backend (Qwen2.5-VL + Music Flamingo on an ASUS GX10) for form and performance feedback.

Motivation
Learning an instrument is hard—and getting actionable feedback on posture, hand position, and rhythm usually requires a teacher in the room. We wanted to turn a laptop webcam and a phone into a playable string instrument and hook it into an AI coach that can see and hear you.
Maestro takes the “air guitar” idea seriously: you form a neck line with your two wrists in front of the camera, strum with one hand across that line, and use the phone as a multi-touch fretboard to choose strings and frets. The system fuses hand distance, strum velocity, and touch data into MIDI and plays it in real time. When the browser bridge and GX10 are in the loop, a single frame + audio clip can be sent to a dual-agent coach (visual form + audio performance) for structured, culturally aware feedback—so practice becomes more than just playing into the void.
Technical Overview
- Python backend (
src/) — MediaPipe Hand Landmarker (LIVE_STREAM), OpenCV overlay, strum detection (perpendicular crossing velocity), note engine (string + fret + pole position → MIDI), FluidSynth playback. WebSocket server on port 8765 for the phone fretboard. Run withuv run treehacks(OpenCV window) oruv run treehacks-server(headless, for browser). - Browser bridge —
treehacks-serverruns a second WebSocket on port 8766: binary JPEG frames out, JSON commands in. Lets the Next.js app show the camera feed and control start/stop without a local OpenCV window. - Next.js 15 web app (
website/) — TypeScript/Tailwind app for play mode, tutor flows, analysis, and integration with the GX10 dual-agent coach (video frame + audio → visual + audio feedback). - GX10 dual-agent coach — Optional Python service on the ASUS GX10: Qwen2.5-VL for visual form (posture, hands, technique) and Music Flamingo for audio (tempo, rhythm, style). See GX10_INTEGRATION.md.
- iOS fretboard (
fretboard/) — Native Swift/SwiftUI app: multi-touch strings, WebSocket client to the Python backend, CoreMotion optional. Connect to the laptop’s IP and play.
File structure
treehacks/
src/ # Python backend (air instrument + MIDI)
main.py # OpenCV window entry (uv run treehacks)
server.py # Browser bridge + GX10 (uv run treehacks-server)
config.py # Paths, thresholds, ports, note tuning
hand_tracking.py # Hand ID, strum detection, landmark math
drawing.py # OpenCV overlay (neck line, panels, notes)
note_engine.py # String/fret/pole/velocity → MIDI
audio_engine.py # FluidSynth wrapper
websocket_server.py # Phone fretboard WS (port 8765)
pole_detection.py # Magenta-tape pole (hand position → octave)
models.py # FretboardState, PhoneState, PoleState, etc.
website/ # Next.js 15 app
app/
api/ # audio-coach, analysis, realtime, suno, etc.
play/ # Play / live camera
tutor/ # Session, personality, summary
analysis/, remixes/, ...
components/
lib/
fretboard/ # iOS app (Swift/SwiftUI)
fretboard/
ContentView.swift # WebSocketManager, WelcomeScreen, FretboardScreen
RawTouchView # Multi-touch → normalized (x,y) + string
demo/
original.png # Demo screenshot
hand_landmarker.task # MediaPipe model (project root)
soundfont.sf2 # FluidSynth SoundFont (project root)
pyproject.toml # Python deps (uv)
CONTEXT.md # Architecture, protocol, module roles
GX10_INTEGRATION.md # GX10 endpoints, env, usage
README.md
Running the stack
Python (from project root):
- OpenCV + camera + phone WS:
uv run treehacksoruv run python -m src.main - Headless browser bridge (for web app):
uv run treehacks-serveroruv run python -m src.server
System: brew install fluidsynth. Place hand_landmarker.task and a soundfont.sf2 at project root (see CONTEXT.md).
Web app:
cd website && npm install && npm run dev
iOS: Open fretboard/ in Xcode, build, enter the laptop’s IP on the welcome screen.
API (summary)
- WebSocket 8765 — Phone fretboard → Python. JSON
{ "touches": [ { "id", "x", "y", "string" } ] }. - WebSocket 8766 — Browser ↔
treehacks-server. Binary: JPEG frames. JSON:{"action":"start"|"stop"}, status, MIDI events. - GX10 —
POST /dual-coachwithimage_base64,audio_base64,culture,instrument. Returnsvisual_coach(Qwen2.5-VL) andaudio_coach(Music Flamingo). See GX10_INTEGRATION.md.
Conventions
- Python:
src/package, relative imports, config and assets at project root. - Entry points:
uv run treehacks(OpenCV),uv run treehacks-server(browser + GX10). - Next.js: App Router, TypeScript, Tailwind.
License
Apache-2.0. See LICENSE for details.
Analysis
View
Metric
- 15
- 8
- 2
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- Next.jsIn code
- PythonIn code
- ReactIn code
- SwiftIn code
- Tailwind CSSIn code
- TypeScriptIn code
- VercelClaimed
7 of 8 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- CursorCommits
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
1.7 MB
Source files
263
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
markmusic27/treehacks-26
316 files · 44.8 MB · @ c52cf44
Structure
Interface
169 files · 53%Screens, components and styles rendered to the user.
+1 moreAPI & routing
30 files · 9%Request entry points: routes, handlers and controllers.
Application logic
78 files · 25%Domain rules, services and shared utilities.
+8 more
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- TypeScript53%
- Python26%
- YAML15%
- Swift3%
- CSS2%
- Markdown1%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
website/package.json
npm · 62- @hookform/resolvers
- @openai/agents
- @radix-ui/react-accordion
- @radix-ui/react-alert-dialog
- @radix-ui/react-aspect-ratio
- @radix-ui/react-avatar
- @radix-ui/react-checkbox
- @radix-ui/react-collapsible
- @radix-ui/react-context-menu
- @radix-ui/react-dialog
- @radix-ui/react-dropdown-menu
- @radix-ui/react-hover-card
- @radix-ui/react-label
- @radix-ui/react-menubar
- @radix-ui/react-navigation-menu
- @radix-ui/react-popover
- @radix-ui/react-progress
- @radix-ui/react-radio-group
- +44 more
vision/website/package.json
npm · 61- @hookform/resolvers
- @radix-ui/react-accordion
- @radix-ui/react-alert-dialog
- @radix-ui/react-aspect-ratio
- @radix-ui/react-avatar
- @radix-ui/react-checkbox
- @radix-ui/react-collapsible
- @radix-ui/react-context-menu
- @radix-ui/react-dialog
- @radix-ui/react-dropdown-menu
- @radix-ui/react-hover-card
- @radix-ui/react-label
- @radix-ui/react-menubar
- @radix-ui/react-navigation-menu
- @radix-ui/react-popover
- @radix-ui/react-progress
- @radix-ui/react-radio-group
- @radix-ui/react-scroll-area
- +43 more
app/requirements.txt
pypi · 14- basic-pitch
- demucs
- mediapipe
- numpy
- onnxruntime
- opencv-python
- pretty_midi
- pyfluidsynth
- resampy
- scipy
- setuptools
- torchcodec
- websockets
- yt-dlp
MIDI_TO_SOUNDFONT/requirements.txt
pypi · 10- basic-pitch
- demucs
- numpy
- onnxruntime
- pyfluidsynth
- resampy
- scipy
- setuptools
- torchcodec
- yt-dlp
pyproject.toml
pypi · 6- httpx
- mediapipe
- numpy
- opencv-python
- pyfluidsynth
- websockets
vision/pyproject.toml
pypi · 6- httpx
- mediapipe
- numpy
- opencv-python
- pyfluidsynth
- websockets
JAM_BAND/requirements.txt
pypi · 1- pygame
SONG_GENERATION/requirements.txt
pypi · 1- pretty_midi
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.