# USB MIDI Keyset Controller

## Overview

https://youtu.be/htniGNKc7W0

![A 3D printed MIDI controller with keys and knobs connected to a mobile phone running musical software](https://cdn-learn.adafruit.com/assets/assets/000/138/990/medium800/3d_printing_hero-mobile.jpg?1755099609 MIDI keyset controller powered by a KB2040 using CircuitPython)

Build a 3D printed USB MIDI controller that features keyset style switches, potentiometers, a rotary encoder, and an OLED DISPLAY using CircuitPython code powered by the Adafruit KB2040.&nbsp;

The OLED features a GUI that allows customization of MIDI notes, velocity, channel, and MIDI CC messages. Five CHOC key switches are used to trigger MIDI notes, and the potentiometers can adjust modulation and LFOs.

## Intuitive GUI

On the main screen, the MIDI notes and potentiometer values are overlaid on shapes that represent their components.

The rotary encoder can be used to select and edit the potentiometers or the keys. In the edit mode, you can change MIDI notes, MIDI CC, MIDI channel, velocity, and minimum/maximum range.&nbsp;

![GUI demo of MIDI Keyset project](https://cdn-learn.adafruit.com/assets/assets/000/139/036/medium640thumb/3d_printing_GUI-demo.jpg?1755029000)

## Inspired Design

The enclosure design is inspired by our&nbsp;[DIY USB keyset project](https://learn.adafruit.com/usb-keyset) that features similar hinged keys. The shape of the device felt like a vintage synthesizer, so we thought we'd reimagine the keyset as a MIDI controller.

![](https://cdn-learn.adafruit.com/assets/assets/000/139/061/medium640/3d_printing_final-2.jpg?1755096748)

# Parts
Featured
### Adafruit KB2040 - RP2040 Kee Boar Driver

[Adafruit KB2040 - RP2040 Kee Boar Driver](https://www.adafruit.com/product/5302)
A wild Kee Boar appears! It’s a shiny **KB2040**! An Arduino Pro Micro-shaped board for Keebs with RP2040. (#keeblife 4 evah) A lot of folks like using Adafruit parts for their Keeb builds – but with the ItsyBitsy not being pin-compatible with the Pro Micro pinout, it...

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

Featured
### Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic

[Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic](https://www.adafruit.com/product/938)
These displays are small, only about 1.3" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x64 individual white OLED pixels, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is...

In Stock
[Buy Now](https://www.adafruit.com/product/938)
[Related Guides to the Product](https://learn.adafruit.com/products/938/guides)
![Monochrome 1.3" OLED module with Adafruit logos falling like snow](https://cdn-shop.adafruit.com/product-videos/640x480/938-05.jpg)

Featured
### Rotary Encoder + Extras

[Rotary Encoder + Extras](https://www.adafruit.com/product/377)
This rotary encoder is the best of the best, it's a high-quality 24-pulse encoder, with detents and a nice feel. It is panel mountable for placement in a box, or you can plug it into a breadboard (just cut/bend the two mechanical side tabs.) We also include a nice soft-touch knob with an...

In Stock
[Buy Now](https://www.adafruit.com/product/377)
[Related Guides to the Product](https://learn.adafruit.com/products/377/guides)
![Rotary Encoder with rubbery knob](https://cdn-shop.adafruit.com/640x480/377-02.jpg)

Featured
### Kailh CHOC Low Profile White Clicky Key Switches

[Kailh CHOC Low Profile White Clicky Key Switches](https://www.adafruit.com/product/5114)
For crafting your very own custom keyboard, these **&nbsp;Kailh Choc Low Profile Clicky White&nbsp;mechanical key switches** &nbsp;are super slim, with ultra-low profile compared to MX compatible switches!

Please note these are&nbsp; **NOT MX...**

Out of Stock
[Buy Now](https://www.adafruit.com/product/5114)
[Related Guides to the Product](https://learn.adafruit.com/products/5114/guides)
![Angled shot of ten white Kailh Choc V1 keycaps.](https://cdn-shop.adafruit.com/640x480/5114-00.jpg)

**Three (3) of each:**

Featured
### 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...

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

 **Also:**

### White Micro Potentiometer Knob - 4 pack

[White Micro Potentiometer Knob - 4 pack](https://www.adafruit.com/product/5538)
Have you found yourself in a maze of twisty-turny knobs, all alike? These micro potentiometer&nbsp;(or rotary encoder) knobs offer a rainbow burst of color to your synth or control panel. They are made of a hard plastic, with a grippy star shape. The shape is sometimes referred to as...

In Stock
[Buy Now](https://www.adafruit.com/product/5538)
[Related Guides to the Product](https://learn.adafruit.com/products/5538/guides)
![Angled shot of four white micro knobs.](https://cdn-shop.adafruit.com/640x480/5538-00.jpg)

### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
![Angled shot of STEMMA QT / Qwiic JST SH 4-pin Cable.](https://cdn-shop.adafruit.com/640x480/4210-00.jpg)

### Blue USB Type C to USB A Cable with 540 Degree Rotating End

[Blue USB Type C to USB A Cable with 540 Degree Rotating End](https://www.adafruit.com/product/6278)
Some days we're feeling extra fancy here at the 'fruit warehouse, and we have a big soft spot for colorful&nbsp;cables that make our projects look like Transformers. Like, peep [this fully reversible pink/purple Blinka-inspired cable](https://www.adafruit.com/product/4111)....

Out of Stock
[Buy Now](https://www.adafruit.com/product/6278)
[Related Guides to the Product](https://learn.adafruit.com/products/6278/guides)
![Angled Shot of the Blue USB Type C to USB A Cable with 540 Degree Rotating End 1m.](https://cdn-shop.adafruit.com/640x480/6278-07.jpg)

### Switch Sockets for Kailh CHOC Compatible Keys - 10 Pack

[Switch Sockets for Kailh CHOC Compatible Keys - 10 Pack](https://www.adafruit.com/product/5118)
Back in _my_ day, if you wanted to make a mechanical keyboard, you had to solder in expensive key switches onto your PCB - and woe to the person who decided they wanted to change their linear keys instead of clicky ones! Bah humbug, kids these days have no idea, what with their...

In Stock
[Buy Now](https://www.adafruit.com/product/5118)
[Related Guides to the Product](https://learn.adafruit.com/products/5118/guides)
![Angled shot of ten Choc switch sockets.](https://cdn-shop.adafruit.com/640x480/5118-00.jpg)

### Silicone Cover Stranded-Core Wire - 50ft 30AWG Red

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

In Stock
[Buy Now](https://www.adafruit.com/product/3165)
[Related Guides to the Product](https://learn.adafruit.com/products/3165/guides)
![A spool of light red AWG wire.](https://cdn-shop.adafruit.com/640x480/3165-01.jpg)

### Silicone Cover Stranded-Core Wire - 50ft 30AWG Blue

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

In Stock
[Buy Now](https://www.adafruit.com/product/3166)
[Related Guides to the Product](https://learn.adafruit.com/products/3166/guides)
![A spool of light blue AWG wire.](https://cdn-shop.adafruit.com/640x480/3166-01.jpg)

### Silicone Cover Stranded-Core Wire - 50ft 30AWG Black

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

In Stock
[Buy Now](https://www.adafruit.com/product/3164)
[Related Guides to the Product](https://learn.adafruit.com/products/3164/guides)
![A spool of black AWG wire.](https://cdn-shop.adafruit.com/640x480/3164-01.jpg)

### Silicone Cover Stranded-Core Wire - 50ft 30AWG Yellow

[Silicone Cover Stranded-Core Wire - 50ft 30AWG Yellow](https://www.adafruit.com/product/3167)
//www.youtube.com/embed/W85OajXuDRA
?start=10

Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps...

In Stock
[Buy Now](https://www.adafruit.com/product/3167)
[Related Guides to the Product](https://learn.adafruit.com/products/3167/guides)
![A spool of yellow AWG wire.](https://cdn-shop.adafruit.com/640x480/3167-01.jpg)

### Silicone Cover Stranded-Core Wire - 50ft 30AWG Green

[Silicone Cover Stranded-Core Wire - 50ft 30AWG Green](https://www.adafruit.com/product/3168)
//www.youtube.com/embed/W85OajXuDRA
?start=10

Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps...

In Stock
[Buy Now](https://www.adafruit.com/product/3168)
[Related Guides to the Product](https://learn.adafruit.com/products/3168/guides)
![A spool of sea green AWG wire.](https://cdn-shop.adafruit.com/640x480/3168-01.jpg)

### Silicone Cover Stranded-Core Wire - 50ft 30AWG White

[Silicone Cover Stranded-Core Wire - 50ft 30AWG White](https://www.adafruit.com/product/3169)
//www.youtube.com/embed/W85OajXuDRA
?start=10

Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps...

In Stock
[Buy Now](https://www.adafruit.com/product/3169)
[Related Guides to the Product](https://learn.adafruit.com/products/3169/guides)
![A spool of white AWG wire.](https://cdn-shop.adafruit.com/640x480/3169-01.jpg)

## Hardware

The following fasteners are required for the assembly of the 3D printed enclosure.

- 4x M2.5 x 6mm long steel machine screws
- 7x M3 x 6mm long steel machine screws

- [Next Page](https://learn.adafruit.com/midi-keyset/circuit-diagram.md)

## Guide Products

### Adafruit KB2040 - RP2040 Kee Boar Driver

[Adafruit KB2040 - RP2040 Kee Boar Driver](https://www.adafruit.com/product/5302)
A wild Kee Boar appears! It’s a shiny **KB2040**! An Arduino Pro Micro-shaped board for Keebs with RP2040. (#keeblife 4 evah) A lot of folks like using Adafruit parts for their Keeb builds – but with the ItsyBitsy not being pin-compatible with the Pro Micro pinout, it...

In Stock
[Buy Now](https://www.adafruit.com/product/5302)
[Related Guides to the Product](https://learn.adafruit.com/products/5302/guides)
### Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic

[Monochrome 1.3" 128x64 OLED graphic display - STEMMA QT / Qwiic](https://www.adafruit.com/product/938)
These displays are small, only about 1.3" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x64 individual white OLED pixels, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is...

In Stock
[Buy Now](https://www.adafruit.com/product/938)
[Related Guides to the Product](https://learn.adafruit.com/products/938/guides)
### Rotary Encoder + Extras

[Rotary Encoder + Extras](https://www.adafruit.com/product/377)
This rotary encoder is the best of the best, it's a high-quality 24-pulse encoder, with detents and a nice feel. It is panel mountable for placement in a box, or you can plug it into a breadboard (just cut/bend the two mechanical side tabs.) We also include a nice soft-touch knob with an...

In Stock
[Buy Now](https://www.adafruit.com/product/377)
[Related Guides to the Product](https://learn.adafruit.com/products/377/guides)
### Kailh CHOC Low Profile White Clicky Key Switches

[Kailh CHOC Low Profile White Clicky Key Switches](https://www.adafruit.com/product/5114)
For crafting your very own custom keyboard, these **&nbsp;Kailh Choc Low Profile Clicky White&nbsp;mechanical key switches** &nbsp;are super slim, with ultra-low profile compared to MX compatible switches!

Please note these are&nbsp; **NOT MX...**

Out of Stock
[Buy Now](https://www.adafruit.com/product/5114)
[Related Guides to the Product](https://learn.adafruit.com/products/5114/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...

Out of Stock
[Buy Now](https://www.adafruit.com/product/562)
[Related Guides to the Product](https://learn.adafruit.com/products/562/guides)
### White Micro Potentiometer Knob - 4 pack

[White Micro Potentiometer Knob - 4 pack](https://www.adafruit.com/product/5538)
Have you found yourself in a maze of twisty-turny knobs, all alike? These micro potentiometer&nbsp;(or rotary encoder) knobs offer a rainbow burst of color to your synth or control panel. They are made of a hard plastic, with a grippy star shape. The shape is sometimes referred to as...

In Stock
[Buy Now](https://www.adafruit.com/product/5538)
[Related Guides to the Product](https://learn.adafruit.com/products/5538/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
### Blue USB Type C to USB A Cable with 540 Degree Rotating End

[Blue USB Type C to USB A Cable with 540 Degree Rotating End](https://www.adafruit.com/product/6278)
Some days we're feeling extra fancy here at the 'fruit warehouse, and we have a big soft spot for colorful&nbsp;cables that make our projects look like Transformers. Like, peep [this fully reversible pink/purple Blinka-inspired cable](https://www.adafruit.com/product/4111)....

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

## Related Guides

- [Adafruit KB2040](https://learn.adafruit.com/adafruit-kb2040.md)
- [CircuitPython Trombone Champ Controller](https://learn.adafruit.com/circuitpython-trombone-champ-controller.md)
- [16-Step Drum Sequencer](https://learn.adafruit.com/16-step-drum-sequencer.md)
- [Rotary Phone Dial Keypad](https://learn.adafruit.com/rotary-phone-dial-keypad.md)
- [No-Code IoT Soil Sensor](https://learn.adafruit.com/soil-node.md)
- [QT Py Snap Fit Case](https://learn.adafruit.com/qt-py-snap-fit-case.md)
- [Tandy 1000 Keyboard to USB with CircuitPython](https://learn.adafruit.com/tandy-1000-keyboard-to-usb-with-circuitpython.md)
- [CNC Rotary Macropad](https://learn.adafruit.com/cnc-rotary-macropad.md)
- [Adafruit I2C Quad Rotary Encoder Breakout](https://learn.adafruit.com/adafruit-i2c-quad-rotary-encoder-breakout.md)
- [Arcade Synth Controller](https://learn.adafruit.com/arcade-synth-controller.md)
- [Color Spinner Camera Ring Light ](https://learn.adafruit.com/camera-ring-light-with-cpx.md)
- [LED Matrix Alarm Clock](https://learn.adafruit.com/led-matrix-alarm-clock.md)
- [Servo Boss](https://learn.adafruit.com/servo-boss.md)
- [Adafruit Fruit Jam](https://learn.adafruit.com/adafruit-fruit-jam.md)
- [Sketch Drawing Toy with CircuitPython](https://learn.adafruit.com/sketch-drawing-toy.md)
- [Adafruit CircuitPython Wii Classic Controller Library](https://learn.adafruit.com/adafruit-circuitpython-wii-classic-controller-library.md)
