Air Synthesizer With Color Tracking in 10 Min

by KimY21 in Circuits > Audio

32 Views, 0 Favorites, 0 Comments

Air Synthesizer With Color Tracking in 10 Min

Air Synthesizer - Demo

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:

  1. Real-time color ball tracking
  2. 5 playable zones
  3. Multiple instruments via Sound Font
  4. Dynamic instrument selection
  5. No coding required

Supplies

Required Components

  1. Raspberry Pi, BeagleBone, Jetson Nano, or PC
  2. Camera (Raspberry Pi Camera Module or USB Camera)
  3. Speaker (3.5mm audio jack, USB audio adapter, or Bluetooth)
  4. Colored ball on a stick (ping pong ball recommended)

Quick Start

  1. Download and install Grablo software on your Raspberry Pi
  2. Connect camera and speaker
  3. Get this project
  4. Open Grablo app in your browser
  5. Connect to your Raspberry Pi and hit RUN!
  6. Adjust color range in Color Picker to match your ball
  7. Change Bank and Preset values to select different instruments


To build it yourself, continue to Step 2.

Create Dashboard

2025-12-17_13-29-00.png

Create Project & Dashboard

  1. Go to https://app.grablo.co
  2. Click "Create Project"
  3. Name your project
  4. Create a new dashboard


Add Widgets

  1. Camera Widget: Select your camera to display live video feed
  2. Color Picker Widget × 2: Create "Start Color" and "End Color" variables for tracking range
  3. Input Widget × 2: Create "Bank" and "Preset" variables for instrument selection

Logic - Start Camera & Play Notes

2025-12-17_13-26-00.png
2025-12-17_13-26-40.png

Control 1: Start Camera

Start the camera when the project begins.

  1. Condition (Once): Runs once at project start
  2. 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.

  1. Condition (Compare): ZoneDetected = True, Option = Rising Edge
  2. Action (Synthesizer): Create synthesizer, Command = Note On, Note = C3-G3 (48-55)

💡 Tip: For fastest response, set execution interval to 1ms.

Logic - Instrument Selection

2025-12-17_13-27-18.png

Control 7: Instrument Selection

Change instruments when Bank or Preset value changes.

  1. Condition (On Change): Bank or Preset variable, Operator = OR
  2. Action (Synthesizer): Command = Set Instrument, assign Bank and Preset variables

Color Tracking Tips

For best tracking results:

  1. Use bright colors: Orange, green, or pink work best
  2. Avoid matching clothes: Don't wear the same color as your ball
  3. Consistent lighting: Avoid shadows and backlight
  4. 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

  1. Open Grablo app in your desktop or mobile browser
  2. Select your project
  3. Connect to your Raspberry Pi
  4. Hit RUN and enjoy!


Expected Results

When you run your project:

  1. Camera view appears with 5 zones at the bottom
  2. Move ball into Zone 1: Plays C3 note
  3. Move through zones: Each zone plays different notes
  4. Change Bank/Preset: Switches instruments
  5. Play music by moving the ball through zones!

Video Tutorial

Air Synthesizer - with Color Tracking

Watch the complete build process in action!

Expand Your Project

Add more functionality:

  1. Add more zones for a full octave
  2. Create duet mode with two different colored balls
  3. Add visual feedback when notes play


Troubleshooting

No sound:

  1. Check speaker connection
  2. Verify Bank and Preset values (try Bank = 0, Preset = 0)
  3. Check audio output settings on Raspberry Pi

Color not tracking:

  1. Adjust Start/End Color range in Color Picker
  2. Use HSV tab and fine-tune H value
  3. Improve lighting conditions
  4. Avoid wearing clothes matching ball color

Notes playing multiple times:

  1. Verify Rising Edge option is set in conditions
  2. Check that zones don't overlap
  3. Increase Min Area to ignore noise


Sound Font Resources

  1. Polyphone (Sound Font Editor): https://www.polyphone.io/
  2. Sound Font used in this project: https://musical-artifacts.com/artifacts/7293


Resources

  1. Website: https://grablo.co
  2. Download: https://grablo.co/download
  3. Web App: https://app.grablo.co
  4. Docs: https://doc.grablo.co
  5. Support: support@grablo.co