Ready-to-play laser harp instrument with automatic startup
A laser harp is an electronic musical instrument that uses laser beams as "strings." When you move your hand through a laser beam, it triggers a musical note. This creates a futuristic, touch-free playing experience similar to playing an invisible harp in the air.
This instrument is pre-configured and ready to use - simply power it on and start playing!
- Connect speakers/headphones to the Raspberry Pi audio output
- Power on the Raspberry Pi - the system will auto-start (takes 30-60 seconds)
- Wait for startup - you'll hear the system initialize
- Start playing - move your hands through the laser beams to create music!
- 13 laser beams create different musical notes
- Left side = higher pitched notes (E6)
- Right side = lower pitched notes (C4)
- Multiple beams can be triggered simultaneously for chords
- Smooth movements create better musical expression
The laser beams are arranged from left to right as follows:
E6 - D6 - C6 - A5 - G5 - E5 - D5 - C5 - A4 - G4 - E4 - D4 - C4
(High) (Low)
- Power On: Ensure both Pi and Pico are running
- Check Lasers: All laser beams should be visible and hitting their sensors
- Test: Move your hand through a laser beam - you should hear a note
- Play Music:
- Move hands through beams to trigger notes
- Multiple beams can be broken simultaneously for chords
- The leftmost laser (GP0) plays the highest note (E6)
- The rightmost laser (GP20) plays the lowest note (C4)
- Check FluidSynth is running:
ps aux | grep fluidsynth - Verify MIDI connections:
aconnect -l - Check audio output settings on Pi
- Adjust
DEBOUNCE_MSvalue infinal_code.py(try 10-50ms) - Check for ambient light interference
- Ensure sensors are properly aligned with lasers
- This was fixed in
final_code.py- make sure you're using the debounced version - Restart the Pico if issues persist
- Unplug and reconnect the Pico USB cable
- Check
aconnect -lfor new port numbers - Re-run the
aconnectcommand with correct ports
final_code.py- Main Pico program (recommended version)code(No debounce).py- Original version (may have stuck note issues)cmds_4_fluidsynth.txt- FluidSynth setup commands and system service info
Edit the notes array in final_code.py to use different musical notes:
NoteTrigger(board.GP0, "C5"), # Change "E6" to "C5"Modify the debounce time:
DEBOUNCE_MS = 30 # Increase for less sensitivity, decrease for more
## 🔧 Troubleshooting
**The instrument should work automatically after power-on. If you experience issues:**
### No Sound After Startup
1. **Check speakers/headphones** are connected and volume is up
2. **Wait longer** - full startup can take up to 2 minutes
3. **Check system status**:
```bash
# Open terminal and check if FluidSynth is running
ps aux | grep fluidsynth- Manual restart if needed:
sudo systemctl restart laser-harp-startup.service
- Check laser alignment - ensure beams hit sensors properly
- Test individual beams - wave hand through each beam slowly
- Check Pico connection - USB cable should be secure
- Restart if needed:
# Check MIDI connections aconnect -l # Should show both Pico and FLUID Synth
- Reduce ambient light - bright lights can interfere with sensors
- Check for vibrations - ensure setup is stable
- Clean sensor lenses - dust can cause false readings
- Check power supply - ensure Pi gets clean power
- Check auto-start service:
# Check service status sudo systemctl status laser-harp-startup.service # View startup logs sudo journalctl -u laser-harp-startup.service -e
- Manual startup as backup:
/home/pi/startup.sh
If nothing works:
# Kill all processes and restart
sudo pkill fluidsynth
sudo systemctl restart laser-harp-startup.service- Boot sequence: Pi powers on → waits 10 seconds → starts FluidSynth → waits for Pico → connects MIDI → ready to play
- Log location: Check
/home/pi/fluidsynth.logfor system messages - Service control: Use
sudo systemctl [start|stop|restart] laser-harp-startup.service
- Keep clean: Dust sensors and laser lenses regularly
- Stable power: Use quality power supplies for best performance
- Updates: System is self-contained - no regular updates needed
- Best lighting: Dimly lit room with minimal ambient light
- Smooth movements: Deliberate, flowing gestures work best
- Hand positioning: Perpendicular cuts through beams trigger cleanest notes
- Multiple notes: Break several beams simultaneously for chords
- Practice: Start with simple melodies, build up to complex pieces---
The instrument is ready to play - just power on and make music with light! 🎶✨
For technical details, see the other documentation files in this folder.