Skip to content

Benjination/Laser-Harp

Repository files navigation

Laser Harp Musical Instrument

Ready-to-play laser harp instrument with automatic startup

🎵 What is a Laser Harp?

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!

⚡ Quick Start (Normal Operation)

Power On & Play

  1. Connect speakers/headphones to the Raspberry Pi audio output
  2. Power on the Raspberry Pi - the system will auto-start (takes 30-60 seconds)
  3. Wait for startup - you'll hear the system initialize
  4. Start playing - move your hands through the laser beams to create music!

Playing the Instrument

  • 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

🎹 Note Layout

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)

🎮 How to Play

  1. Power On: Ensure both Pi and Pico are running
  2. Check Lasers: All laser beams should be visible and hitting their sensors
  3. Test: Move your hand through a laser beam - you should hear a note
  4. 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)

🔧 Troubleshooting

No Sound

  • Check FluidSynth is running: ps aux | grep fluidsynth
  • Verify MIDI connections: aconnect -l
  • Check audio output settings on Pi

False Triggers

  • Adjust DEBOUNCE_MS value in final_code.py (try 10-50ms)
  • Check for ambient light interference
  • Ensure sensors are properly aligned with lasers

Notes Stuck On

  • This was fixed in final_code.py - make sure you're using the debounced version
  • Restart the Pico if issues persist

MIDI Connection Issues

  • Unplug and reconnect the Pico USB cable
  • Check aconnect -l for new port numbers
  • Re-run the aconnect command with correct ports

📁 File Overview

  • 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

⚙️ Customization

Change Notes

Edit the notes array in final_code.py to use different musical notes:

NoteTrigger(board.GP0, "C5"),  # Change "E6" to "C5"

Adjust Sensitivity

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
  1. Manual restart if needed:
    sudo systemctl restart laser-harp-startup.service

Lasers Not Triggering Notes

  1. Check laser alignment - ensure beams hit sensors properly
  2. Test individual beams - wave hand through each beam slowly
  3. Check Pico connection - USB cable should be secure
  4. Restart if needed:
    # Check MIDI connections
    aconnect -l
    # Should show both Pico and FLUID Synth

False Triggers (Notes playing randomly)

  • Reduce ambient light - bright lights can interfere with sensors
  • Check for vibrations - ensure setup is stable
  • Clean sensor lenses - dust can cause false readings

System Won't Start Automatically

  1. Check power supply - ensure Pi gets clean power
  2. 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
  3. Manual startup as backup:
    /home/pi/startup.sh

Emergency Reset

If nothing works:

# Kill all processes and restart
sudo pkill fluidsynth
sudo systemctl restart laser-harp-startup.service

🔄 System Information

How the Auto-Start Works

  • Boot sequence: Pi powers on → waits 10 seconds → starts FluidSynth → waits for Pico → connects MIDI → ready to play
  • Log location: Check /home/pi/fluidsynth.log for system messages
  • Service control: Use sudo systemctl [start|stop|restart] laser-harp-startup.service

Maintenance

  • 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

🎯 Performance Tips

  • 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.

About

I'm not taking credit for this project. A senior design group built it at UTA, and I was asked to create the README file and the auto-start shell script.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors