# MIDI Laser Harp with Time of Flight Distance Sensors

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/111/369/medium800/proximity_edited_IMG_5033.png?1652105821)

https://www.youtube.com/watch?v=pWvFaknKUz4

https://youtu.be/f8-xf_2Xakw

A [laser harp](https://en.wikipedia.org/wiki/Laser_harp) is an electronic instrument that lets you "pluck" laser beams like a harp to play notes. In this guide, you'll learn how to build your own version of a laser harp using a Feather M4 Express or Feather RP2040, a Music Maker FeatherWing and code written in CircuitPython. VL53L4CD time of flight sensors are used to detect when you're playing a note instead of simply detecting the break-beam. This means we can do cool stuff like use the distance data from the time of flight sensors to convert into different MIDI values such as modulation, sustain and velocity.

We use a Music Maker wing which has audio output from MIDI input and a [wide variety of musical instruments it can generate sound effects for, see page 32 of the VS1053 datasheet for a full list!](https://cdn-shop.adafruit.com/datasheets/vs1053.pdf) Of course you can also generate MIDI-over-USB signals that can be used to control your favorite software synth.

It's hard to mount sensors on the other side of the lasers so we 'cheat' and use high quality ToF distance sensors with precise distance measurements and narrow detection paths. The lasers are _only there help you to visualize the detection path of the time of flight sensors_ so feel free to change the laser colors or positions as you please. The sensors and lasers are mounted so that they are sitting at the same angle.

![proximity_laser_gif_0.gif](https://cdn-learn.adafruit.com/assets/assets/000/111/468/medium640thumb/proximity_laser_gif_0.jpg?1652211395)

The Music Maker FeatherWing is used as a MIDI synth. You can change the instrument sound in the CircuitPython code.

![proximity_edited_P1330582.png](https://cdn-learn.adafruit.com/assets/assets/000/111/465/medium640/proximity_edited_P1330582.png?1652206692)

The TCA9548A I2C multiplexer allows you to use eight of the VL53L4CD time of flight sensors at the same time even though they all have the same I2C address.

![proximity_edited_P1330407.png](https://cdn-learn.adafruit.com/assets/assets/000/111/382/medium640/proximity_edited_P1330407.png?1652108220)

## Prerequisite Guides
Please look over the following Adafruit Learning System guides for information on the components used.

[Adafruit Music Maker FeatherWing](https://learn.adafruit.com/adafruit-music-maker-featherwing)
[Adafruit VL53L4CD Time of Flight Distance Sensor](https://learn.adafruit.com/adafruit-vl53l4cd-time-of-flight-distance-sensor)
[Working with Multiple Same Address I2C Devices](https://learn.adafruit.com/working-with-multiple-i2c-devices)
[Adafruit TCA9548A 1-to-8 I2C Multiplexer Breakout](https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout)
Info: 

## Parts
### Adafruit Feather RP2040

[Adafruit Feather RP2040](https://www.adafruit.com/product/4884)
A new chip means a new Feather, and the Raspberry Pi RP2040 is no exception. When we saw this chip we thought "this chip is going to be awesome when we give it the Feather Treatment" and so we did! This Feather features the&nbsp; **RP2040** , and all niceties you know and...

In Stock
[Buy Now](https://www.adafruit.com/product/4884)
[Related Guides to the Product](https://learn.adafruit.com/products/4884/guides)
![Angled shot of black rectangular microcontroller "Feather RP2040"](https://cdn-shop.adafruit.com/640x480/4884-04.jpg)

## OR
### Adafruit Feather M4 Express - Featuring ATSAMD51

[Adafruit Feather M4 Express - Featuring ATSAMD51](https://www.adafruit.com/product/3857)
It's what you've been waiting for, the Feather M4 Express featuring ATSAMD51. This Feather is fast like a swift, smart like an owl, strong like a ox-bird (it's half ox, half bird, OK?) This feather is powered by our new favorite chip, the **ATSAMD51J19** -&nbsp; with...

In Stock
[Buy Now](https://www.adafruit.com/product/3857)
[Related Guides to the Product](https://learn.adafruit.com/products/3857/guides)
![Angled shot of a Adafruit Feather M4 Express. ](https://cdn-shop.adafruit.com/640x480/3857-10.jpg)

### Adafruit Music Maker FeatherWing - MP3 OGG WAV MIDI Synth Player

[Adafruit Music Maker FeatherWing - MP3 OGG WAV MIDI Synth Player](https://www.adafruit.com/product/3357)
Bend all audio files to your will with the **Adafruit Music Maker FeatherWing**! It's a fun-size version of our [Music Maker&nbsp;shield for Arduino](https://www.adafruit.com/product/1790)!&nbsp;This powerful wing features the VS1053, an encoding/decoding (codec)...

In Stock
[Buy Now](https://www.adafruit.com/product/3357)
[Related Guides to the Product](https://learn.adafruit.com/products/3357/guides)
![Adafruit Music Maker FeatherWing - MP3 OGG WAV MIDI Synth Player connected to a half sized breadboard and a set of headphones. ](https://cdn-shop.adafruit.com/640x480/3357-01.jpg)

### TCA9548A I2C Multiplexer

[TCA9548A I2C Multiplexer](https://www.adafruit.com/product/2717)
You just found the perfect I2C sensor, and you want to wire up two or three or more of them to your Arduino when you realize "Uh oh, this chip has a fixed I2C address, and from what I know about I2C, you cannot have two devices with the same address on the same SDA/SCL pins!" Are you...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2717)
[Related Guides to the Product](https://learn.adafruit.com/products/2717/guides)
![Angled Shot of the TCA9548A I2C Multiplexer.](https://cdn-shop.adafruit.com/640x480/2717-05.jpg)

### Adafruit VL53L4CD Time of Flight Distance Sensor - ~1 to 1300mm

[Adafruit VL53L4CD Time of Flight Distance Sensor - ~1 to 1300mm](https://www.adafruit.com/product/5396)
The **Adafruit VL53L4CD Time of Flight Sensor** is another great _Time of Flight_&nbsp;distance sensor from ST in the VL5 series of chips, this one is great for shorter distances. The sensor contains a very tiny invisible laser source&nbsp;and a matching sensor. The...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5396)
[Related Guides to the Product](https://learn.adafruit.com/products/5396/guides)
![Video of a hand hovering over a Adafruit VL53L4CD Time of Flight Distance Sensor thats connected to a white breadboard reading the range of motion of the hand. ](https://cdn-shop.adafruit.com/product-videos/640x480/5396-05.jpg)

### Laser Diode - 5mW 650nm Red

[Laser Diode - 5mW 650nm Red](https://www.adafruit.com/product/1054)
You have some frickin' sharks at your lair, and you're thinking "it would be really great if I could attach some lasers to them" and then you see these little laser diode modules: what great timing! These encapsulated laser diodes are Class IIIa 5mW, with a 650nm red...

In Stock
[Buy Now](https://www.adafruit.com/product/1054)
[Related Guides to the Product](https://learn.adafruit.com/products/1054/guides)
![Angled shot of laser diode module with black and red wires.](https://cdn-shop.adafruit.com/640x480/1054-04.jpg)

### Part: FeatherWing Doubler
quantity: 1
FeatherWing Doubler - Prototyping Add-on For All Feather Boards
[FeatherWing Doubler](https://www.adafruit.com/product/2890)

### Part: Fixed Laser Mounting Stand
quantity: 8
Fixed Laser Mounting Stand
[Fixed Laser Mounting Stand](https://www.adafruit.com/product/1094)

### Part: Mini Panel Mount SPDT Toggle Switch
quantity: 1
Toggle switch
[Mini Panel Mount SPDT Toggle Switch](https://www.adafruit.com/product/3221)

### Part: STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long
quantity: 8
STEMMA QT cable
[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)

### Part: Black Nylon Machine Screw and Stand-off Set – M2.5 Thread
quantity: 1
M2.5 screws
[Black Nylon Machine Screw and Stand-off Set – M2.5 Thread](https://www.adafruit.com/product/3299)

### Part: Silicone Cover Stranded-Core Wire - 50ft 30AWG Black
quantity: 1
Black wire
[Silicone Cover Stranded-Core Wire - 50ft 30AWG Black](https://www.adafruit.com/product/3164)

### Part: Silicone Cover Stranded-Core Wire - 50ft 30AWG Red
quantity: 1
Red wire
[Silicone Cover Stranded-Core Wire - 50ft 30AWG Red](https://www.adafruit.com/product/3165)

### Part: Silicone Cover Stranded-Core Wire - 50ft 30AWG Yellow
quantity: 1
Yellow wire
[Silicone Cover Stranded-Core Wire - 50ft 30AWG Yellow](https://www.adafruit.com/product/3167)

### Part: Silicone Cover Stranded-Core Wire - 50ft 30AWG Blue
quantity: 1
Blue wire
[Silicone Cover Stranded-Core Wire - 50ft 30AWG Blue](https://www.adafruit.com/product/3166)

### Part: Multi-Colored Heat Shrink Pack - 3/32" + 1/8" + 3/16" Diameters
quantity: 1
Heat shrink
[Multi-Colored Heat Shrink Pack - 3/32" + 1/8" + 3/16" Diameters](https://www.adafruit.com/product/1649)

### Part: Acrylic sheet
quantity: 1
18" x 24" sheet of 1/8" thick acrylic
[Acrylic sheet](https://www.inventables.com/technologies/transparent-yellow-acrylic-sheet)

- [Next Page](https://learn.adafruit.com/midi-laser-harp-time-of-flight-sensors/circuit-diagram.md)

## Featured Products

### Adafruit Feather RP2040

[Adafruit Feather RP2040](https://www.adafruit.com/product/4884)
A new chip means a new Feather, and the Raspberry Pi RP2040 is no exception. When we saw this chip we thought "this chip is going to be awesome when we give it the Feather Treatment" and so we did! This Feather features the&nbsp; **RP2040** , and all niceties you know and...

In Stock
[Buy Now](https://www.adafruit.com/product/4884)
[Related Guides to the Product](https://learn.adafruit.com/products/4884/guides)
### Adafruit Feather M4 Express - Featuring ATSAMD51

[Adafruit Feather M4 Express - Featuring ATSAMD51](https://www.adafruit.com/product/3857)
It's what you've been waiting for, the Feather M4 Express featuring ATSAMD51. This Feather is fast like a swift, smart like an owl, strong like a ox-bird (it's half ox, half bird, OK?) This feather is powered by our new favorite chip, the **ATSAMD51J19** -&nbsp; with...

In Stock
[Buy Now](https://www.adafruit.com/product/3857)
[Related Guides to the Product](https://learn.adafruit.com/products/3857/guides)
### Adafruit Music Maker FeatherWing - MP3 OGG WAV MIDI Synth Player

[Adafruit Music Maker FeatherWing - MP3 OGG WAV MIDI Synth Player](https://www.adafruit.com/product/3357)
Bend all audio files to your will with the **Adafruit Music Maker FeatherWing**! It's a fun-size version of our [Music Maker&nbsp;shield for Arduino](https://www.adafruit.com/product/1790)!&nbsp;This powerful wing features the VS1053, an encoding/decoding (codec)...

In Stock
[Buy Now](https://www.adafruit.com/product/3357)
[Related Guides to the Product](https://learn.adafruit.com/products/3357/guides)
### TCA9548A I2C Multiplexer

[TCA9548A I2C Multiplexer](https://www.adafruit.com/product/2717)
You just found the perfect I2C sensor, and you want to wire up two or three or more of them to your Arduino when you realize "Uh oh, this chip has a fixed I2C address, and from what I know about I2C, you cannot have two devices with the same address on the same SDA/SCL pins!" Are you...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2717)
[Related Guides to the Product](https://learn.adafruit.com/products/2717/guides)
### Adafruit VL53L4CD Time of Flight Distance Sensor - ~1 to 1300mm

[Adafruit VL53L4CD Time of Flight Distance Sensor - ~1 to 1300mm](https://www.adafruit.com/product/5396)
The **Adafruit VL53L4CD Time of Flight Sensor** is another great _Time of Flight_&nbsp;distance sensor from ST in the VL5 series of chips, this one is great for shorter distances. The sensor contains a very tiny invisible laser source&nbsp;and a matching sensor. The...

Out of Stock
[Buy Now](https://www.adafruit.com/product/5396)
[Related Guides to the Product](https://learn.adafruit.com/products/5396/guides)
### Laser Diode - 5mW 650nm Red

[Laser Diode - 5mW 650nm Red](https://www.adafruit.com/product/1054)
You have some frickin' sharks at your lair, and you're thinking "it would be really great if I could attach some lasers to them" and then you see these little laser diode modules: what great timing! These encapsulated laser diodes are Class IIIa 5mW, with a 650nm red...

In Stock
[Buy Now](https://www.adafruit.com/product/1054)
[Related Guides to the Product](https://learn.adafruit.com/products/1054/guides)
### Fixed Laser Mounting Stand

[Fixed Laser Mounting Stand](https://www.adafruit.com/product/1094)
Use this nice fixed laser mount to attach any of our laser diode modules to your desk, robot, shark, etc. A set-screw holds the laser in place. Has a flat mounting plate with four holes for easy attachment and adjustment. Fits all of our modules.  
  
**Laser not included**

In Stock
[Buy Now](https://www.adafruit.com/product/1094)
[Related Guides to the Product](https://learn.adafruit.com/products/1094/guides)
### FeatherWing Doubler - Prototyping Add-on For All Feather Boards

[FeatherWing Doubler - Prototyping Add-on For All Feather Boards](https://www.adafruit.com/product/2890)
This is the **FeatherWing Doubler** - a prototyping add-on and more for all Feather boards. This is similar to our [FeatherWing Proto](https://www.adafruit.com/products/2884) except there are two! The magic of the Doubler comes when stacking a Feather and another...

In Stock
[Buy Now](https://www.adafruit.com/product/2890)
[Related Guides to the Product](https://learn.adafruit.com/products/2890/guides)

## Related Guides

- [Adafruit Feather M4 Express](https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51.md)
- [Introducing Adafruit Feather RP2040](https://learn.adafruit.com/adafruit-feather-rp2040-pico.md)
- [Adafruit VL53L4CD Time of Flight Distance Sensor](https://learn.adafruit.com/adafruit-vl53l4cd-time-of-flight-distance-sensor.md)
- [CircuitPython Trombone Champ Controller](https://learn.adafruit.com/circuitpython-trombone-champ-controller.md)
- [Spinning Disc Step Sequencer](https://learn.adafruit.com/spinning-disc-step-sequencer.md)
- [Animatronic Cosplay Wings](https://learn.adafruit.com/animatronic-cosplay-wings.md)
- [Stepper Motor Turntable](https://learn.adafruit.com/stepper-motor-turntable.md)
- [LED Snowboard with Motion-Reactive Animation](https://learn.adafruit.com/led-snowboard-with-motion-reactive-animation.md)
- [Customizing USB Devices in CircuitPython](https://learn.adafruit.com/customizing-usb-devices-in-circuitpython.md)
- [Working with I2C Devices](https://learn.adafruit.com/working-with-i2c-devices.md)
- [Edit CircuitPython Code on iOS with Runestone](https://learn.adafruit.com/editing-circuitpython-on-ios-with-runestone.md)
- [Magic Band Reader](https://learn.adafruit.com/magic-band-reader.md)
- [Light Up Prop with Prop-Maker](https://learn.adafruit.com/prop-maker-light-wand.md)
- [LED Emerald with Circuit Playground Bluefruit](https://learn.adafruit.com/led-emerald-with-circuit-playground.md)
- [Sketch Drawing Toy with CircuitPython](https://learn.adafruit.com/sketch-drawing-toy.md)
- [Adafruit DS3502 I2C Digital Potentiometer](https://learn.adafruit.com/ds3502-i2c-potentiometer.md)
- [CircuitPython Elgato WiFi Light Controller](https://learn.adafruit.com/circuitpython-elgato-wifi-light-controller.md)
- [Adafruit 1.14" 240x135 Color TFT Breakout LCD Display](https://learn.adafruit.com/adafruit-1-14-240x135-color-tft-breakout.md)
