# MIDI Stomping Pads

## Overview

https://youtu.be/UCAvpVPfscM

![](https://cdn-learn.adafruit.com/assets/assets/000/107/308/medium800/leds_edited_P1310984.jpg?1639487994)

Sometimes you just need to let out your emotions in a healthy way with music. This project lets you build 3D printed stomping pads to send MIDI notes with a Circuit Playground Express running CircuitPython.

The two 3D printed squares have pieces of copper foil sheet on each side. Wires are soldered to the copper foil to create a digital input circuit with the Circuit Playground Express. One side is connected to **GND** and the other is connected to an input pin.

![leds_edited_P1310944.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/288/medium640/leds_edited_P1310944.jpg?1639412107)

The 3D printed squares connect to each other with springs with the help of some hot glue so that you can press down with purpose to send MIDI notes.

![leds_edited_P1310955.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/289/medium640/leds_edited_P1310955.jpg?1639412175)

The NeoPixels on the Circuit Playground Express change color depending on which input is pressed.

![leds_edited_P1310974.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/309/medium640/leds_edited_P1310974.jpg?1639488128)

This project was inspired by the&nbsp;[Garageband and Makey Makey Stomping Pads](https://makeymakey.com/blogs/how-to-instructions/garageband-and-makey-makey-stomping-pads) project by&nbsp;Frazer Merrick.

## Parts
### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
![A Black woman's manicured hand holds a round microcontroller with lit up LEDs.](https://cdn-shop.adafruit.com/640x480/3333-05.jpg)

### Copper Foil Sheet with Conductive Adhesive - 12" x12" Sheet

[Copper Foil Sheet with Conductive Adhesive - 12" x12" Sheet](https://www.adafruit.com/product/4607)
Copper sheet can be an interesting addition to your toolbox. The sheet itself is made of thin pure copper so its extremely flexible and can take on nearly any shape. You can easily solder to it, and the material itself can carry current just like a wire. On the back is an electrically...

In Stock
[Buy Now](https://www.adafruit.com/product/4607)
[Related Guides to the Product](https://learn.adafruit.com/products/4607/guides)
![Thin Copper Foil Sheet with Conductive Adhesive](https://cdn-shop.adafruit.com/640x480/4607-00.jpg)

### Fully Reversible Pink/Purple USB A to micro B Cable - 1m long

[Fully Reversible Pink/Purple USB A to micro B Cable - 1m long](https://www.adafruit.com/product/4111)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also fully reversible! That's right, you will save _seconds_ a day by not having to flip the cable around.

First let's talk about the cover and over-molding. We got these...

In Stock
[Buy Now](https://www.adafruit.com/product/4111)
[Related Guides to the Product](https://learn.adafruit.com/products/4111/guides)
![Fully Reversible Pink/Purple USB A to micro B Cable](https://cdn-shop.adafruit.com/640x480/4111-02.jpg)

### Silicone Cover Stranded-Core Wire - 30AWG in Various Colors

[Silicone Cover Stranded-Core Wire - 30AWG in Various Colors](https://www.adafruit.com/product/2051)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2051)
[Related Guides to the Product](https://learn.adafruit.com/products/2051/guides)
![Silicone Cover Stranded-Core Wire - 30AWG in Various Colors laid out beside each other. ](https://cdn-shop.adafruit.com/640x480/2051-01.jpg)

### Part: Compression springs
quantity: 1
Compression springs for the stomp pads
[Compression springs](https://www.amazon.com/dp/B0002KO1X0?)

# MIDI Stomping Pads

## Circuit Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/107/086/medium800/leds_cpx_midi_diagram.png?1638886953)

## Wiring Connections
Solder four copper pads to **GND** and four copper pads to input pins **A1** , **A2** , **A3** and **A4**.

- **Pad 1** to pin **A4**
- **Pad 2** to **GND**
- **Pad 3** to **GND**
- **Pad 4** to pin **A1**
- **Pad 5** to **GND**
- **Pad 6** to pin **A2**
- **Pad 7** to **GND**
- **Pad 8** to pin **A3**

# MIDI Stomping Pads

## 3D Printing

![](https://cdn-learn.adafruit.com/assets/assets/000/107/310/medium800/leds_edited_P1310971.jpg?1639488171)

The MIDI Stomping Pads are assembled with 3D printed squares. They print with no supports. Two squares will be needed to assemble each stomping pad.

The **cpxMidiStompingPad.stl** can be downloaded directly here or from Thingiverse.

[cpxMidiStompingPad.stl](https://cdn-learn.adafruit.com/assets/assets/000/107/313/original/cpxMidiStompingPad.stl?1639488850)
[Thingiverse download](https://www.thingiverse.com/thing:5164314)
The 3D printed square has a raised section in the middle to place the copper foil. There are also slots to place the springs in the corners and a slot to run the wire to the Circuit Playground Express.

![leds_edited_P1310949.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/287/medium640/leds_edited_P1310949.jpg?1639412038)

## Housing the Circuit Playground Express
![](https://cdn-learn.adafruit.com/assets/assets/000/107/286/medium800/leds_edited_P1310935.jpg?1639411988)

The Circuit Playground Express can be housed in this 3D printed case by the Ruiz Brothers, found in [this Learn Guide](https://learn.adafruit.com/case-for-circuit-playground/3d-printing).

Alternatively, you can use the [Adafruit Circuit Playground Enclosure](https://www.adafruit.com/product/3915) sold in the Adafruit store.

[Case for Circuit Playground Learn Guide](https://learn.adafruit.com/case-for-circuit-playground/3d-printing)
### Adafruit Circuit Playground Express or Bluefruit Enclosure

[Adafruit Circuit Playground Express or Bluefruit Enclosure](https://www.adafruit.com/product/3915)
We've got nice cases for many of our beloved boards, but the [Circuit Playground Express](https://www.adafruit.com/product/3333)&nbsp;and [Circuit Playground&nbsp;Bluefruit](https://www.adafruit.com/product/4333) has been left out of couture enclosure...

In Stock
[Buy Now](https://www.adafruit.com/product/3915)
[Related Guides to the Product](https://learn.adafruit.com/products/3915/guides)
![Top down view of a clear acrylic Adafruit Circuit Playground Express or Bluefruit Enclosure.](https://cdn-shop.adafruit.com/product-videos/640x480/3915-06.jpg)

# MIDI Stomping Pads

## CircuitPython

Danger: 

# Install or update CircuitPython!

Follow this quick step-by-step for super-fast Python power :)

[Download the latest version of CircuitPython for this board via CircuitPython.org](https://circuitpython.org/board/circuitplayground_express/)
 **Click the link above and download the latest UF2 file**

Download and save it to your Desktop (or wherever is handy)

![circuit_playground_uf2.png](https://cdn-learn.adafruit.com/assets/assets/000/047/217/medium640/circuit_playground_uf2.png?1507849069)

Plug your Circuit Playground Express into your computer using a known-good USB cable

**A lot of people end up using charge-only USB cables and it is very frustrating! So make sure you have a USB cable you know is good for data sync**

Double-click the small **Reset** button in the middle of the CPX, you will see all of the LEDs turn green. If they turn all red, check the USB cable, try another USB port, etc.

(If double-clicking doesn't do it, try a single-click!)

![circuit_playground_led_strips_3333_giffy1.gif](https://cdn-learn.adafruit.com/assets/assets/000/047/218/medium640thumb/circuit_playground_led_strips_3333_giffy1.jpg?1507849085)

![circuit_playground_greens.jpg](https://cdn-learn.adafruit.com/assets/assets/000/047/219/medium640/circuit_playground_greens.jpg?1507849107)

You will see a new disk drive appear called **CPLAYBOOT**  
  
Drag the **adafruit-circuitpython-etc...uf2** file onto it

![circuit_playground_cplayboot.gif](https://cdn-learn.adafruit.com/assets/assets/000/047/221/medium640/circuit_playground_cplayboot.gif?1507849132)

![circuit_playground_drag.png](https://cdn-learn.adafruit.com/assets/assets/000/047/222/medium640/circuit_playground_drag.png?1507849146)

The **CPLAYBOOT** drive will disappear and a new disk drive will appear called **CIRCUITPY**

That's it! You're done :)

![circuit_playground_circuipy.png](https://cdn-learn.adafruit.com/assets/assets/000/047/223/medium640/circuit_playground_circuipy.png?1507849179)

## Further Information
For more detailed info on installing CircuitPython, check out [Installing CircuitPython](../../../../welcome-to-circuitpython/installing-circuitpython).

# MIDI Stomping Pads

## Coding the MIDI Stomping Pads

Once you've finished setting up your Circuit Playground Express with CircuitPython, you can access the code and necessary libraries by downloading the Project Bundle.

To do this, click on the **&nbsp;Download Project Bundle** &nbsp;button in the window below. It will download as a zipped folder.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Circuit_Playground_Express_MIDI_Stomping_Pads/code.py

## Upload the Code and Libraries to the Circuit Playground Express
After downloading the Project Bundle, plug your Circuit Playground Express into the computer's USB port. You should see a new flash drive appear in the computer's File Explorer or Finder (depending on your operating system) called&nbsp; **CIRCUITPY**. Unzip the folder and copy the following items to the Circuit Playground Express's&nbsp; **CIRCUITPY** &nbsp;drive.&nbsp;

- **lib** &nbsp;folder
- **code.py**

Your Circuit Playground Express&nbsp; **CIRCUITPY&nbsp;** drive should look like this after copying the **lib** folder and the **code.py** file.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/127/medium800/leds_cpxMidiCpFiles.png?1638977458)

## How the CircuitPython Code Works
There are arrays of digital input pins, pin states, MIDI note numbers and NeoPixel colors setup in the code before the loop. Each of these arrays contain four indexes that correspond with each other. This will allow you to iterate through these arrays in the loop.

To customize your setup, you can change the defined NeoPixel colors in the `colors` array and the MIDI note numbers in the `midi_notes` array.

```auto
#  setup for digital inputs
inputs = []
cpx_pins = [board.A1, board.A2, board.A3, board.A4]

for pin in cpx_pins:
    cpx_pin = DigitalInOut(pin)
    cpx_pin.direction = Direction.INPUT
    cpx_pin.pull = Pull.UP
    inputs.append(cpx_pin)

#  NeoPixel colors
GREEN = (0, 255, 0)
CYAN = (0, 255, 255)
BLUE = (0, 0, 255)
PURPLE = (180, 0, 255)

#  debounce states for inputs
state_A1 = False
state_A2 = False
state_A3 = False
state_A4 = False

#  array of NeoPixel colors
colors = [GREEN, CYAN, BLUE, PURPLE]
#  array of MIDI notes
midi_notes = [60, 64, 67, 72]
#  array of input states
input_states = [state_A1, state_A2, state_A3, state_A4]
```

In the loop, `i` represents the selected index in each of the arrays. The `for` statement lets you setup the code so that you can check for the state of the different digital inputs. When a state change is detected, aka when a stomp pad is stomped, the NeoPixel color will change and a MIDI note message will be sent accordingly.

```python
#  iterate through colors, inputs and MIDI notes
    for i in range(4):
        #  reset the state of the input and send NoteOff msg
        #  after the input is released
        if inputs[i].value and input_states[i]:
            input_states[i] = False
            midi.send(NoteOff(midi_notes[i], 120))

        #  if an input is pressed...
        if not inputs[i].value and not input_states[i]:
            #  change thhe colors of the NeoPixels
            pixels.fill(colors[i])
            pixels.show()
            #  send the NoteOn msg
            midi.send(NoteOn(midi_notes[i], 120))
            #  update input state
            input_states[i] = True
```

# MIDI Stomping Pads

## Wiring

Cut two squares of the copper foil sheet that are each 5.5 cm wide by 5.5 cm long. You can use a pencil to mark your measurement on the back and then use scissors to cut them out.

![leds_edited_P1310866.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/160/medium640/leds_edited_P1310866.jpg?1639059989)

![leds_edited_P1310868.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/161/medium640/leds_edited_P1310868.jpg?1639060018)

Cut two lengths of wire that are at least 12 inches long each. Splice and tin both ends of the wires with solder.&nbsp;

![leds_edited_P1310889.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/271/medium640/leds_edited_P1310889.jpg?1639406499)

![leds_edited_P1310893.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/272/medium640/leds_edited_P1310893.jpg?1639406692)

Solder one wire to each of the copper foil squares.

![leds_edited_P1310918.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/274/medium640/leds_edited_P1310918.jpg?1639406799)

![leds_edited_P1310925.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/275/medium640/leds_edited_P1310925.jpg?1639406854)

Solder one wire to pin **A1** on the Circuit Playground Express. Solder the second wire to **GND** on the Circuit Playground Express.

![leds_edited_P1310908.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/276/medium640/leds_edited_P1310908.jpg?1639406925)

![leds_edited_P1310911.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/277/medium640/leds_edited_P1310911.jpg?1639407020)

Repeat this process for the remaining stomping pads, soldering three copper squares to **GND** and three copper squares to pins **A2** , **A3** and **A4**.

![](https://cdn-learn.adafruit.com/assets/assets/000/107/278/medium800/leds_edited_P1310927.jpg?1639407114)

Info: 

# MIDI Stomping Pads

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/107/311/medium800/leds_edited_P1310976.jpg?1639488287)

Remove the protective backing from the copper foil squares and place them on the 3D printed square pads. The 3D printed squares have slots for the wires to sit in.

![leds_edited_P1310937.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/279/medium640/leds_edited_P1310937.jpg?1639407770)

![leds_edited_P1310940.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/280/medium640/leds_edited_P1310940.jpg?1639407304)

![leds_edited_P1310944.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/281/medium640/leds_edited_P1310944.jpg?1639407784)

Dab hot glue onto the top of a spring and attach it to the indented corner of the 3D printed square. Repeat this for the three other springs.

![leds_edited_P1310947.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/282/medium640/leds_edited_P1310947.jpg?1639408033)

![leds_edited_P1310949.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/283/medium640/leds_edited_P1310949.jpg?1639408043)

Dab hot glue onto the tops of the secured springs. Place the springs into the corners of the second 3D printed square.&nbsp;

Repeat this process for the remaining stomping pads.

![leds_edited_P1310963.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/284/medium640/leds_edited_P1310963.jpg?1639408080)

![leds_edited_P1310955.jpg](https://cdn-learn.adafruit.com/assets/assets/000/107/285/medium640/leds_edited_P1310955.jpg?1639408059)

# MIDI Stomping Pads

## Stomp!

![](https://cdn-learn.adafruit.com/assets/assets/000/107/315/medium800/leds_edited_P1310967.jpg?1639490982)

Attach your Circuit Playground Express via USB to your preferred MIDI instrument. You can use a digital audio workstation (DAW) on your computer or use a USB MIDI passthrough to connect to a hardware instrument (like a [robot xylophone](https://learn.adafruit.com/wireless-ble-midi-robot-xylophone)).

![](https://cdn-learn.adafruit.com/assets/assets/000/107/312/medium800/leds_edited_P1310981.jpg?1639488317)

Stomp, slap, bang or pound on the stomping pads to send beautiful music out into the world. You can customize the code with your preferred MIDI notes. Think about experimenting with different instruments too, such as drums or weird sound effects.

## Additional Uses
The stomping pad mechanism can also be used with your feet, really opening up the musical possibilities. Since this project is setup as a series of digital inputs, you could also adjust the code to be an HID device or any other project that utilizes inputs. There's also potential for accessibility uses with the stomping pads.&nbsp;


## Featured Products

### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
### Adafruit Circuit Playground Express or Bluefruit Enclosure

[Adafruit Circuit Playground Express or Bluefruit Enclosure](https://www.adafruit.com/product/3915)
We've got nice cases for many of our beloved boards, but the [Circuit Playground Express](https://www.adafruit.com/product/3333)&nbsp;and [Circuit Playground&nbsp;Bluefruit](https://www.adafruit.com/product/4333) has been left out of couture enclosure...

In Stock
[Buy Now](https://www.adafruit.com/product/3915)
[Related Guides to the Product](https://learn.adafruit.com/products/3915/guides)
### Fully Reversible Pink/Purple USB A to micro B Cable - 1m long

[Fully Reversible Pink/Purple USB A to micro B Cable - 1m long](https://www.adafruit.com/product/4111)
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also fully reversible! That's right, you will save _seconds_ a day by not having to flip the cable around.

First let's talk about the cover and over-molding. We got these...

In Stock
[Buy Now](https://www.adafruit.com/product/4111)
[Related Guides to the Product](https://learn.adafruit.com/products/4111/guides)
### Copper Foil Sheet with Conductive Adhesive - 12" x12" Sheet

[Copper Foil Sheet with Conductive Adhesive - 12" x12" Sheet](https://www.adafruit.com/product/4607)
Copper sheet can be an interesting addition to your toolbox. The sheet itself is made of thin pure copper so its extremely flexible and can take on nearly any shape. You can easily solder to it, and the material itself can carry current just like a wire. On the back is an electrically...

In Stock
[Buy Now](https://www.adafruit.com/product/4607)
[Related Guides to the Product](https://learn.adafruit.com/products/4607/guides)
### Silicone Cover Stranded-Core Wire - 30AWG in Various Colors

[Silicone Cover Stranded-Core Wire - 30AWG in Various Colors](https://www.adafruit.com/product/2051)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2051)
[Related Guides to the Product](https://learn.adafruit.com/products/2051/guides)
### Small Alligator Clip to Male Jumper Wire Bundle - 12 Pieces

[Small Alligator Clip to Male Jumper Wire Bundle - 12 Pieces](https://www.adafruit.com/product/3255)
For bread-boarding with unusual non-header-friendly surfaces, these cables will be your best friends! No longer will you have long strands of alligator clips that are grabbing little wires. These compact jumper cables have a premium male header on one end, and a grippy mini alligator clip on...

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

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Make It a Mouse](https://learn.adafruit.com/make-it-a-mouse.md)
- [Circuit Playground Express TV Zapper](https://learn.adafruit.com/circuitpython-tv-zapper-with-circuit-playground-express.md)
- [Making oscilloscope images with DACs](https://learn.adafruit.com/dac-oscilloscope-images.md)
- [Makecode para la Circuit Playground Express](https://learn.adafruit.com/makecode-es.md)
- [FruitBox Sequencer: Musically Delicious Step Pattern Generator ](https://learn.adafruit.com/circuitpython-fruitbox-sequencer-musically-delicious-step-pattern-generator.md)
- [Using WebUSB with Arduino and TinyUSB](https://learn.adafruit.com/using-webusb-with-arduino-and-tinyusb.md)
- [Motorized Marble Machine](https://learn.adafruit.com/marble-run.md)
- [How to Program SAMD Bootloaders](https://learn.adafruit.com/how-to-program-samd-bootloaders.md)
- [Circuit Playground Simple Simon](https://learn.adafruit.com/circuit-playground-simple-simon.md)
- [Case for Circuit Playground](https://learn.adafruit.com/case-for-circuit-playground.md)
- [TFT Gizmo Animated Eye](https://learn.adafruit.com/tft-gizmo-animated-eye.md)
- [Circuit Playground Express Spooky Laughing Box](https://learn.adafruit.com/spooky-circuit-playground-express-mystery-box.md)
- [CPX Glowing Disembodied Hand](https://learn.adafruit.com/cpx-glowing-disembodied-hand.md)
- [Professor Bubbleton’s Breathing Head in a Jar](https://learn.adafruit.com/professor-bubbleton-s-breathing-head-in-a-jar.md)
- [Obsidian Sword – Steven Universe](https://learn.adafruit.com/obsidian-sword-steven-universe.md)
