Air Synthesizer With Color Tracking in 10 Min
32 Views, 0 Favorites, 0 Comments
Air Synthesizer With Color Tracking in 10 Min
This tutorial shows how to build an Air Synthesizer using visual programming blocks. Move a colored ball through camera zones to play musical instruments in real-time—no coding required!
What You'll Build
An air synthesizer with:
- Real-time color ball tracking
- 5 playable zones
- Multiple instruments via Sound Font
- Dynamic instrument selection
- No coding required
Supplies
Required Components
- Raspberry Pi, BeagleBone, Jetson Nano, or PC
- Camera (Raspberry Pi Camera Module or USB Camera)
- Speaker (3.5mm audio jack, USB audio adapter, or Bluetooth)
- Colored ball on a stick (ping pong ball recommended)
Quick Start
- Download and install Grablo software on your Raspberry Pi
- Connect camera and speaker
- Get this project
- Open Grablo app in your browser
- Connect to your Raspberry Pi and hit RUN!
- Adjust color range in Color Picker to match your ball
- Change Bank and Preset values to select different instruments
To build it yourself, continue to Step 2.
Create Dashboard
Create Project & Dashboard
- Go to https://app.grablo.co
- Click "Create Project"
- Name your project
- Create a new dashboard
Add Widgets
- Camera Widget: Select your camera to display live video feed
- Color Picker Widget × 2: Create "Start Color" and "End Color" variables for tracking range
- Input Widget × 2: Create "Bank" and "Preset" variables for instrument selection
Logic - Start Camera & Play Notes
Control 1: Start Camera
Start the camera when the project begins.
- Condition (Once): Runs once at project start
- Action (AI Camera): Create camera, set Orientation to Horizontal Flip, Command to Start, add Color Tracking for 5 Zones
Control 2-6: Play Notes
Play synthesizer notes when colored object enters each zone.
- Condition (Compare): ZoneDetected = True, Option = Rising Edge
- Action (Synthesizer): Create synthesizer, Command = Note On, Note = C3-G3 (48-55)
💡 Tip: For fastest response, set execution interval to 1ms.
Logic - Instrument Selection
Control 7: Instrument Selection
Change instruments when Bank or Preset value changes.
- Condition (On Change): Bank or Preset variable, Operator = OR
- Action (Synthesizer): Command = Set Instrument, assign Bank and Preset variables
Color Tracking Tips
For best tracking results:
- Use bright colors: Orange, green, or pink work best
- Avoid matching clothes: Don't wear the same color as your ball
- Consistent lighting: Avoid shadows and backlight
- Fine-tune colors: Use HSV tab in Color Picker, adjust H value for precise tracking
Launch Your Project
That's it—you're done!
Launch Your Project
- Open Grablo app in your desktop or mobile browser
- Select your project
- Connect to your Raspberry Pi
- Hit RUN and enjoy!
Expected Results
When you run your project:
- Camera view appears with 5 zones at the bottom
- Move ball into Zone 1: Plays C3 note
- Move through zones: Each zone plays different notes
- Change Bank/Preset: Switches instruments
- Play music by moving the ball through zones!
Video Tutorial
Watch the complete build process in action!
Expand Your Project
Add more functionality:
- Add more zones for a full octave
- Create duet mode with two different colored balls
- Add visual feedback when notes play
Troubleshooting
No sound:
- Check speaker connection
- Verify Bank and Preset values (try Bank = 0, Preset = 0)
- Check audio output settings on Raspberry Pi
Color not tracking:
- Adjust Start/End Color range in Color Picker
- Use HSV tab and fine-tune H value
- Improve lighting conditions
- Avoid wearing clothes matching ball color
Notes playing multiple times:
- Verify Rising Edge option is set in conditions
- Check that zones don't overlap
- Increase Min Area to ignore noise
Sound Font Resources
- Polyphone (Sound Font Editor): https://www.polyphone.io/
- Sound Font used in this project: https://musical-artifacts.com/artifacts/7293
Resources
- Website: https://grablo.co
- Download: https://grablo.co/download
- Web App: https://app.grablo.co
- Docs: https://doc.grablo.co
- Support: support@grablo.co