# MX MIDI Guitar

## Overview

https://youtu.be/BDwOBYsL71Q

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

![](https://cdn-learn.adafruit.com/assets/assets/000/089/544/medium800/3d_printing_hero-controllers.jpg?1584538832)

Inspired by the infamous [Guitar Hero controller](https://en.wikipedia.org/wiki/Guitar_Hero), this project shapes a MIDI controller into a 3D printed guitar. Featuring 12x [Cherry MX switches](https://en.wikipedia.org/wiki/Cherry_(keyboards)) in the neck, this gives you a tactile "hands-on" feeling that is satisfying. The whammy bar lets you pitch bend, making it feel like an electric guitar. It also features a strumming mode so you can power through chords and notes, giving you a playing style unlike typical MIDI controllers. Using an accelerometer, you can move the guitar to adjust modulation giving you an expressive playing style.

This project is coded in CircuitPython and uses the USB MIDI library. It features velocity, modulation, pitch bending and notes on/off. It features 8 different sets of notes for playing different octaves or sets of notes to craft your own chords. Two switches allow you to enable different features such the strum mode, trigger mode and accelerometer mode. Two potentiometers lets you adjust velocity and modulation.

![3d_printing_hero-full-down.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/536/medium640/3d_printing_hero-full-down.jpg?1584479149)

The parts are 3D printed without any support material. The top and bottom half of the guitar body snap fit together allowing you easy access to open and close. Parts are designed to print on most 3D printers with a build volume of 250x210x200mm. The parts and components are secured together with M3 hardware. The design files are open source, freely available to download. The CAD files feature a parametric assembly to easily add/mod to create custom controller.

![3d_printing_hero-wmy-knobs.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/537/medium640/3d_printing_hero-wmy-knobs.jpg?1584479190)

MX switches are available in different types and styles. The color of the key stem is used to classify its characteristics. We choose to use speed silvers for their quiet presses and low actuation point.&nbsp; &nbsp;

The head houses a strip of NeoPixels to diffuse a piece of black LED acrylic. The LEDs illuminate the panel making a neat lighting effect.

![3d_printing_hero-head-keys.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/538/medium640/3d_printing_hero-head-keys.jpg?1584479247)

## Parts
### Adafruit Grand Central M4 Express featuring SAMD51

[Adafruit Grand Central M4 Express featuring SAMD51](https://www.adafruit.com/product/4084)
Are you ready? Really ready? Cause here comes the **Adafruit Grand Central** featuring the **Microchip ATSAMD51**. This dev board is so big, it's not named after a Metro train, it's a whole freakin' _station_!

This board is like a freight...

In Stock
[Buy Now](https://www.adafruit.com/product/4084)
[Related Guides to the Product](https://learn.adafruit.com/products/4084/guides)
![Overhead shot of long, purple, rectangular development board.](https://cdn-shop.adafruit.com/640x480/4084-09.jpg)

### Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)

[Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)](https://www.adafruit.com/product/2809)
The **LIS3DH** &nbsp;is a very popular low power **triple-axis accelerometer**. It's low-cost, but has just about every 'extra' you'd want in an accelerometer:

- Three axis sensing, 10-bit...

In Stock
[Buy Now](https://www.adafruit.com/product/2809)
[Related Guides to the Product](https://learn.adafruit.com/products/2809/guides)
![Top down view of a Adafruit LIS3DH Triple-Axis Accelerometer.](https://cdn-shop.adafruit.com/640x480/2809-08.jpg)

### Mini 8-Way Rotary Selector Switch - SP8T

[Mini 8-Way Rotary Selector Switch - SP8T](https://www.adafruit.com/product/2925)
When you need _a lot_ of options, you need a **Mini 8-Way Rotary Selector Switch**. This is basically a single-pole to 8-throw switch. As you rotate the knob around, the middle pin will make contact with each of the outer pins. Rotary switches are very simple to use and are...

In Stock
[Buy Now](https://www.adafruit.com/product/2925)
[Related Guides to the Product](https://learn.adafruit.com/products/2925/guides)
![Eight-Way Rotary Selector Switch without knob](https://cdn-shop.adafruit.com/640x480/2925-00.jpg)

### Potentiometer with Built In Knob - 10K ohm

[Potentiometer with Built In Knob - 10K ohm](https://www.adafruit.com/product/4133)
_Oh say can you see_  
_By the knob's early light..._

Sorry - we thought that was clever. &nbsp;And while it wasn't really, this potentiometer definitely is! We've seen these in miniature synthesizers. They're bigger than a trim-pot but smaller than a...

In Stock
[Buy Now](https://www.adafruit.com/product/4133)
[Related Guides to the Product](https://learn.adafruit.com/products/4133/guides)
![Potentiometer with Built In Knob](https://cdn-shop.adafruit.com/640x480/4133-03.jpg)

### Panel Mount 10K potentiometer (Breadboard Friendly)

[Panel Mount 10K potentiometer (Breadboard Friendly)](https://www.adafruit.com/product/562)
This potentiometer is a two-in-one, good in a breadboard or with a panel. It's a fairly standard linear taper 10K ohm potentiometer, with a grippy shaft. It's smooth and easy to turn, but not so loose that it will shift on its own. We like this one because the legs are 0.2" apart...

In Stock
[Buy Now](https://www.adafruit.com/product/562)
[Related Guides to the Product](https://learn.adafruit.com/products/562/guides)
![Breadboard Friendly Panel Mount 10K potentiometer linear.](https://cdn-shop.adafruit.com/640x480/562-00.jpg)

### Micro Switch w/Lever - 2 Terminal

[Micro Switch w/Lever - 2 Terminal](https://www.adafruit.com/product/818)
Micro-switches are often found in arcade buttons and joysticks but they're also really handy in any kind of mechatronics project or when you need a basic sensor. They are always 'tactile' (clicky feeling), and 'momentary' (the switch closes when pressed, then snaps open...

In Stock
[Buy Now](https://www.adafruit.com/product/818)
[Related Guides to the Product](https://learn.adafruit.com/products/818/guides)
![2-Terminal Micro Switch with lever](https://cdn-shop.adafruit.com/640x480/818-06.jpg)

### Adafruit Perma-Proto Quarter-sized Breadboard PCB - Single

[Adafruit Perma-Proto Quarter-sized Breadboard PCB - Single](https://www.adafruit.com/product/1608)
Customers have asked us to carry basic perf-board, but we never liked the look of most basic perf: it's always crummy quality, with pads that flake off and no labeling. Then we thought about how people **actually** prototype - usually starting with a solderless breadboard and...

In Stock
[Buy Now](https://www.adafruit.com/product/1608)
[Related Guides to the Product](https://learn.adafruit.com/products/1608/guides)
![Angled Shot of the Adafruit Perma-Proto Quarter-sized Breadboard PCB - Single.](https://cdn-shop.adafruit.com/640x480/1608-03.jpg)

### Panel Mount Extension USB Cable - Micro B Male to Micro B Female

[Panel Mount Extension USB Cable - Micro B Male to Micro B Female](https://www.adafruit.com/product/3258)
Check out this handy MicroUSB extension cable, which will make it easy for you to enclose a device that has a B&nbsp;type (micro USB host) port. Great if you need to extend the USB port for your Raspberry Pi, Arduino, Feather or really anything development board.  
  
This Micro-B...

In Stock
[Buy Now](https://www.adafruit.com/product/3258)
[Related Guides to the Product](https://learn.adafruit.com/products/3258/guides)
![12 inch long black, panel mount extension USB Cable - Micro B plug to Micro B socket](https://cdn-shop.adafruit.com/640x480/3258-02.jpg)

### Mini Panel Mount SPDT Toggle Switch

[Mini Panel Mount SPDT Toggle Switch](https://www.adafruit.com/product/3221)
This or that, one or the other, perhaps or perhaps not! So hard to make decisions these days without feeling like you're just going back and forth constantly. Deciding whether or not to use this mini toggle switch? That's the easiest decision you'll make all day!

This...

In Stock
[Buy Now](https://www.adafruit.com/product/3221)
[Related Guides to the Product](https://learn.adafruit.com/products/3221/guides)
![Angled shot of blue, mini, SPDT toggle switch.](https://cdn-shop.adafruit.com/640x480/3221-01.jpg)

### Parts Galore!&nbsp;

There's a hand full of parts used in this project! If you have parts on-hand, be sure to scroll through the guide and look for anything that you may have on hand. Most of the panel mounted components feature standardized diameters. The mounting holes on the Grand Central M4 board are similar to the Arduino Mega.

## Parts from Adafruit

- 1x [Grand Central M4](https://www.adafruit.com/product/4084)
- 1x [LIS3DH Accelerometer breakout](https://www.adafruit.com/product/2809)
- 2x [10k Potentiometer](https://www.adafruit.com/product/562)
- 2x [Micro Switch with Lever](https://www.adafruit.com/product/818)
- 1x [Mini potentiometer](https://www.adafruit.com/product/4133)
- 1x [8-way rotary selector switch](https://www.adafruit.com/product/2925)
- 1x [Panel Mount USB micro cable](https://www.adafruit.com/product/3258)
- 2x [Mini panel mount switch](https://www.adafruit.com/product/3221)
- 1x [2m USB micro cable](https://www.adafruit.com/product/4148)
- 1x [Quarter-Size Perma-Proto](https://www.adafruit.com/product/1608)

![3d_printing_parts-v2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/245/medium640/3d_printing_parts-v2.jpg?1584116613)

## Wires & Connections

Because of the amount of components, several dozens of connections will need to be made. By using pre-crimped wires with JST PH connectors, you'll make the assembly more manageable.

### Part: 2-pin JST Female
quantity: 4
JST PH cable
[2-pin JST Female](https://www.adafruit.com/product/261)

### Part: 2-pin JST Male
quantity: 4
JST PH Cable
[2-pin JST Male](https://www.adafruit.com/product/3814)

### Part: 3-pin JST Female
quantity: 3
JST PH Cable
[3-pin JST Female](https://www.adafruit.com/product/3893)

### Part: 3-pin JST Male
quantity: 3
JST PH Cable
[3-pin JST Male](https://www.adafruit.com/product/4046)

### Part: 4-pin JST Male
quantity: 4
JST PH Cable
[4-pin JST Male](https://www.adafruit.com/product/4045)

### Part: 4-pin JST Female
quantity: 4
JST PH Cable
[4-pin JST Female](https://www.adafruit.com/product/3950)

### Part: JST PH Kit
quantity: 1
Assortment of JST PH Connectors
[JST PH Kit](https://www.adafruit.com/product/4422)

### Part: 10-wire silicone ribbon cable
quantity: 1
28AWG silicone cover stranded wire
[10-wire silicone ribbon cable](https://www.adafruit.com/product/3890)

## Non-Adafruit Parts

These parts are used in the project but not sold in the Adafruit Online Shop.

### Part: MX Switches
quantity: 12
Cherry MX Speed Silver Keyswitch (10 Pack)
[MX Switches](https://www.amazon.com/gp/product/B07B79J3ZK)

### Part: Key Caps for MX Switches
quantity: 1
Available in Black and different colors
[Key Caps for MX Switches](https://www.amazon.com/gp/product/B06VWBV3Q7/)

### Part: Whammy Bar
quantity: 1
6mm Bar Arm for Electric Guitar
[Whammy Bar](https://www.amazon.com/gp/product/B00CE1WO48/)

### Part: Knobs for Potentiometer
quantity: 2
GTE Knob - Small
[Knobs for Potentiometer](https://www.sparkfun.com/products/11951)

### Part: Knobs for Rotary Selector Switch
quantity: 1
Black Knob - 15x19mm
[Knobs for Rotary Selector Switch](https://www.sparkfun.com/products/9998)

### Part: Extension Springs
quantity: 1
Extension Spring Kit (6.35 x 22.2 mm)
[Extension Springs](https://www.amazon.com/gp/product/B01KZP0WOS/)

### Part: Black LED Acrylic
quantity: 1
Precut Sheet –  114mm x 144mm
[Black LED Acrylic](https://www.tapplastics.com/product/plastics/cut_to_size_plastic/black_led_sheet/668)

### Hardware List
 **Guitar Body – Bottom Half**

- 16x M3 x 6mm pan head screws
- 4x M3 x 8mm pan head screws
- 4x M3 x 10mm pan head screws
- 4x M3 x 16mm pan head screws
- 20x M3 hex nuts
- 4x M3 x 20mm standoffs
- 1x Extension Spring (6.35 x 22.2 mm)

**Guitar Body – Top Half**

- 7x M3 x 6mm pan head screws
- 7x M3 hex nuts

**Guitar Neck**

- 12x M2.5 hex nuts
- 6x M2.5 x 8mm pan head screws
- 2x M3 x 6mm pan head screws
- 2x M3 hex nuts

![3d_printing_hardware-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/001/medium640/3d_printing_hardware-screws.jpg?1583719439)

### Part: M2.5 Standoff Kit
quantity: 1
Black Nylon screws standoffs and hex nuts
[M2.5 Standoff Kit](https://www.adafruit.com/product/3299)

### Part: M3 Standoff Kit
quantity: 1
Brass screws standoffs and hex nuts
[M3 Standoff Kit](https://www.amazon.com/gp/product/B06XQ33Y9X/)

## Author Credits

CAD by [Noe Ruiz](https://www.twitter.com/ecken) and Code by [Liz Clark](https://www.twitter.com/blitzcitydiy).

# MX MIDI Guitar

## Circuit Diagram

The diagram below provides a visual reference for wiring of the components. This diagram was created using the software package [Fritzing](http://fritzing.org/download/).

## Adafruit Library for Fritzing

Use Adafruit's Fritzing parts library to create circuit diagrams for your projects. Download the library or just grab individual parts. Get the library and parts from [GitHub - Adafruit Fritzing Parts](https://github.com/adafruit/Fritzing-Library/tree/master/parts).

![](https://cdn-learn.adafruit.com/assets/assets/000/088/736/medium800/3d_printing_midiGuitar-V3.jpg?1582768189)

## Wired Connections

Make the following connections for the LISD3DH accelerometer.

- Grand M4 **SDA** to LIS3DH **SDA**
- Grand M4 **SCL** to&nbsp; LIS3DH **SCL**
- Grand M4 **GND** to LIS3DH **GND**
- Grand M4 **3V** to LIS3DH **VIN**

Pitch Bend/Whammy Potentiometer

- Grand M4 **PIN1** to Pot **PIN1**
- Grand M4 **GND** to Pot **PIN2**
- Grand M4 **3V** to Pot **PIN3**

Modulation Potentiometer

- Grand M4 **PIN2** to Pot **PIN1**
- Grand M4 **GND** to Pot **PIN2** &nbsp;
- Grand M4 **3V** to Pot **PIN3**

Velocity Potentiometer

- Grand M4 **PIN3** to Pot **PIN1**
- Grand M4 **GND** to Pot **PIN2** &nbsp;
- Grand M4 **3V** to Pot **PIN3**

Strum Mode Switch

- Grand M4 **PIN52** to Switch **PIN1**
- Grand M4 **GND** to Switch **GND**

Accelerometer Mode Switch

- Grand M4 **PIN53** to Switch **PIN1**
- Grand M4 **GND** to Switch **GND**

8-Octave Selector Switch

- Grand M4 **PIN24-31** to 8-Way Switch **PIN1-8**
- Grand M4 **GND** to 8-Way Switch **GND**

Strum Switches

- Grand M4 **PIN23** to Switch 1 **NO**
- Grand M4 **PIN22** to Switch 2 **NO**
- Grand M4 **GND** to Switch 2 **GND**
- Grand M4 **GND** to Switch 1 **GND**

MX Switches

- Grand M4 **PIN2-12** , **PIN14** to MX Switch **1-12 NO**
- Grand M4 **GND** to MX Switch **1-12 GND**

## Going Further

The head of the guitar can house a strip of NeoPixels for additional lighting effects. Using a slide switch, a 500mAh battery and Adafruit Feather M4, you can create LED animations with CircuitPython. This is a separate system apart from the Grand Central M4.

## Wired Connections&nbsp;

**Feather M4, NeoPixel Strip and Switch**

- Feather **EN** to Switch **PIN1**
- Feather **GND** to Switch **PIN2**
- Feather **PIN5** to NeoPixel **DIN**
- Feather **GND** to NeoPixel **GND**
- Feather **3V** to NeoPixel **5V** &nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/089/076/medium800/3d_printing_feather-circuit-diagram.jpg?1583805261)

## Extra Parts for the Neck NeoPixel Effects
### 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)

### Breadboard-friendly SPDT Slide Switch

[Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/product/805)
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch no matter what size fingers you have, but not so easy that they'll get flipped by accident. Work great as...

In Stock
[Buy Now](https://www.adafruit.com/product/805)
[Related Guides to the Product](https://learn.adafruit.com/products/805/guides)
![Small, black, SPDT slide switch.](https://cdn-shop.adafruit.com/640x480/805-03.jpg)

### Lithium Ion Polymer Battery - 3.7v 500mAh

[Lithium Ion Polymer Battery - 3.7v 500mAh](https://www.adafruit.com/product/1578)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 500mAh for a total of about 1.9 Wh. If you need a larger (or smaller!) battery, <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/1578)
[Related Guides to the Product](https://learn.adafruit.com/products/1578/guides)
![Angled shot of a Lithium Ion Polymer Battery 3.7V 500mAh with JST-PH connector.](https://cdn-shop.adafruit.com/640x480/1578-03.jpg)

### Adafruit Mini Skinny NeoPixel Digital RGB LED Strip - 60 LED/m

[Adafruit Mini Skinny NeoPixel Digital RGB LED Strip - 60 LED/m](https://www.adafruit.com/product/2964)
So thin. So mini. So teeeeeeny-tiny. It's the 'skinny' version of our classic NeoPixel strips!

These NeoPixel strips have 60 digitally-addressable pixel Mini LEDs per meter and are very affordable and are only 7.5 mm wide, 5 mm if you remove the strip from the...

In Stock
[Buy Now](https://www.adafruit.com/product/2964)
[Related Guides to the Product](https://learn.adafruit.com/products/2964/guides)
![Video of an Adafruit NeoPixel Digital RGB LED Strip with all the LEDs illuminating various colors. ](https://cdn-shop.adafruit.com/product-videos/640x480/2964-06.jpg)

# MX MIDI Guitar

## CircuitPython on the Grand Central M4 Express

![](https://cdn-learn.adafruit.com/assets/assets/000/089/541/medium800/3d_printing_hero-code-banner.jpg?1584486612)

Take your **Grand Central M4 Express** board and plug it into your computer via a known good data + power USB cable. Your operating system will show a drive named **CIRCUITPY** when a board is plugged in. If you get a drive named **GCM4BOOT** , you'll likely need to install **CircuitPython**. This is easy, see the steps below to do this, get library files, and copy the code to your board.

## CircuitPython Setup for the Grand Central M4 Express
First, to make sure you're running the most recent version of **CircuitPython** for the **Grand Central M4 Express**.

[Click to read on installing CircuitPython on the Grand Central M4 Express](https://learn.adafruit.com/adafruit-grand-central/circuitpython)
## Grand Central M4 Express Libraries
You'll need a few **CircuitPython** libraries in the **lib&nbsp;** folder on the Grand Central M4 Express **CIRCUITPY** drive for the code to work. Head to [https://circuitpython.org/libraries](https://circuitpython.org/libraries) to download the latest library bundle matching the major version of CircuitPython now on your board (5 for CircuitPython 5.x, etc.). [The procedure is available in the Grand Central M4 Express guide](https://learn.adafruit.com/adafruit-grand-central/circuitpython-libraries).

Once you've downloaded the libraries bundle, add these libraries to the **lib** folder on the Grand Central:

- **adafruit\_bus\_device**
- **adafruit\_lis3dh.mpy**
- **adafruit\_midi**
- **simpleio.mpy**

Your Grand Central **CIRCUITPY** drive should look like this after you load the code below:

![](https://cdn-learn.adafruit.com/assets/assets/000/089/406/medium800/3d_printing_cpFiles.png?1584404896)

## Download the Code from GitHub
Once your **Grand Central M4 Express is** &nbsp;all setup with **CircuitPython** and the necessary libraries, you can click on the **Download:**  **Project Zip** link above the code to get the code file.

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

# MX MIDI Guitar

## Code Walkthrough

![](https://cdn-learn.adafruit.com/assets/assets/000/089/543/medium800/3d_printing_code-imports-banner.jpg?1584486983)

## Libraries
The code begins by importing the libraries.

```python
import time
import board
import simpleio
import busio
import adafruit_lis3dh
import digitalio
from digitalio import DigitalInOut, Direction, Pull
from analogio import AnalogIn
import usb_midi
import adafruit_midi
from adafruit_midi.note_on          import NoteOn
from adafruit_midi.note_off         import NoteOff
from adafruit_midi.control_change   import ControlChange
from adafruit_midi.pitch_bend       import PitchBend
```

## MIDI Setup
After the libraries, `midi` is declared to bring in the `adafruit_midi` library. It declares that the USB port on the Grand Central board will be transmitting the MIDI data.

```python
midi = adafruit_midi.MIDI(midi_out=usb_midi.ports[1], out_channel=0)
```

## LIS3DH Accelerometer Setup
Next the LIS3DH accelerometer is setup to be controlled via **I2C** , with its range being 2G.

```python
i2c = busio.I2C(board.SCL, board.SDA)
lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c)

lis3dh.range = adafruit_lis3dh.RANGE_2_G
```

## Analog Inputs
![](https://cdn-learn.adafruit.com/assets/assets/000/089/377/medium800/3d_printing_edited_pots_P1220518.jpg?1584390684 The potentiometers for modulation and velocity control.)

The three potentiometers are then brought in to control three different MIDI parameters: **pitch bend** , **modulation** and **velocity**. The modulation and velocity potentiometers are located on the body of the MIDI guitar and the pitch bend potentiometer is in the _whammy bar_ assembly.

```python
pitchbend_pot = AnalogIn(board.A1)
mod_pot = AnalogIn(board.A2)
velocity_pot = AnalogIn(board.A3)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/089/376/medium800/3d_printing_edited_whammy_P1220520.jpg?1584390625 Whammy bar. The pitchbend_pot is inside this 3D printed assembly.)

## Mode Switches
This is followed by two **switches** , which will switch between two different **modes**. The first is for _ **modulation control** _. It will allow you to switch between either using the **potentiometer** to control modulation or the LIS3DH, which will affect the modulation based on the physical position of the MIDI guitar.

The second switch is for _ **strum mode** _. Since this is a MIDI guitar, you can strum the notes using the _ **strummer** _, which will activate the switches inside the mechanism. However, this might not always be ideal. By using this switch you can turn off the strummer and just hit the note buttons on the neck of the MIDI guitar to play it like a traditional MIDI keyboard.

```python
mod_select = DigitalInOut(board.D52)
mod_select.direction = Direction.INPUT
mod_select.pull = Pull.UP

strum_select = DigitalInOut(board.D53)
strum_select.direction = Direction.INPUT
strum_select.pull = Pull.UP
```

![](https://cdn-learn.adafruit.com/assets/assets/000/089/378/medium800/3d_printing_edited_switches_P1220516.jpg?1584390736 The two mode switches.)

## Strumming Switches
Finally, the two **switch inputs** for the strumming mechanism are setup. There are two switches inside the strummer mechanism. They're activated when you strum up and down with the strummer.

```python
strumUP = DigitalInOut(board.D22)
strumUP.direction = Direction.INPUT
strumUP.pull = Pull.UP

strumDOWN = DigitalInOut(board.D23)
strumDOWN.direction = Direction.INPUT
strumDOWN.pull = Pull.UP
```

![](https://cdn-learn.adafruit.com/assets/assets/000/089/379/medium800/3d_printing_edited_strummer_P1220521.jpg?1584390767 The strumming mechanism. Two switches are inside.)

## Guitar Neck Buttons
Now two arrays of inputs are brought in. The first is for the note inputs, or buttons that are on the neck of the guitar. There are 12 of them.

```python
note_pins = [board.D14, board.D2, board.D3, board.D4, board.D5, board.D6, board.D7, board.D8, board.D9, board.D10, board.D11, board.D12]

note_buttons = []

for pin in note_pins:
    note_pin = digitalio.DigitalInOut(pin)
    note_pin.direction = digitalio.Direction.INPUT
    note_pin.pull = digitalio.Pull.UP
    note_buttons.append(note_pin)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/089/380/medium800/3d_printing_edited_mx_P1220517.jpg?1584390801 The Cherry MX Keys on the neck of the guitar.)

## Octave Selector
This is followed by the inputs for the rotary switch. The switch has 8 inputs and as a result 8 pins are set up. The switch will allow you to _change octaves_ for the notes that you can play. This expands the range of the MIDI guitar by quite a bit rather than being stuck with just the 12 notes setup with the buttons.

```python
oct_sel_pins = [board.D24, board.D25, board.D26, board.D27, board.D28, board.D29, board.D30, board.D31]

octave_selector = []

for pin in oct_sel_pins:
    sel_pin = digitalio.DigitalInOut(pin)
    sel_pin.direction = digitalio.Direction.INPUT
    sel_pin.pull = digitalio.Pull.UP
    octave_selector.append(sel_pin)
```

![](https://cdn-learn.adafruit.com/assets/assets/000/089/381/medium800/3d_printing_edited_rotary_P1220515.jpg?1584390865 The rotary switch. It is located next to the two mode switches.)

## Digital Input States
After the peripherals have been setup, the _state machines_ can follow. There are 12 states setup for the 12 different notes to help with _debouncing_. Their names correspond with the note name that will be assigned to each button.

There are also two states, _strummed_ and _pick_, that will be used to track the state of the strummer.

```python
note_e_pressed = None
note_f_pressed = None
note_fsharp_pressed = None
note_g_pressed = None
note_gsharp_pressed = None
note_a_pressed = None
note_asharp_pressed = None
note_b_pressed = None
note_c_pressed = None
note_csharp_pressed = None
note_d_pressed = None
note_dsharp_pressed = None

strummed = None
pick = None
```

## Analog Input States
There are some variables setup to help track the positions of the potentiometers and the LIS3DH. These will be used to compare to the previous value reading to get the current reading for each input.

```python
pitchbend_val2 = 0
mod_val2 = 0
velocity_val2 = 0
acc_pos_val2 = 0
acc_neg_val2 = 0
```

## Note Input Arrays
The 12 states that were just set up for the _note inputs_ are put into an array called `note_states`. This array will be able to match with the `note_buttons` array in the loop.

```python
note_states = [note_e_pressed, note_f_pressed, note_fsharp_pressed, note_g_pressed, note_gsharp_pressed, note_a_pressed, note_asharp_pressed, note_b_pressed, note_c_pressed, note_csharp_pressed, note_d_pressed, note_dsharp_pressed]
```

This is followed by an array of the _MIDI note numbers_ called `note_numbers`. Next is a list of the note names that correspond with those numbers. The list is stored in parenthesis and is set to equal `note_numbers`. Those note names are now variables that are holding the note numbers. This works since the names are in the same order as the numbers. This lets you easily type in the note names when creating your note arrays that will be tied to the buttons on the guitar neck. It tends to make more sense to look at note names than what can appear to be random numbers.

```python
note_numbers = [21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
                41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
                61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
                81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
                101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
                117, 118, 119, 120, 121, 120, 123, 124, 125, 126, 127]

(A0, Bb0, B0, C1, Db1, D1, Eb1, E1, F1, Gb1, G1, Ab1,
 A1, Bb1, B1, C2, Db2, D2, Eb2, E2, F2, Gb2, G2, Ab2,
 A2, Bb2, B2, C3, Db3, D3, Eb3, E3, F3, Gb3, G3, Ab3,
 A3, Bb3, B3, C4, Db4, D4, Eb4, E4, F4, Gb4, G4, Ab4,
 A4, Bb4, B4, C5, Db5, D5, Eb5, E5, F5, Gb5, G5, Ab5,
 A5, Bb5, B5, C6, Db6, D6, Eb6, E6, F6, Gb6, G6, Ab6,
 A6, Bb6, B6, C7, Db7, D7, Eb7, E7, F7, Gb7, G7, Ab7,
 A7, Bb7, B7, C8, Db8, D8, Eb8, E8, F8, Gb8, G8, Ab8,
 A8, Bb8, B8, C9, Db9, D9, Eb9, E9, F9, Gb9, G9) = note_numbers
```

Up next there are 8 arrays containing 12 note names each. These variables are being imported from the list above. Each note name corresponds to a MIDI note number. When these numbers are sent along with a NoteOn message in MIDI then the proper pitch is played.

These arrays are for the different octaves that can be selected using the rotary switch. Each array begins with an E natural note. This was chosen because the lowest string on a guitar in standard tuning is tuned to E natural. The notes are chromatic and since there are 12 (one for each button) you're just one note shy of a full octave.

You can also customize the notes that correspond to each button by editing the arrays.

```python
octave_8_cc = [E8, F8, Gb8, G8, Ab8, A8, Bb8, B8, C9, Db9, D9, Eb9]
octave_7_cc = [E7, F7, Gb7, G7, Ab7, A7, Bb7, B7, C8, Db8, D8, Eb8]
octave_6_cc = [E6, F6, Gb6, G6, Ab6, A6, Bb6, B6, C7, Db7, D7, Eb7]
octave_5_cc = [E5, F5, Gb5, G5, Ab5, A5, Bb5, B5, C6, Db6, D6, Eb6]
octave_4_cc = [E4, F4, Gb4, G4, Ab4, A4, Bb4, B4, C5, Db5, D5, Eb5]
octave_3_cc = [E3, F3, Gb3, G3, Ab3, A3, Bb3, B3, C4, Db4, D4, Eb4]
octave_2_cc = [E2, F2, Gb2, G2, Ab2, A2, Bb2, B2, C3, Db3, D3, Eb3]
octave_1_cc = [E1, F1, Gb1, G1, Ab1, A1, Bb1, B1, C2, Db2, D2, Eb2]
```

These arrays are then put into the `octave_select` array. This allows for the rotary switch to select the different note ranges.

```python
octave_select = [octave_1_cc, octave_2_cc, octave_3_cc, octave_4_cc, octave_5_cc, octave_6_cc, octave_7_cc, octave_8_cc]
```

## Reading Analog Inputs
This is followed by a fairly standard function when you work with analog inputs in CircuitPython. It allows you to read the value of an analog input continuously.

[For more info on analog inputs and CircuitPython, check out the CircuitPython Essentials Learn Guide:](https://learn.adafruit.com/circuitpython-essentials/circuitpython-analog-in)
```python
def val(pin):
    return pin.value
```

## Beginning REPL Message
Finally, right before the loop, there are some debugging strings that are printed out to the REPL to let you know which MIDI channel output is active.

```python
print("MIDI Guitar")

print("Default output MIDI channel:", midi.out_channel + 1)
```

# The Loop
## Mapping Analog Values to MIDI Parameter Values
At the beginning of the loop, `x`, `y` and `z` are defined to hold the values of the accelerometer.

Following that, there are five variables assigned to hold analog values of the three potentiometers and two accelerometer readings. The values for the potentiometers are being brought in with the `val()` function setup before the loop. The `map_range()` function is being used to convert the analog voltage value range to values that match with the MIDI CC ranges being controlled by the potentiometers and accelerometer.

The accelerometer setup is a little different than the potentiometers. The goal for the accelerometer is to control modulation. When the accelerometer is in a centralized, or neutral, position the modulation will be set to `0`. However, when you tilt the guitar up or down the modulation amount will increase. That's why there are mapped values for negative and positive ranges.

```python
while True:
    x, y, z = [value / adafruit_lis3dh.STANDARD_GRAVITY for value in lis3dh.acceleration]

    pitchbend_val1 = round(simpleio.map_range(val(tonebend_pot), 0, 65535, 0, 16383))
    mod_val1 = round(simpleio.map_range(val(mod_pot), 0, 65535, 0, 127))
    velocity_val1 = round(simpleio.map_range(val(velocity_pot), 0, 65535, 0, 127))
    acc_pos_val1 = round(simpleio.map_range(x, 0, 0.650, 127, 0))
    acc_neg_val1 = round(simpleio.map_range(y, -0.925, 0, 127, 0))
```

Info: 

## Sending MIDI Data with Analog Data
The rest of the loop defines what _MIDI messages_ are sent as a result of using all of the different control interfaces. These are stored in a series of `if `statements.

The first `if` statemen **t** is checking the value of the `mod_select` switch. The `mod_select` determines whether modulation is being controlled by the potentiometer (`mod_pot`) or the accelerometer. For the accelerometer, a neutral position sends a value of `0`&nbsp;for modulation and then if you **tilt** the MIDI guitar up or down the value increases. The potentiometer allows you to set an unchanging value for modulation.

This is followed by an `if` statement for the potentiometer that controls the velocity value. Velocity in MIDI is the volume level that a note is recorded at. You won't necessarily notice it while you're actively playing (depending on the patch), but on playing back MIDI data it can make the music sound more human if there's variation in the levels.

The last analog potentiometer controls PitchBend and lives in the whammy bar mechanism. This parameter allows you to adjust the pitch up or down on a note that you’re playing.

```python
if not mod_select.value:
        if (abs(acc_pos_val1 - acc_pos_val2) &lt; 50):
            acc_pos_val2 = acc_pos_val1
            accelerator_pos = int(acc_pos_val2)
            accWheel_pos = ControlChange(1, accelerator_pos)
            midi.send(accWheel_pos)
            print(accelerator_pos)
            time.sleep(0.001)
        elif (abs(acc_neg_val1 - acc_neg_val2) &lt; 50):
            acc_neg_val2 = acc_neg_val1
            accelerator_neg = int(acc_neg_val2)
            accWheel_neg = ControlChange(1, accelerator_neg)
            midi.send(accWheel_neg)
            print(accelerator_neg)
            time.sleep(0.001)
else:
        if (abs(mod_val1 - mod_val2) &gt; 2):
            mod_val2 = mod_val1
            modulation = int(mod_val2)
            modWheel = ControlChange(1, modulation)
            midi.send(modWheel)
            print(modulation)
            time.sleep(0.001)
if (abs(velocity_val1 - velocity_val2) &gt; 2):
        velocity_val2 = velocity_val1
        velocity = int(velocity_val2)
        time.sleep(0.001)

if (abs(pitchbend_val1 - pitchbend_val2) &gt; 75):
        pitchbend_val2 = pitchbend_val1
        a_pitch_bend = PitchBend(int(pitchbend_val2))
        midi.send(a_pitch_bend)
        print(int(pitchbend_val2))
        time.sleep(0.001)
```

## How the MIDI Messages Are Being Sent
All of these `if` statements are using the same code structure to translate these analog values to MIDI values that can be successfully sent to your MIDI software. First, it checks to see if the value of the input has changed since the last time it was checked. If it has, it checks to see if it has surpassed the threshold, which varies depending on the range of the input and MIDI parameter.

```python
if (abs(mod_val1 - mod_val2) &gt; 2):
```

If the value has changed enough, then the current value is logged and a new variable is setup to hold that value as an integer. MIDI message values need to be integers in order to be sent properly.

```python
mod_val2 = mod_val1
modulation = int(mod_val2)
```

Another variable is setup to hold the MIDI message, which includes the type of message, MIDI channel and the value as an integer.

```python
modWheel = ControlChange(1, modulation)
```

The MIDI message is finally sent with `midi.send()`. This is followed by a quick delay and that completes the process.

```python
midi.send(modWheel)
time.sleep(0.001)
```

## Octave Selection
After the analog inputs, the code moves on to the digital inputs. This involves the rotary switch, the MX switches on the neck of the MIDI guitar and the two switches in the strummer.

This section begins by checking the position of the rotary switch to determine which octave is active. This is stored as `octave` and is called later when the NoteOn MIDI message is sent.

```python
for s in octave_selector:
        if not s.value:
            o = octave_selector.index(s)
            octave = octave_select[o]
```

## Strum Mode
Next, the `strum_select` switch's position is checked. This switch determines whether you are strumming your MIDI guitar or just pressing the notes on the guitar's neck like a keyboard.

After checking if strum mode is active, the states of both switches located in the strum bar mechanism are checked. This takes care of debouncing the switches. There is also a variable called `pick` (_named for a guitar pick_) that is holding `time.monotonic()`.

There is an `if` statement after the strummer switch state checks. It prevents the strummer from a glitch. If a note is not pressed down when you hit the strum bar, then the code is waiting for a note to be pressed on the neck. If you hit the strummer and then a few minutes later hit a note, it will sound. By having this line, the state of the two switches is reset to its initial `none` state in the event that this happens.

```python
if not strum_select.value:
  if strumUP.value and up_pick == None:
    up_pick = "strummed"
    pick = time.monotonic()
  if strumDOWN.value and down_pick == None:
    down_pick = "strummed"
    pick = time.monotonic()
  if (not pick) or ((time.monotonic() - pick) &gt; 0.5 and (down_pick or up_pick == "strummed")):
    up_pick = None
    down_pick = None
```

After the strumming is all setup, the code checks to see if the strummer has been strummed in either direction. If it has, then the 12 buttons on the neck are brought in with `i` being the index that identifies which button has been pressed. The button's values and states are then checked.

If the button has been pressed, then the NoteOn MIDI message is sent. That message includes the matching octave's note and the velocity value. The note's state and strummed status are updated and everything is closed out by a brief delay.

```python
if (not strumUP.value and up_pick == "strummed") or (not strumDOWN.value and down_pick == "strummed"):
  for i in range(12):
    buttons = note_buttons[i]
    if not buttons.value and not note_states[i]:
      midi.send(NoteOn(octave[i], velocity))
      note_states[i] = True
      print(octave[i])
      up_pick = None
      down_pick = None
      time.sleep(0.001)
```

With MIDI, if you play a note you also need to tell it to stop playing. Otherwise, it will go on forever. This next portion of code does just that. It checks to see if a note button is no longer being pressed. If that is true, then the note and strum states are set to their defaults and the NoteOff MIDI message is sent.

```python
for i in range(12):
  buttons = note_buttons[i]
  if buttons.value and note_states[i]:
    note_states[i] = False
    strummed = None
    midi.send(NoteOff(octave[i], velocity)
    time.sleep(0.001)
```

## Tapping Mode (No Strumming Required)
A wild `else` appears! If you scroll up a bit, you'll see that this **else** is the partner to the `if not strum_select.value` statement. This `else` statement allows you to play MIDI notes on this guitar without using the strum bar. You can just press the buttons on the guitar's neck just like a MIDI keyboard.

You'll see that the code matches our previous code to allow for NoteOn and NoteOff messages. The only thing missing is the portions about the strum bar.

```python
else:
  for i in range(12):
    buttons = note_buttons[i]
    if not buttons.value and not note_states[i]:
      midi.send(NoteOn(octave[i], velocity))
      note_states[i] = True
      print(octave[i])
      time.sleep(0.001)
    if (buttons.value and note_states[i]):
      note_states[i] = False
      midi.send(NoteOff(octave[i], velocity))
      time.sleep(0.001)
```

# MX MIDI Guitar

## 3D Printing

## 3D Printed Parts

STL files for 3D printing are oriented to print "as-is" on FDM style machines. Parts are designed to 3D print without any support material. Original design source may be downloaded using the links below.

[Edit CAD from Fusion 360](https://a360.co/4cobZzT)
[Download CAD STEP files](https://cdn-learn.adafruit.com/assets/assets/000/130/736/original/MX_Guitar-STEP.zip?1718718214)
[Download CAD Files from Thingiverse](https://www.thingiverse.com/thing:4228412)
[Download CAD files from PrusaPrinters](https://www.prusaprinters.org/prints/25746-mx-midi-guitar)
[Download CAD files from Cults3D](https://cults3d.com/en/3d-model/gadget/mx-midi-guitar)
## Body Parts

Here's a list of the body parts files names.

- body-left-top.stl
- body-left-bottom.stl
- body-right-top.stl
- body-right-bottom.stl
- body-middle-bottom.stl
- body-middle-top.stl
- head-case.stl
- head-diffuser.stl
- head-top.stl
- neck-bottom.stl
- neck-top.stl

![3d_printing_3dparts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/088/987/medium640/3d_printing_3dparts.jpg?1583680376)

## Strumming Parts

These parts make the strumming mechanism.

- pick-base.stl
- pick-hinge.stl (2x)
- pick-joint.stl (2x)
- pick-mount.stl
- pick-plate-sw-left.stl
- pick-plate-sw-right.stl

![3d_printing_strum-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/088/988/medium640/3d_printing_strum-parts.jpg?1583680456)

Info: 

## Whammy Bar Parts

These parts make the whammy bar assembly.

- wmy-plate-idler.stl
- wmy-plate-pot.stl
- wmy-plate-spring.stl
- wmy-spring-ring-a.stl
- wmy-spring-ring-b.stl
- wmy-wheel-joint.stl
- wmy-wheel-mid.stl
- wmy-wheel-pot.stl
- Extension Spring (6.35 x 22.2 mm)

![3d_printing_whammy-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/088/990/medium640/3d_printing_whammy-parts.jpg?1583681327)

## Design Source Files

The project assembly was designed in Fusion 360. This can be downloaded in different formats like STEP, STL and more. Electronic components like Adafruit's board, displays, connectors and more can be downloaded from the [Adafruit CAD parts GitHub Repo](https://github.com/adafruit/Adafruit_CAD_Parts).

![3d_printing_grandcentral-spin.gif](https://cdn-learn.adafruit.com/assets/assets/000/089/024/medium640thumb/3d_printing_grandcentral-spin.jpg?1583762305)

## Slicing Parts

The 3D models in the STL files have been oriented to print "as-is".&nbsp; With some 3D printers, the neck parts would not fit – With the parts rotated, it can fit diagonally across the bed. These parts do no require any support material.

![3d_printing_slice-diagonal.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/199/medium640/3d_printing_slice-diagonal.jpg?1584026307)

## Setup Parts

Multiple parts can be placed on the bed. By planning the arrangement, the placement of the parts can allow for several large parts like the left and right wings of the guitar body.

![3d_printing_slice-wings.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/200/medium640/3d_printing_slice-wings.jpg?1584026750)

## Large Surface Area

Some of the parts in the guitar body feature large surfaces and thus requires a well leveled bed. Warping in the corners could be an issue – Using a brim could be helpful and prevent corners from warping. Ensure the bed surface is clean and dust free for a perfect first layer.&nbsp;

![3d_printing_slice-bigsurface.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/201/medium640/3d_printing_slice-bigsurface.jpg?1584027787)

# MX MIDI Guitar

## Neck Head Assembly

## Hardware for Neck and Head

Use the following hardware to attach the head of the guitar to the neck of the guitar.

![3d_printing_head-neck-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/026/medium640/3d_printing_head-neck-screws.jpg?1583767497)

## Install Screws

Insert the M3 screws through the two mounting holes on the end of the **neck-bottom.stl** part. Place the **head-case.stl** part onto the threads of the screws and joint the two parts together.

![3d_printing_head-neck-screw-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/025/medium640/3d_printing_head-neck-screw-install.jpg?1583767478)

## Secure Hardware

Install and fasten M3 hex nuts onto the threads of the M3 screws. Use a pair of needle nose pliers to secure the **neck-bottom.stl** and **head-case.stl** parts together.

![3d_printing_head-neck-nuts-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/027/medium640/3d_printing_head-neck-nuts-install.jpg?1583767514)

## Assembled Neck and Head

The neck and head are now assembled and ready for the next set of assembly.

![3d_printing_head-neck-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/028/medium640/3d_printing_head-neck-secured.jpg?1583767532)

# MX MIDI Guitar

## Head Cover Assembly

## Black LED Acrylic

The **head-diffuser.stl** can either be 3D printed part or CNC/Laser cut from acrylic. This build uses Black LED Acrylic as the material for making the part. The diffuser is designed to press fit into the opening in the **head-top.stl** cover part.

![3d_printing_head-cover-acrylic.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/460/medium640/3d_printing_head-cover-acrylic.jpg?1584457807)

## Glue Diffuser to Cover

Hot glue can be used to seal the diffuser to the top cover.

![3d_printing_head-cover-glue-sides.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/462/medium640/3d_printing_head-cover-glue-sides.jpg?1584457940)

## Secured Diffuser

Without the hot glue the diffuser may pop out once the cover is installed into the head of the guitar.

![3d_printing_head-cover-hotglue.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/461/medium640/3d_printing_head-cover-hotglue.jpg?1584457853)

## Installed Diffuser Cover

With the diffuser now installed, the top cover is ready for the head of the guitar.

![3d_printing_head-cover-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/464/medium640/3d_printing_head-cover-installed.jpg?1584458049)

# MX MIDI Guitar

## Body Assembly

## Guitar Body – Bottom Half

Use the following hardware to assembly the bottom half of the guitar body.

- 4x M3 x 6mm pan head screws
- 4x M3 hex nuts

![3d_printing_body-bottom-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/011/medium640/3d_printing_body-bottom-screws.jpg?1583719888)

## Install Machine Screws

Insert and fit the M3 machine screws through the tabs on the middle part of the bottom half of the guitar body.

![3d_printing_body-bottom-screws-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/012/medium640/3d_printing_body-bottom-screws-install.jpg?1583719907)

## Secure Machine Screws

Place the left and right parts of the bottom half of the guitar body onto the screw threads. Insert and fasten the M3 hex nuts onto the threads of the M3 screws. Use a pair of needle nose pliers to tightly fasten the hex nuts.

![3d_printing_body-bottom-fastened.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/013/medium640/3d_printing_body-bottom-fastened.jpg?1583719926)

## Guitar Body – Top Half

Use the following hardware to assembly the bottom half of the guitar body.

- 4x M3 x 6mm pan head screws
- 4x M3 hex nuts

![3d_printing_body-top-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/014/medium640/3d_printing_body-top-screws.jpg?1583719942)

## Install and Secure Screws

Follow the same procedure for installing the hardware to the top half of the guitar body. Insert the M3 screw through the mounting tabs and use M3 hex nuts to secure the parts together.

![3d_printing_body-top-scrws-fastened.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/015/medium640/3d_printing_body-top-scrws-fastened.jpg?1583720000)

## Installing Guitar Body and Neck

Use the following hardware to secure the neck of the guitar to the top half of the guitar body.

- 3x M3 x 6mm pan head screws
- 3x M3 hex nuts

![3d_printing_body-neck-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/016/medium640/3d_printing_body-neck-screws.jpg?1583720031)

## Install Neck to Top Half Guitar Body

Install the **neck-bottom.stl** part into the **body-middle-top.stl** part by press fitting them together. Check and ensure the three mounting holes are nicely lined up with each other.

![3d_printing_body-neck-pressfit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/017/medium640/3d_printing_body-neck-pressfit.jpg?1583720061)

## Install Hardware into Neck

Insert the M3 screws into the **neck-bottom.stl** so the threads protrude through the **body-middle-top.stl** part.

![3d_printing_body-neck-screws-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/018/medium640/3d_printing_body-neck-screws-install.jpg?1583720089)

## Secure and Fasten Hardware

Insert and fasten the M3 hex nuts onto the threads of the M3 screws. Use a pair of needle nose pliers to get a holding of the M3 hex nuts.

![3d_printing_body-neck-nuts-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/019/medium640/3d_printing_body-neck-nuts-installed.jpg?1583720110)

## Assembled Guitar Body and Neck

The top half and bottom half of the guitar body are assembled.&nbsp;

![3d_printing_body-neck-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/020/medium640/3d_printing_body-neck-installed.jpg?1583720134)

# MX MIDI Guitar

## Strum Assembly

## Strum Hardware Screws

Gather the following hardware for creating the strum mechanism.

**Hardware**

- 4x M3 x 10mm pan head screws
- 4x M3 hex nuts

![3d_printing_strum-screw-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/002/medium640/3d_printing_strum-screw-parts.jpg?1583719515)

## Install Hinges

Insert a screw through the bottom of the **pick-mount.stl** part. Place one of the **pick-hinge.stl** parts on top of the standoffs. Insert and fasten an M3 hex nut onto the thread of the screw.

![3d_printing_strum-base-joint-nut-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/003/medium640/3d_printing_strum-base-joint-nut-install.jpg?1583719543)

## Secure Hex Nuts

Repeat the process for all four standoffs. A pair of needle nose pilers can assist in grasping the hex nuts for a secure fitting.&nbsp;

![3d_printing_strum-base-joints-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/004/medium640/3d_printing_strum-base-joints-secured.jpg?1583719576)

## Install Joints to Pick

Install the two **pick-joint.stl** parts into the **pick-base.stl** by inserting them from the inside. The flange should be flush with the inner wall of the **pick-base.stl**.

![3d_printing_strum-pick-joints-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/005/medium640/3d_printing_strum-pick-joints-install.jpg?1583719600)

## Hot Glue Joints to Pick

Apply a moderate amount of hot glue to the inside of the **pick-base.stl**. This will prevent the **pick-joint.stl** from being pushed in and secured in place.

![3d_printing_strum-pick-hotglue.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/006/medium640/3d_printing_strum-pick-hotglue.jpg?1583719642)

## Strum Pick with Joints

Double check the joints are installed on both ends.

&nbsp;

![3d_printing_strum-pick-joints-nubs.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/007/medium640/3d_printing_strum-pick-joints-nubs.jpg?1583719670)

## Install Pick to Base

Begin to install the **pick-base.stl** part into the **pick-mount.stl**. Fit one of the ends into one of the **pick-hinge.stl** parts. Flex the **pick-mount.stl** slightly to allow the second **pick-joint.stl** part to fit into the second **pick-hinge.stl**.

![3d_printing_strum-base-pick-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/008/medium640/3d_printing_strum-base-pick-install.jpg?1583719693)

## Installed Pick

Double check both ends are installed properly. The **pick-base.stl** should rotate freely.&nbsp;

![3d_printing_strum-base-pick-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/009/medium640/3d_printing_strum-base-pick-installed.jpg?1583719713)

## Pick Assembly

The pick assembly is ready for the next set of parts.

![3d_printing_strum-base-pick-secured.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/010/medium640/3d_printing_strum-base-pick-secured.jpg?1583719735)

## Parts for Micro Switches

The two micro switches need 4x M3 x 16mm long machine screws and 4x M3 hex nuts. The switches will be mounted to the **pick-plate-sw-left.stl** and **pick-plate-sw-left.stl** parts.

![3d_printing_microsw-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/246/medium640/3d_printing_microsw-parts.jpg?1584122125)

## Secure Switches to Plate

Place one of the micro switch onto either of the **pick-plate-sw** parts. Orient the micro switch so the mounting holes are lined up with the plate. Insert one of M3 x 16mm long screws through the micro switch and plate. Insert and fasten an M3 hex nut to secure the switch to the plate.

![3d_printing_microsw-screw-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/247/medium640/3d_printing_microsw-screw-install.jpg?1584122214)

## Installed Switches

Repeat this process for the second micro switch. Double check the orientation of the switches are matching with the photo.

![3d_printing_microsw-secured-plates.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/248/medium640/3d_printing_microsw-secured-plates.jpg?1584122387)

## Wires for Micro Switches

Use the following wires for connecting the micro switches.

- 2-pin JST female cable – 114mm long
- 4-wire ribbon cable – 180mm long
- 2x 2-pin JST male connectors

![3d_printing_microsw-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/289/medium640/3d_printing_microsw-wires.jpg?1584144047)

## Tinning Wires

Separate the 4-wire ribbon cable so there's 2x 2-wire cables. Use wire strippers to remove a bit of insulation from the tips of each wire. Tin the ends using a bit of solder – This will prevent the strands of wires from fraying. Third helping hands can help assist while soldering.

![3d_printing_microsw-wire-tinning.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/290/medium640/3d_printing_microsw-wire-tinning.jpg?1584144170)

## Wire JST Connectors

Solder up the 2-wire ribbon cables to the male 2-pin JST connectors. Don't forget to add heat shrink tubing before soldering – This will insulate the exposed wires and prevents connections from shorting out.

![3d_printing_microsw-jst-wire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/291/medium640/3d_printing_microsw-jst-wire.jpg?1584144512)

## 2x&nbsp; 2-pin JST Cables

Repeat this process for the second 2-pin ribbon cable.

![3d_printing_microsw-jst-cables.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/292/medium640/3d_printing_microsw-jst-cables.jpg?1584144533)

## Micro Switch Ground Wire

Solder one of the wires from either 2-wire ribbon cable to the common ground on one of the micro switches. The ground is labeled on the side of the micro switch "COM". Tinning the pin of the micro switch can help solder adhere to the wire.

&nbsp;

![3d_printing_microsw-gnd-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/293/medium640/3d_printing_microsw-gnd-solder.jpg?1584144549)

## Solder Micro Switch Pin

Attach the other wire to the "NO" (Normally Open) pin on the micro switch.

![3d_printing_microsw-pin-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/294/medium640/3d_printing_microsw-pin-solder.jpg?1584144572)

## Wired Micro Switches

Repeat this process for the second micro switch. Double check the wires are connecting to the correct pins and have solid connections.

![3d_printing_microsw-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/295/medium640/3d_printing_microsw-wired.jpg?1584144727)

## Strum Installation

Get the parts for the strum assembly. The mounting plate, micro switches and pick base. This will need 4x M3 x 6mm long screws and 4x M3 hex nuts.

![3d_printing_strum-body-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/296/medium640/3d_printing_strum-body-parts.jpg?1584145396)

## Install Strum Mounting Plate

Insert 4x M3 x 6mm long screws through the back of the guitar body. Use the four mounting holes in the center near the middle of the body. While holding screws in, place the **pick-mount.stl** part over the screws so the threads go through the four mounting holes.

![3d_printing_strum-plate-body-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/297/medium640/3d_printing_strum-plate-body-install.jpg?1584145417)

## Install Micro Switches

Place the two ( **pick-plate-sw-left.stl** and **pick-plate-sw-right.stl** ) micro switches over the threads of the screws. Reference for the photo for correct placement.&nbsp;

![3d_printing_strum-sw-body-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/298/medium640/3d_printing_strum-sw-body-install.jpg?1584145445)

## Secure Strum Parts

Insert 4x M3 hex nuts onto the screws and fasten tightly to secure the strum assembly to the body of the guitar.

![3d_printing_strum-sw-body-nuts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/299/medium640/3d_printing_strum-sw-body-nuts.jpg?1584145474)

## Install Pick to Hinges

Fit the joints on the end of the **pick-base.stl** to the hinges on the **pick-mount.stl**. Start by fitting one end and then the other end. The parts can flex slightly to offer more clearance for the joints to be fitted into the hinges.

![3d_printing_strum-pick-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/300/medium640/3d_printing_strum-pick-install.jpg?1584145508)

## Test Strum Pick

Test out the micro switches by rocking the pick back and forth. The levers should easily be pressed. The pick should stay in the center when idle.

![3d_printing_strum-pick-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/301/medium640/3d_printing_strum-pick-installed.jpg?1584145543)

## Assembled Strum

Double check the hex nuts in the strum assembly is nice and tight.

![3d_printing_strum-body-assembled.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/302/medium640/3d_printing_strum-body-assembled.jpg?1584145627)

# MX MIDI Guitar

## Whammy Assembly

## Whammy Wheel Parts

The **wmy-wheel-joint.stl** and **wmy-wheel-pot.stl** parts will need to be super glued to the **wmy-wheel-mid.stl** part.

![3d_printing_wmy-wheel-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/088/999/medium640/3d_printing_wmy-wheel-parts.jpg?1583686550)

## Glue Joint to Wheel

Start by applying a moderate amount of super glue to the **wmy-wheel-joint.stl** to one of the sides of the **wmy-wheel-mid.stl** part.&nbsp;

&nbsp;

![3d_printing_wmy-joint-mid-glue.jpg](https://cdn-learn.adafruit.com/assets/assets/000/088/991/medium640/3d_printing_wmy-joint-mid-glue.jpg?1583685795)

## Glue Potentiometer Holder to Wheel

Add super glue to the **wmy-wheel-pot.stl** part and adhere it to the other side of the **wmy-wheel-mid.stl** part.

![3d_printing_wmy-mid-pot-glue.jpg](https://cdn-learn.adafruit.com/assets/assets/000/088/992/medium640/3d_printing_wmy-mid-pot-glue.jpg?1583685827)

## Glue Spring Plate

The **wmy-plate-spring.stl** part will need to be super glued to the **wmy-plate-pot.stl** part. Apply a moderate amount of super glue to the flat side of the **wmy-plate-spring.stl** part.

![3d_printing_spring-plate-glue.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/000/medium640/3d_printing_spring-plate-glue.jpg?1583686637)

## Glue Spring Plate to Potentiometer Plate

Adhere the **wmy-plate-spring.stl** part to the flat side of the **wmy-plate-pot.stl** part. Double check the edges are square on both of the parts.

![3d_printing_wmy-spring-plate-glue.jpg](https://cdn-learn.adafruit.com/assets/assets/000/088/993/medium640/3d_printing_wmy-spring-plate-glue.jpg?1583685870)

## Spring Assembly

An extension spring will be attached to the **wmy-spring-ring-a.stl** and **wmy-spring-ring-a.stl** parts to create the spring assembly.&nbsp;

![3d_printing_wmy-spring-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/088/994/medium640/3d_printing_wmy-spring-parts.jpg?1583685949)

## Install Extension Spring&nbsp;

Install the extension spring to either the **wmy-spring-ring-a.stl** or **wmy-spring-ring-a.stl** part. Press fit one of the loop ends to the slot on the end of the spring rings.

![3d_printing_spring-install-a.jpg](https://cdn-learn.adafruit.com/assets/assets/000/088/995/medium640/3d_printing_spring-install-a.jpg?1583685982)

## Install Ext. Spring to Holders

Grab the second spring ring and install the remaining loop end. Hold the two spring rings together so they're together.

![3d_printing_spring-install-b.jpg](https://cdn-learn.adafruit.com/assets/assets/000/088/996/medium640/3d_printing_spring-install-b.jpg?1583686013)

## Install Spring Holder Set to Plate

Place the set of spring rings onto the cylindrical post on the **wmy-plate-spring.stl** part. The two spring rings are placed and fitted together. Reference the photo for correct placement.

![3d_printing_wmy-springs-installeg-holding.jpg](https://cdn-learn.adafruit.com/assets/assets/000/088/997/medium640/3d_printing_wmy-springs-installeg-holding.jpg?1583686045)

## Installed Spring Holder Assembly

The spring assembly is now ready to be installed into the rest of the whammy assembly.&nbsp;

![3d_printing_wmy-springs-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/088/998/medium640/3d_printing_wmy-springs-installed.jpg?1583686085)

## Whammy Wires

Gather up the knobby potentiometer, 3-pin jST female cable, 10-wire silicone ribbon wire and&nbsp; the 3-pin JST male connector.

Measure and cut a piece of the 10-wire ribbon wire (88mm in length). Peel off a 3-wire set.

![3d_printing_wmy-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/303/medium640/3d_printing_wmy-wires.jpg?1584147180)

## JST Wire

Wire up the 3-wire silicone cable to the 3-pin JST male connector. Don't forgot to put heat shrink tubing on first!

![3d_printing_wmy-3jst-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/304/medium640/3d_printing_wmy-3jst-solder.jpg?1584147214)

## JST Cables

Cut and trim the 3-pin JST female cable to prepare it for wiring. The following wire lengths are recommended.

female cable – 74mm

male cable – 88mm

![3d_printing_wmy-3jst-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/305/medium640/3d_printing_wmy-3jst-wires.jpg?1584147247)

## Solder Potentiometer

Wire up the 3-wire silicone cable to the potentiometer. Connect the 3-pin JST female cable and follow the signal, voltage and ground wiring. Signal (white) in the middle pin. Voltage and ground on the side pins.

![3d_printing_wmy-pot-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/306/medium640/3d_printing_wmy-pot-solder.jpg?1584147295)

## Test JST Connection

Double check the wires and cross reference the circuit diagram.

![3d_printing_wmy-pot-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/307/medium640/3d_printing_wmy-pot-wired.jpg?1584147314)

## Center Potentiometer

Turn the knob so the white marker is centered with the middle pin.

![3d_printing_wmy-pot-center.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/308/medium640/3d_printing_wmy-pot-center.jpg?1584147336)

## Install Potentiometer

Press fit the knob on the potentiometer into the whammy wheel. Check the orientation of the pins are facing up.

![3d_printing_wmy-pot-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/309/medium640/3d_printing_wmy-pot-install.jpg?1584147354)

## Spring Tension

The tension in the spring needs to be tight in order for the wheel to snap back to the center. Using needle nose pliers can help assist in bending the loops so the spring tension is tighter.

![3d_printing_wmy-spring-tension.gif](https://cdn-learn.adafruit.com/assets/assets/000/089/314/medium640thumb/3d_printing_wmy-spring-tension.jpg?1584153033)

## Whammy Body Parts

The whammy assembly requires 4x M3 x 6mm screws and 4x M3 hex nuts. The two mounting brackets ( **wmy-plate-idler.stl** and **wmy-plate-pot.stl** ) will need to be secured and fastened to the bottom half of the body.

![3d_printing_wmy-body-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/310/medium640/3d_printing_wmy-body-screws.jpg?1584147375)

## Install Whammy Idler

Insert 2x M3 x 6mm through the bottom of the guitar. Place the **wmy-plate-idler.stl** over the two screw threads. Insert and fasten 2x M3 hex nuts to secure the part to the body of the guitar.

![3d_printing_wmy-idler-secure.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/311/medium640/3d_printing_wmy-idler-secure.jpg?1584147394)

## Install Wheel to Body

Insert the remaining 2x M3 x 6mm screws into the mounting holes on the guitar. Place the wheel sub-assembly in the body of the guitar. Insert the cylinder from the **wmy-wheel-pot.stl** part into the hole in the center of the **wmy-plate-idler.stl**.&nbsp;

![3d_printing_wmpy-wheel-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/312/medium640/3d_printing_wmpy-wheel-install.jpg?1584147429)

## Whammy Assembled

Test out the check the whammy bar mechanism by moving the wheel back and forth. The hex nuts should be nice and tight.&nbsp;

![3d_printing_wmy-body-assembled.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/313/medium640/3d_printing_wmy-body-assembled.jpg?1584147449)

# MX MIDI Guitar

## Wiring 8-Way Switch

## Wires for 8-way Switch

Get the wires ready for soldering to the 8-way selector switch. Use the following lengths to measure and cut the wires to size.

**Wire Lengths**

- 10-wire ribbon cable – 90mm
- 4-wire JST cable – 102mm

![3d_printing_8sw-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/316/medium640/3d_printing_8sw-wires.jpg?1584213254)

## Tin Ribbon Cable

Use wire stripper to remove insulation from the tips of each wire. Tin the exposed wire by adding a bit of solder.&nbsp;

![3d_printing_8sw-ribbon-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/317/medium640/3d_printing_8sw-ribbon-tin.jpg?1584214234)

## Ribbon Cable Wires

Repeat tinning on the other end of the ribbon cable. This helps prevent the strands of wire from fraying.

![3d_printing_8sw-ribbon-tinned.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/318/medium640/3d_printing_8sw-ribbon-tinned.jpg?1584214261)

## Tin JST Cable Wires

Use wire strippers to remove the tips from the 4-wire JST cable. Tin the strands of wire by adding a bit of solder.

![3d_printing_8sw-jst-cable-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/319/medium640/3d_printing_8sw-jst-cable-tin.jpg?1584214280)

## Tinned Wires

The cables are ready to wire up.

![3d_printing_8sw-wires-tinned.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/326/medium640/3d_printing_8sw-wires-tinned.jpg?1584214523)

## Connect 8-way Pins

Add pieces of heat shrink tubing to the wires before soldering. Solder eight of the ten wires from the ribbon cable to the pins on the rotary switch.

![3d_printing_8sw-pins-wire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/325/medium640/3d_printing_8sw-pins-wire.jpg?1584214450)

## Connect 8-way Ground

The single pin in the middle is the common ground. Solder the remaining two wires from the ribbon cable to the ground pin on the rotary switch.

![3d_printing_8sw-gnd-wire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/322/medium640/3d_printing_8sw-gnd-wire.jpg?1584214365)

## Attaching JST connectors to ribbon cable

Get the following JST male connectors ready to wire up to the ribbon cable.

![3d_printing_8sw-pins-wired-connectors.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/320/medium640/3d_printing_8sw-pins-wired-connectors.jpg?1584214303)

## Solder JST connectors

Solder four of the wires from the rotary switch to one of the 4-pin JST male connectors. Add pieces of heat shrink tubing to the wires before soldering.

![3d_printing_8sw-jst-wiring.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/321/medium640/3d_printing_8sw-jst-wiring.jpg?1584214330)

## Wired 8-way switch

Repeat this process for the other 4-pin JST male connector. Solder the two ground wires from the rotary switch to the 2-pin JST male connector.

![3d_printing_8sw-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/323/medium640/3d_printing_8sw-wired.jpg?1584214387)

# MX MIDI Guitar

## Wiring Pots

## Wires for Potentiometers

Get the ribbon cable, JST cables and connectors ready to wire up to the potentiometers. Use the following wire lengths.

- 2x 3-pin JST cables – 80mm
- 6-wire ribbon cable – 126mm

![3d_printing_pots-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/328/medium640/3d_printing_pots-wires.jpg?1584214781)

## Tin Ribbon Cable Wires

Use wire stripper to remove a bit of insulation from each of the wires. Tin the strands of wire by adding a bit of solder.

![3d_printing_pots-ribbon-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/327/medium640/3d_printing_pots-ribbon-tin.jpg?1584214756)

## Solder JST Connectors

Tin the pins on the JST connectors by adding a bit of solder. Add pieces of heat shrink tubing to three of the six wires from the ribbon cable. Attach the three wires to the 3-pin JST male connector.

![3d_printing_pots-wire-jst.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/329/medium640/3d_printing_pots-wire-jst.jpg?1584214814)

## Wired 3-pin JST Connectors

Repeat this process for the last three wires.

![3d_printing_pots-jst-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/330/medium640/3d_printing_pots-jst-wired.jpg?1584214833)

## Wire Potentiometers&nbsp;

Connect three from the ribbon cable to the pins on the potentiometer. Add pieces of heat shrink tubing before soldering. Follow the order of the colors to get the correct polarity.

- White – Middle Pin
- Red/Black – Side Pin

![3d_printing_pot-solder-pins.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/331/medium640/3d_printing_pot-solder-pins.jpg?1584214850)

## Wired Potentiometers

Repeat this process for the second potentiometer.

![3d_printing_pots-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/332/medium640/3d_printing_pots-wired.jpg?1584214868)

# MX MIDI Guitar

## Wiring Toggle Switches

## Toggle Switch Wires

Get the cables, wires and connectors ready for the toggle switches. Use the following wire lengths for the 2x 2-pin JST cable and 4-wire ribbon cable.

**Wires Lengths**

- 4-wire ribbon cable – 98mm
- 2-wire JST cables – 66mm

![3d_printing_tswitch-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/333/medium640/3d_printing_tswitch-wires.jpg?1584226742)

## Tin Toggle Switch Wires

Use wire strippers to remove a bit of insulation from the tips of each wire. Tin the strands of wire by adding a bit of solder.

![3d_printing_tswitch-wires-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/334/medium640/3d_printing_tswitch-wires-tin.jpg?1584226757)

## 2-pin JST Connectors

Tin the pins on both of the 2-pin JST connectors by adding a bit of solder.

![3d_printing_tswitch-ribbon-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/335/medium640/3d_printing_tswitch-ribbon-tin.jpg?1584226771)

## Solder 2-pin JST wires

Wire up two of the four wires from the ribbon cable to one of the 2-pin JST male connectors. Be sure to add pieces of heat shrink tubing before soldering.

![3d_printing_tswitch-2jst-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/336/medium640/3d_printing_tswitch-2jst-solder.jpg?1584226790)

## Wired 2-pin JST

Repeat this process for the second 2-pin JST male connector.

![3d_printing_tswitch-2jst-wiring.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/337/medium640/3d_printing_tswitch-2jst-wiring.jpg?1584226813)

## Solder Toggle Switch Pins

Attach the ribbon wires to the middle and side pins of the toggle switch. Be sure to add pieces of heat shrink tubing before soldering.

![3d_printing_tswitch-ribbon-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/338/medium640/3d_printing_tswitch-ribbon-solder.jpg?1584226829)

## Wired Toggle Switches

Repeat this process for the second toggle switch.

![3d_printing_tswitch-ribbon-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/339/medium640/3d_printing_tswitch-ribbon-wired.jpg?1584226852)

## Tin 2-pin JST cables

Use wire strippers to remove insulation from the tips of the wires. Tin the strands of wire by adding a bit of solder.

![3d_printing_tswitch-2jst-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/341/medium640/3d_printing_tswitch-2jst-tin.jpg?1584226895)

## Wired Toggle Switch Cables

Repeat this process for the second 2-pin JST cable. Double check the wiring for solid solder joints.

![3d_printing_tswitch-2jst-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/340/medium640/3d_printing_tswitch-2jst-wired.jpg?1584226869)

# MX MIDI Guitar

## Wiring Perma-Proto

## Perma-Proto Power Rails

A piece of perma-proto can be useful for extended the voltage and ground pins. Use a rotary power tool to cut the power rails from the quarter size perma-proto PCB – Use a vice to lock down the PCB to a tabletop. Use a shop vac to capture the dust.&nbsp;

![3d_printing_perma-cutoff.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/342/medium640/3d_printing_perma-cutoff.jpg?1584226930)

## 2-wire ribbon cable

Use a 2-wire ribbon cable to connect the power and ground pins.

**Wire Lengths**

- 2-wire ribbon cable – 52mm

![3d_printing_perma-wire-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/343/medium640/3d_printing_perma-wire-tin.jpg?1584226943)

## Solder Wires to Pins

Solder the wires to the voltage and ground on the PCB.

![3d_printing_perma-wiring.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/344/medium640/3d_printing_perma-wiring.jpg?1584226995)

## Wired Perma-Proto Power Rails

This will be wired to the power and ground pins on the Adafruit Grand Central M4.

![3d_printing_perma-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/345/medium640/3d_printing_perma-wired.jpg?1584227049)

# MX MIDI Guitar

## Wiring The LIS3DH

## Wires for LIS3DH

Get the wires ready for the LIS3DH breakout board. Use the following wire lengths.

- 4-pin JST cable – 116m
- 4-wire ribbon cable - 250mm

![3d_printing_lis3dh-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/364/medium640/3d_printing_lis3dh-wires.jpg?1584317927)

## Tin Ribbon Cable Wires

Use wire strippers to remove insulation from the tips of each wire. Tin the exposed wire using a bit of solder.&nbsp;

![3d_printing_lis3dh-ribbon-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/365/medium640/3d_printing_lis3dh-ribbon-tin.jpg?1584317947)

## Tin 4-pin JST Cable

Use wire strippers to remove insulation from the tips of each wire in the 4-wire JST cable. Tin the strands of wire by adding a bit of solder.

![3d_printing_lis3dh-jst-cable-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/369/medium640/3d_printing_lis3dh-jst-cable-tin.jpg?1584318062)

## Solder Ribbon Wires

Connect the 4-pin male JST connector to the 4-pin JST cable. Attach the wires from the ribbon cable to the 4-pin JST male connector. Make sure to add pieces of heat shrink tubing before soldering.

![3d_printing_lis3dh-jstmale-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/366/medium640/3d_printing_lis3dh-jstmale-tin.jpg?1584317966)

## Solder LIS3DH Wires

Solder the wires from the ribbon cable to the pins on the LIS3DH breakout board. Reference pin outs and the colored wiring.

- Green Wire – SCL
- White Wire – SDA
- Red Wire – VIN
- Black Wire – GND

![3d_printing_lis3dh-wire-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/367/medium640/3d_printing_lis3dh-wire-solder.jpg?1584317990)

## Wired LIS3DH

The colored wires from the 4-pin JST cable should match the pinouts of the LIS3DH breakout.

![3d_printing_lis3dh-jst-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/368/medium640/3d_printing_lis3dh-jst-wired.jpg?1584318036)

# MX MIDI Guitar

## Wiring MX Switches

## Wires for MX Switches

Get the wires and Cherry MX switches ready. Use the following wire lengths.

**Wire Lengths**

- 3x 4-pin JST cable – 116mm
- 1x 2-pin JST cable – 116mm
- 2x 10-wire ribbon cable – 305mm

![3d_printing_mx-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/350/medium640/3d_printing_mx-wires.jpg?1584317403)

## Tin 4-wire JST cables

Use wire strippers to remove a bit of insulation from the tips of each wire from the 4-pin JST cable. Tin the strands of wire by adding a bit of solder.

![3d_printing_mx-4jst-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/351/medium640/3d_printing_mx-4jst-tin.jpg?1584317438)

## Tin 2-wire JST Cable

Use wire strippers to remove a bit of insulation from the tips of each wire in the 2-pin JST cable. Tin the strands of wire by adding a bit of solder.

![3d_printing_mx-2jst-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/352/medium640/3d_printing_mx-2jst-tin.jpg?1584317463)

## Tinned JST Cables

Repeat the tinning process for the remaining JST cables. Pieces of heat shrink tubing will keep the wires bundled together.

![3d_printing_mx-jst-tinned.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/353/medium640/3d_printing_mx-jst-tinned.jpg?1584317499)

## Plate for MX Switches

Get the **neck-top.stl** part ready to install the Cherry MX switches.

![3d_printing_mx-plate.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/354/medium640/3d_printing_mx-plate.jpg?1584317642)

## Installing MX Switches

Cherry MX switches are press fitted into the square holes through the top of the **neck-top.stl** part. The MX switches can be oriented in any orientation – Use the orientation with the most optimal placement for the wired connections.&nbsp;

![3d_printing_mx-sw-first-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/355/medium640/3d_printing_mx-sw-first-install.jpg?1584317666)

## Install MX Switches

The switches are placed so the pins are following a consistent orientation.&nbsp;

![3d_printing_mx-sw-plate-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/356/medium640/3d_printing_mx-sw-plate-install.jpg?1584317694)

## Installed MX Switches (Bottom View)

Double check the placement of the switches once they're all installed into the **neck-top.stl** part. If any of the switches are out of place, they can be "popped" out.

![3d_printing_mx-sw-plate-installed-bottom.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/357/medium640/3d_printing_mx-sw-plate-installed-bottom.jpg?1584317718)

## Installed MX Switches (Top View)

The top of the switches feature the **Cherry MX** embossed labeling. They can be used to visually see if they're all following in the same orientation. Note: a combination of "Blue" and "Silver" switches are used here unintentionally due to components on hand.&nbsp;

![3d_printing_mx-sw-plate-installed-top.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/358/medium640/3d_printing_mx-sw-plate-installed-top.jpg?1584317746)

## Wires from Shared Ground

Peel off a single wire from the 10-wire ribbon cable. This single wire is cut into several pieces that will be used to connect all of the ground pins together. The switches will share a common ground.

Each wire is about 35mm in length.

![3d_printing_mx-sw-gnd-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/362/medium640/3d_printing_mx-sw-gnd-wires.jpg?1584317846)

## Soldering Ground

Secure the **neck-top.stl** part so it's doesn't move around while soldering. A Panavise or third helping hands can be used. Tin one of pins on the first Cherry MX switch.&nbsp;

![3d_printing_mx-sw-gnd-solder-first.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/359/medium640/3d_printing_mx-sw-gnd-solder-first.jpg?1584317784)

## Shared Ground

The second Cherry MX switch has two wires soldered to the ground pin. The second wire will be connected to the third switch. A pair of tweezers can be helpful in handling the wires while soldering.

![3d_printing_mx-sw-gnd-2nd.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/370/medium640/3d_printing_mx-sw-gnd-2nd.jpg?1584365085)

## Ground Wired

Repeat this process for nine of the remaining Cherry MX switches. The last switch (the 12th) in the arrangement will need a third wire for connecting to the ground pins on the Adafruit Grand Central M4.

![3d_printing_mx-sw-gnd-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/361/medium640/3d_printing_mx-sw-gnd-wired.jpg?1584317825)

## Check Ground Wiring

Take a moment to inspect your wires to ensure the solder joints are solid.&nbsp;

![3d_printing_mx-sw-gnd-angle.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/371/medium640/3d_printing_mx-sw-gnd-angle.jpg?1584366733)

## Tin Longer Ground Wire

Measure and cut a 2-wire piece from the 10-wire ribbon cable. Use the following wire length.

- 2-wire ribbon cable – 117mm

![3d_printing_mx-gnd-wire-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/415/medium640/3d_printing_mx-gnd-wire-tin.jpg?1584451227)

## Solder JST Connector

Solder the 2-wire ribbon cable to the 2-pin male JST connector. Add pieces of heat shrink tubing before soldering

![3d_printing_mx-gnd-jst-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/416/medium640/3d_printing_mx-gnd-jst-solder.jpg?1584451249)

## Solder Last Ground MX Switch

Solder the 2-pin ribbon cable to the ground pin on the last mx switch.

![3d_printing_mx-sw-gnd-last-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/417/medium640/3d_printing_mx-sw-gnd-last-solder.jpg?1584451271)

## Wired JST Ground Cable

Double check the wiring in the MX switches.

![3d_printing_mx-sw-gnd-jst-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/418/medium640/3d_printing_mx-sw-gnd-jst-wired.jpg?1584451304)

## Wiring 4-pin JST Connectors

Split the 10-wire ribbon (305mm long) cable so there's 3x 4-wire ribbon cables. These will be used to solder to the 3x 4-pin JST connectors

![3d_printing_mx-ribbon-4jst-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/421/medium640/3d_printing_mx-ribbon-4jst-solder.jpg?1584451695)

## Tinning 4-pin JST Cables

Repeat this process for the remaining 4-pin JST cables.

![3d_printing_mx-4jst-cables-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/420/medium640/3d_printing_mx-4jst-cables-wired.jpg?1584451674)

## Wiring First Key

Wire up one of the 4-wire ribbon cables to the first MX switch.

![3d_printing_mx-sw-1st-key.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/419/medium640/3d_printing_mx-sw-1st-key.jpg?1584451648)

## 4 Keys Wired

Proceed to wire the next three MX switches. Note, the wires are shortened in length inline with the MX switches.

![3d_printing_mx-sw-4-keys.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/422/medium640/3d_printing_mx-sw-4-keys.jpg?1584451800)

## 8 Keys Wired

Proceed to solder the next 4-wire ribbon cable to four more MX switches. Follow the same process and shorten the wires per switch.

![3d_printing_mx-sw-8-keys.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/423/medium640/3d_printing_mx-sw-8-keys.jpg?1584451925)

## 12 Keys Wired

Proceed to wire the third 4-wire ribbon cable to the last remaining 4x MX switches.

![3d_printing_mx-sw-12-keys.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/424/medium640/3d_printing_mx-sw-12-keys.jpg?1584451963)

## Wired MX Switches

Thoroughly inspect the wires and double check all of the solder joints are solid.

![3d_printing_mx-switches-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/427/medium640/3d_printing_mx-switches-wired.jpg?1584452191)

## Group Wiring

The 3x ribbon cables are layered and bundled together. This keeps the wires nice and neat.

![3d_printing_mx-switches-wire-group.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/426/medium640/3d_printing_mx-switches-wire-group.jpg?1584452171)

# MX MIDI Guitar

## Wiring NeoPixel Feather

If you are installing the optional lighting for the neck of the guitar, follow the wiring below.

## Feather and NeoPixel Wires

Get the Feather, NeoPixel strip, slide switch and wires ready. Use the following wire lengths.

**Wire Lengths**

- 3-pin JST cable – 70mm
- 3-wire ribbon cable – 74mm
- 2-wire ribbon cable – 65mm

&nbsp;

![3d_printing_feather-neopixel-parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/428/medium640/3d_printing_feather-neopixel-parts.jpg?1584452279)

## Count, Cut and Unsheathe&nbsp;

This project is using a Mini Skinny NeoPixel strip with 144 pixels per meter. The NeoPixel LED strip will be hot glued to the head of the guitar. The following NeoPixel strip was used in this project.

- Mini Skinny NeoPixel Strip (144/m) – 35 NeoPixels

![3d_printing_strip-setup.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/429/medium640/3d_printing_strip-setup.jpg?1584452337)

## Tin 3-pin JST Cable

Use wire strippers to remove insulation from the tips of each wire. Tin the exposed wire using a bit of solder.&nbsp;

![3d_printing_strip-3jst-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/430/medium640/3d_printing_strip-3jst-tin.jpg?1584452691)

## Tin 3-wire ribbon cable

Use wire strippers to remove insulation from the tips of each wire. Tin the exposed wire using a bit of solder.&nbsp;

![3d_printing_strip-ribbon-tin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/431/medium640/3d_printing_strip-ribbon-tin.jpg?1584452714)

## Strip 3-pin JST cable solder

Solder the 3-pin JST cable to the NeoPixel strip. Check and find the first NeoPixel in the strip. Solder **white** wire to **data In** , **red** wire to **5V** and **black** wire to **ground**. Add pieces of heat shrink tubing before soldering connections.

![3d_printing_strip-jst-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/432/medium640/3d_printing_strip-jst-solder.jpg?1584452736)

## Feather 3-wire ribbon cable solder

Solder the 3-wire ribbon cable to the pins on the Feather. Follow the cable and match up the colored wires from the 3-pin jST cable. **White** wire to **Pin 5** , **black** wire to **ground** and **red** wire to **3V**.

![3d_printing_feather-ribbon-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/433/medium640/3d_printing_feather-ribbon-solder.jpg?1584452764)

## Solder Slide Switch Ribbon Cable

Solder a 2-wire ribbon cable to the slide switch. Use the middle pin and either pin on the side. Add pieces of heat shrink tubing before making wired connections.

![3d_printing_slidesw-ribbon-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/434/medium640/3d_printing_slidesw-ribbon-solder.jpg?1584452789)

## Solder Slide Switch to Feather

Solder slide switch ribbon cable to **EN** and **GND** pins on the Feather.

![3d_printing_slidesw-feather-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/435/medium640/3d_printing_slidesw-feather-solder.jpg?1584452810)

## Test Circuit

Connect a 500mAh battery to the JST battery port on the Feather. This project uses the [CircuitPython NeoPixel demo code](https://learn.adafruit.com/adafruit-neopixel-uberguide/python-circuitpython). Use the slide switch to turn the circuit on and off.

![3d_printing_feather-strip-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/436/medium640/3d_printing_feather-strip-wired.jpg?1584452825)

# MX MIDI Guitar

## Strip Assembly

## NeoPixel Strip for Head

Get the NeoPixel strip ready to install into the head of the guitar.

![3d_printing_head-strip.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/465/medium640/3d_printing_head-strip.jpg?1584458130)

## Install Strip to Head

Fit the NeoPixel strip into the head of the guitar. Insert the 3-pin JST cable through the hole – route cable to the neck. Carefully bend the strip so it follows the shape of the head. Use hot glue to secure the strip to the inner walls.

![3d_printing_head-strip-hotglue.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/466/medium640/3d_printing_head-strip-hotglue.jpg?1584458236)

## Install Feather Screws

Insert 4x M2.5 x 8mm screws into the mounting holes on the Feather PCB. Insert and fasten 4x M2.5 hex nuts. Note: longer (10mm) M2.5 screws were added due to hardware on hand – These can be cut short.

![3d_printing_feather-screws-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/467/medium640/3d_printing_feather-screws-install.jpg?1584458297)

## Installing Feather to Neck

Get the Feather ready to install into the mounting holes on the neck.

![3d_printing_feather-neck-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/468/medium640/3d_printing_feather-neck-install.jpg?1584458383)

## Secure Feather to Neck

Place the Feather into the neck and fit the threads of the screws through the mounting holes. Insert and fasten four M2.5 hex nuts onto the threads of the screws to secure Feather to neck.

![3d_printing_feather-neck-secure.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/469/medium640/3d_printing_feather-neck-secure.jpg?1584458477)

## Install Feather Slide Switch

Insert body of slide switch at an angle into the built-in switch holder.

![3d_printing_feather-sw-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/470/medium640/3d_printing_feather-sw-install.jpg?1584458540)

## Connect Strip to Feather

Connect the 3-pin JST cable from the strip to the 3-pin JST cable on the Feather.

![3d_printing_feather-jst-plug.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/471/medium640/3d_printing_feather-jst-plug.jpg?1584458585)

## Install Strip JST Wiring

Fit the JST cable in between the Feather PCB and inner walls of the neck. Tuck in the cable so it's nice and neat.

![3d_printing_feather-jst-tuck.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/472/medium640/3d_printing_feather-jst-tuck.jpg?1584458598)

# MX MIDI Guitar

## Install the LIS3DH

## Hardware for LIS3DH

Get the M2.5 x 8mm screws and M2.5 hex nuts ready for the LIS3DH.

![3d_printing_lis3dh-screws.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/473/medium640/3d_printing_lis3dh-screws.jpg?1584458699)

## Install LIS3DH Screws

Insert and install 2x M2.5 x 8mm screws into the mounting holes. Insert and fasten 2x M2.5 hex nuts on to the threads of the screws.

![3d_printing_lis3dh-screws-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/475/medium640/3d_printing_lis3dh-screws-installed.jpg?1584458894)

## Install LIS3DH to Neck

Place the LIS3DH into the neck of the guitar. Fit the thread of the screws through the two mounting holes on the neck of the guitar.

![3d_printing_lis3dh-neck-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/476/medium640/3d_printing_lis3dh-neck-install.jpg?1584458914)

## Secure LIS3DH to Neck

Insert and fasten 2x M2.5 hex nuts onto the threads of the screws.

![3d_printing_lis3dh-screws-secure.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/477/medium640/3d_printing_lis3dh-screws-secure.jpg?1584458939)

## Install Battery

Place the 500mAh battery into the neck of the guitar. Note: The battery cable is routed underneath the LIS3DH PCB for extra neatness.

![3d_printing_lis3dh-battery-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/478/medium640/3d_printing_lis3dh-battery-install.jpg?1584458959)

# MX MIDI Guitar

## Wiring the M4

## Grand Central M4 Wiring

Get the cables from the panel mounted components ready to wire into the Grand Central M4 Express. 2x toggle switches, 2x potentiometers, 8-way rotary switch and the perma-proto pcb. Use the following hardware.

- 8x M3 x 6mm screws
- 4x M3 x 20mm standoffs

![3d_printing_m4-wires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/437/medium640/3d_printing_m4-wires.jpg?1584454292)

## Install M3 Standoffs

Place an M3 screw through the mounting holes in each corner of the Grand Central M4 PCB. Insert and fasten the M3 standoffs onto the threads of the screws. Finger tighten all four standoffs.

![3d_printing_m4-standoffs.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/438/medium640/3d_printing_m4-standoffs.jpg?1584454404)

## Label JST Cables

Take a moment to label the JST cables. This will help connect components together once it's been installed into the body of the guitar. I used the following letters to reference these components.

- X – LIS3DH
- A,B,C – MX Switches
- P1, P2 – Potentiometers
- W – Potentiometer for Whammy&nbsp;
- 1-4, 5-8 – Rotary Switch
- S1, S2 – Toggle Switches

![3d_printing_m4-jst-labels.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/439/medium640/3d_printing_m4-jst-labels.jpg?1584454541)

## Wire Prema-Proto

Solder the perma-proto PCB to the ground and 3V pin on the Grand Central M4. Reference photo for best wire placement.

![3d_printing_m4-wire-perma.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/440/medium640/3d_printing_m4-wire-perma.jpg?1584454621)

## Wire Potentiometers

Solder the white wires from the 2x potentiometers to pin 2 and 3 on the Grand Central M4.

&nbsp;

![3d_printing_m4-wire-2pots.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/441/medium640/3d_printing_m4-wire-2pots.jpg?1584454715)

## Pots Ground and Voltage

Solder the voltage (red) and ground (black) wires to the pins on the perma-proto PCB.

![3d_printing_m4-pots-gnd-pwr.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/442/medium640/3d_printing_m4-pots-gnd-pwr.jpg?1584454733)

## Wire 8-Way Rotary Switch

Solder the eight wires from the rotary switch to the following pins on the Grand Central M4.

- 24-31

![3d_printing_m4-8sw-wire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/443/medium640/3d_printing_m4-8sw-wire.jpg?1584454961)

## Wire 8-Way Rotary Switch to Ground

Solder the 2-pin JST cable to the ground pins on the perma-proto.

![3d_printing_m4-8sw-gnd.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/444/medium640/3d_printing_m4-8sw-gnd.jpg?1584455035)

## Wire the LIS3DH

Solder the **green** wire to **SCL** on Grand Central M4. Solder the **white** wire to SDA on the Grand Central M4.

![3d_printing_m4-lis3dh-wire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/445/medium640/3d_printing_m4-lis3dh-wire.jpg?1584455125)

## Wire LIS3DH Ground and Voltage

Solder the ground and voltage wires to the ground and voltage pins on the perma-proto.

![3d_printing_m4-lis3dh-gnd.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/446/medium640/3d_printing_m4-lis3dh-gnd.jpg?1584455207)

## Wire Micro Switches (Strum)

Solder the 2-pin JST cables from the two micro switches to the following pins on the Grand Central M4.

- Pin 22
- Pin 23

![3d_printing_m4-strum-switches-wire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/447/medium640/3d_printing_m4-strum-switches-wire.jpg?1584455292)

## Wire MX Switches

Solder the 3x 4-pin JST cables from the MX switches to the following pins on the Grand Central M4.

- 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 14

![3d_printing_m4-mx-wiring.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/448/medium640/3d_printing_m4-mx-wiring.jpg?1584455374)

## M4 Wiring Mounted Components

Get the bottom half of the guitar body ready. The panel mounted components will be wired to the Grand Central M4.

![3d_printing_m4-guitar-bottom.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/449/medium640/3d_printing_m4-guitar-bottom.jpg?1584455490)

## M4 Wire Whammy Pot

Solder the white wire from whammy potentiometer to Pin #1 on the Grand Central M4.

![3d_printing_m4-wire-whammy.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/450/medium640/3d_printing_m4-wire-whammy.jpg?1584455594)

## Wire Whammy Ground and Voltage

Solder the ground and voltage wires from the whammy potentiometer to the ground and voltage pins on the perma-proto.

![3d_printing_m4-wire-whammy-gnd-pwr.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/451/medium640/3d_printing_m4-wire-whammy-gnd-pwr.jpg?1584455607)

## Wire Toggle Switches

Solder the 2-pin JST cables from the 2x toggle switches to the following pins on the Grand Central M4.

- Switch 1 – Pin #52
- Switch 2 – Pin #53

![3d_printing_m4-tswitch-wire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/452/medium640/3d_printing_m4-tswitch-wire.jpg?1584455799)

## Wire Toggle Switches Ground and Voltage

Solder the voltage and ground wires from the toggle switches to the voltage and ground pins on the perma-proto.

![3d_printing_m4-tswitch-gnd-pwr.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/453/medium640/3d_printing_m4-tswitch-gnd-pwr.jpg?1584455858)

## M4 Wiring Check Point

Take a moment to thoroughly inspect the wiring.

![3d_printing_m4-checkwires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/454/medium640/3d_printing_m4-checkwires.jpg?1584455944)

## Unplug Components

Begin to disconnect the various JST connectors. The components will need to be unplugged in order to install the Grand Central M4 into the body of the guitar.

![3d_printing_m4-comps-unplug.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/455/medium640/3d_printing_m4-comps-unplug.jpg?1584456126)

# MX MIDI Guitar

## Panel Mount Components

## Panel Mounting Components

Get the components ready to panel mount onto the top half of the guitar body.

![3d_printing_top-comps-installing.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/479/medium640/3d_printing_top-comps-installing.jpg?1584459093)

## Install 8-way switch and toggle switches

Panel mount the 8-way rotary switch and two toggle switches. Use the included hardware to secure the components. Reference the photo for correct placement.

![3d_printing_top-tsw-8sw-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/480/medium640/3d_printing_top-tsw-8sw-installed.jpg?1584459162)

## Install 2x Potentiometers

Panel mount the two potentiometers. Use the included hardware to secure the components. Reference the photo for correct placement.

![3d_printing_top-pots-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/481/medium640/3d_printing_top-pots-installed.jpg?1584459217)

## Panel Mounted Components

Double check the components are installed correctly. Double check all of the hardware has been tightly fastened.

![3d_printing_top-comps-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/482/medium640/3d_printing_top-comps-installed.jpg?1584459278)

# MX MIDI Guitar

## Assemble Grand Central

## Install Grand Central M4

Place the Grand Central M4 PCB into the bottom half of the guitar. Reference the photo for correct placement.

![3d_printing_m4-install-pcb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/456/medium640/3d_printing_m4-install-pcb.jpg?1584457469)

## Secure Grand Central M4

Line up standoffs with mounting holes. Insert and fasten 4x M3 x 6mm screws into the bottom half of the guitar. Fasten tightly.

![3d_printing_m4-secure-pcb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/457/medium640/3d_printing_m4-secure-pcb.jpg?1584457524)

## Connect Micro Switches for Strum

Reconnect the JST cables from the two micro switches.

![3d_printing_m4-connect-strum-sw.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/458/medium640/3d_printing_m4-connect-strum-sw.jpg?1584457635)

## Connect Whammy

Reconnect the JST cable from the whammy potentiometer.

![3d_printing_m4-connect-wmy.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/459/medium640/3d_printing_m4-connect-wmy.jpg?1584457698)

## Installing micro USB Extension

Get the microUSB extension cable ready to connect and panel mount.

![3d_printing_usb-cable-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/483/medium640/3d_printing_usb-cable-install.jpg?1584459694)

## Secure USB Cable

Use included hardware to panel mount the USB cable to the side of the guitar.

![3d_printing_usb-cable-secure.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/485/medium640/3d_printing_usb-cable-secure.jpg?1584459769)

## Installed USB Extension

Connect micro USB cable to the USB port on the Grand Central M4. Reference photo for best placement of the USB extension cable.

![3d_printing_usb-cable-insatlled.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/484/medium640/3d_printing_usb-cable-insatlled.jpg?1584459751)

# MX MIDI Guitar

## Final Assembly

## Install the Neck Cover

Get the neck cover with MX switches ready to install into the neck of the guitar. Orient the neck cover using the photo to reference correct placement.

![3d_printing_neck-top-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/488/medium640/3d_printing_neck-top-install.jpg?1584459985)

## Snap Fit Neck Cover

Insert and pass JST cables through the hole in neck of the guitar. Firmly press cover into neck to snap fit shut. Ensure all of the wires are inside the neck.

![3d_printing_neck-top-close.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/490/medium640/3d_printing_neck-top-close.jpg?1584460188)

## Snap Fit Head Cover

Install the LED cover into the head of the guitar. Firmly press cover into head to snap fit shut.

![3d_printing_head-closeit.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/491/medium640/3d_printing_head-closeit.jpg?1584460256)

## Test NeoPixel Strip

Power on NeoPixel strip to test out diffusion in the head cover. Black LED acrylic is pretty amazing!

![3d_printing_head-strip-test.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/492/medium640/3d_printing_head-strip-test.jpg?1584460361)

## Make Connections

Take a moment to connect the rest of the components. This is where labeling your wires comes in handy!

![3d_printing_connect-everything.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/489/medium640/3d_printing_connect-everything.jpg?1584460043)

## Install Keycaps

Get the key caps ready to install onto the 12 MX switches. Note, only narrow shaped key caps will fit. Spacing between switches is short.

![3d_printing_keycaps-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/493/medium640/3d_printing_keycaps-install.jpg?1584460430)

## Installed Keycaps

Key caps are press fitted onto MX switches actuators (+). Test key caps by pressing them. If they're getting stuck pressed down, try using different keys or even sand the edges.

![3d_printing_keycaps-installed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/494/medium640/3d_printing_keycaps-installed.jpg?1584460527)

## Check Connections

Take a moment to thoroughly inspect the connections.&nbsp;

![3d_printing_connections-check.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/495/medium640/3d_printing_connections-check.jpg?1584460584)

## Closing the Guitar Body

Gently begin to close up the guitar body by bring the two halves together. Check and ensure all of the wires and cables are fitted inside the body of the guitar. You need to ensure wires are not caught between the halves of the body, which might cause intermittent operation.

![3d_printing_body-closing-1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/507/medium640/3d_printing_body-closing-1.jpg?1584463463)

## Closing the Guitar (Continued)

The cables and connectors will need to be layered and flattened nicely in order for the two halves to close properly. This may take a few attempts to get right. Thoroughly check how the wires are routed and position them so they're laying flat. Press the two halves together to snap fit them shut.

![3d_printing_body-closing-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/508/medium640/3d_printing_body-closing-2.jpg?1584463483)

## Install the Whammy Bar

Insert the threaded end of the whammy bar into the hole in the center of the whammy wheel. Twist to fasten and screw the bar into the wheel until it's in a preferred position.

![3d_printing_wmy-bar-install.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/496/medium640/3d_printing_wmy-bar-install.jpg?1584460640)

## Install Knob for 8-way switch

Optionally install the selector knob onto the 8-way rotary switch.

![3d_printing_install-knob-8way.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/497/medium640/3d_printing_install-knob-8way.jpg?1584460741)

## Secure Knob for 8-way switch

The knob features a grub screw to secure onto the 8-way rotary selector switch. Place knob over tip of selector switch and press down. Use a small flat head screwdriver to tighten the grub screw.

![3d_printing_secure-knob-8way.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/498/medium640/3d_printing_secure-knob-8way.jpg?1584460819)

## Installed Knob for 8-way switch

This knob has a nice shape for handling and features a line mark to note its position.

![3d_printing_installed-knob-8way.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/499/medium640/3d_printing_installed-knob-8way.jpg?1584460837)

## Install Knobs for Potentiometers

Optionally install knobs onto the two potentiometers. Use the built-in grub screws to secure knobs onto the tips of each pot.

![3d_printing_install-knob-pots.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/500/medium640/3d_printing_install-knob-pots.jpg?1584460982)

## Secured Knobs for Potentiometers

These knobs appear to be ideal for guitar amps. Labels numbers 1-11 are noted on knobs.

![3d_printing_installed-knob-pots.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/501/medium640/3d_printing_installed-knob-pots.jpg?1584461014)

## Final Build

And there we have it! Take a moment to test out the various components. Twist some knobs, press some buttons, bend some pitches and strum the pick.

![3d_printing_final-build.jpg](https://cdn-learn.adafruit.com/assets/assets/000/089/502/medium640/3d_printing_final-build.jpg?1584461028)

# MX MIDI Guitar

## Let's Jam!

With your MX MIDI Guitar all assembled, you're ready to rock! You can use it with any software that allows MIDI input. Most commonly, you'll use a MIDI controller with music production software such as Reason, Garage Band, FL Studio, Ableton Live, etc.

You could use the guitar for recording your own music with MIDI or for playing live. With the strum bar you can play in a really unique way that isn't possible with regular synthesizers that use a standard keyboard for note input. In a live situation, the added control of the accelerometer in the neck opens up a world of possibilities.&nbsp;

https://diode.zone/videos/watch/e3e7a26b-0e78-4fb6-87eb-88dc5a131d30


## Featured Products

### Adafruit Grand Central M4 Express featuring SAMD51

[Adafruit Grand Central M4 Express featuring SAMD51](https://www.adafruit.com/product/4084)
Are you ready? Really ready? Cause here comes the **Adafruit Grand Central** featuring the **Microchip ATSAMD51**. This dev board is so big, it's not named after a Metro train, it's a whole freakin' _station_!

This board is like a freight...

In Stock
[Buy Now](https://www.adafruit.com/product/4084)
[Related Guides to the Product](https://learn.adafruit.com/products/4084/guides)
### Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)

[Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)](https://www.adafruit.com/product/2809)
The **LIS3DH** &nbsp;is a very popular low power **triple-axis accelerometer**. It's low-cost, but has just about every 'extra' you'd want in an accelerometer:

- Three axis sensing, 10-bit...

In Stock
[Buy Now](https://www.adafruit.com/product/2809)
[Related Guides to the Product](https://learn.adafruit.com/products/2809/guides)
### Adafruit Perma-Proto Quarter-sized Breadboard PCB - Single

[Adafruit Perma-Proto Quarter-sized Breadboard PCB - Single](https://www.adafruit.com/product/1608)
Customers have asked us to carry basic perf-board, but we never liked the look of most basic perf: it's always crummy quality, with pads that flake off and no labeling. Then we thought about how people **actually** prototype - usually starting with a solderless breadboard and...

In Stock
[Buy Now](https://www.adafruit.com/product/1608)
[Related Guides to the Product](https://learn.adafruit.com/products/1608/guides)
### Mini 8-Way Rotary Selector Switch - SP8T

[Mini 8-Way Rotary Selector Switch - SP8T](https://www.adafruit.com/product/2925)
When you need _a lot_ of options, you need a **Mini 8-Way Rotary Selector Switch**. This is basically a single-pole to 8-throw switch. As you rotate the knob around, the middle pin will make contact with each of the outer pins. Rotary switches are very simple to use and are...

In Stock
[Buy Now](https://www.adafruit.com/product/2925)
[Related Guides to the Product](https://learn.adafruit.com/products/2925/guides)
### Potentiometer with Built In Knob - 10K ohm

[Potentiometer with Built In Knob - 10K ohm](https://www.adafruit.com/product/4133)
_Oh say can you see_  
_By the knob's early light..._

Sorry - we thought that was clever. &nbsp;And while it wasn't really, this potentiometer definitely is! We've seen these in miniature synthesizers. They're bigger than a trim-pot but smaller than a...

In Stock
[Buy Now](https://www.adafruit.com/product/4133)
[Related Guides to the Product](https://learn.adafruit.com/products/4133/guides)
### Panel Mount 10K potentiometer (Breadboard Friendly)

[Panel Mount 10K potentiometer (Breadboard Friendly)](https://www.adafruit.com/product/562)
This potentiometer is a two-in-one, good in a breadboard or with a panel. It's a fairly standard linear taper 10K ohm potentiometer, with a grippy shaft. It's smooth and easy to turn, but not so loose that it will shift on its own. We like this one because the legs are 0.2" apart...

In Stock
[Buy Now](https://www.adafruit.com/product/562)
[Related Guides to the Product](https://learn.adafruit.com/products/562/guides)
### Mini Panel Mount SPDT Toggle Switch

[Mini Panel Mount SPDT Toggle Switch](https://www.adafruit.com/product/3221)
This or that, one or the other, perhaps or perhaps not! So hard to make decisions these days without feeling like you're just going back and forth constantly. Deciding whether or not to use this mini toggle switch? That's the easiest decision you'll make all day!

This...

In Stock
[Buy Now](https://www.adafruit.com/product/3221)
[Related Guides to the Product](https://learn.adafruit.com/products/3221/guides)
### Micro Switch w/Lever - 2 Terminal

[Micro Switch w/Lever - 2 Terminal](https://www.adafruit.com/product/818)
Micro-switches are often found in arcade buttons and joysticks but they're also really handy in any kind of mechatronics project or when you need a basic sensor. They are always 'tactile' (clicky feeling), and 'momentary' (the switch closes when pressed, then snaps open...

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

## Related Guides

- [RGB LED Matrix Cube with 25,000 LEDs](https://learn.adafruit.com/rgb-led-matrix-cube-for-pi.md)
- [Ninja Timer: Giant 7-Segment Display](https://learn.adafruit.com/ninja-timer-giant-7-segment-display.md)
- [Pulse Room](https://learn.adafruit.com/pulse-room.md)
- [Raspberry Pi LED Matrix Sand Toy](https://learn.adafruit.com/matrix-led-sand.md)
- [LED Trampoline](https://learn.adafruit.com/led-trampoline.md)
- [DotStar Pi Painter](https://learn.adafruit.com/dotstar-pi-painter.md)
- [Mindfulness Clock OF DOOM](https://learn.adafruit.com/mindfulness-clock-of-doom.md)
- [NeoPixel 60 Ring Wall Clock](https://learn.adafruit.com/neopixel-60-ring-clock.md)
- [Owl IR TV Remote](https://learn.adafruit.com/owl-ir-tv-remote.md)
- [Guardian Robot – Zelda BOTW](https://learn.adafruit.com/guardian-robot-zelda-botw.md)
- [Melting Picture Frame for PyPortal IoT images](https://learn.adafruit.com/pyportal-art-display.md)
- [3D Printed Frankenstein Monster with NeoPixel Eyes](https://learn.adafruit.com/neopixel-frankenstein.md)
- [Tiny LED WiFi Companion Cube](https://learn.adafruit.com/tiny-led-wifi-cube.md)
- [Use circup to easily keep your CircuitPython libraries up to date](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup.md)
- [Make It Shake, Rattle, and Roll: Accelerometer Use](https://learn.adafruit.com/make-it-shake-rattle-and-roll.md)
