Skip to content

Latest commit

 

History

History
100 lines (72 loc) · 3.95 KB

README.md

File metadata and controls

100 lines (72 loc) · 3.95 KB

MIDI Controller - Button Box Firmware

Here's the MIDI controller button box firmware for a Raspberry Pi Pico flashed with CircuitPython.

Firmware Installation

  1. Install CircuitPython v9.1 or greater onto your Pi Pico.

  2. In the lib/ folder on your device copy the following, CircuitPython Libraries,

    1. circuitpython_toml
    2. jled-circuitpython
    3. winterbloom_smolmidi (optionally compile with mpy-cross)

    You can install the first and second dependencies (not winterbloom_smolmidi) using the circup tool,

    circup install jled toml
    
  3. Copy all python (*.py) files in this folder on to your device.

  4. Reset the device. Upon first boot, you'll see the TOMATOBOX drive, and you can edit the newly generated settings.toml file to your liking.

NOTE: After resetting the device again, the TOMATOBOX drive will disappear. To boot the device into "debug" mode (and display the drive again), use the testing tool linked in the Development section of this document.

Configuration

Edit settings.toml and set the button and led pins to match your setup.

### Pins ###
button = "GP17"  # Pin number for button
led = "GP16"  # Pin number for LED

For additional settings, see settings.toml generated after you first install and reset your device.

Basic MIDI Protocol

Button Presses (Receive from Device)

Receive from the device change control on channel 1 (0xB0) with purpose byte general purpose #1 (0x10) with a value as defined below to register button presses,

Bytes Button Press State
0xB0 0x10 0x7F Pressed
0xB0 0x10 0x00 Released

LED Control (Send to Device)

Send to the device change control on channel 1 (0xB0) with purpose byte general purpose #2 (0x11) with a value as defined below to achieve the following LED control actions,

Bytes LED Control Action
0xB0 0x11 0x00 OFF
0xB0 0x11 0x01 ON (solid)
0xB0 0x11 0x02 Flash (period = 1.0 seconds)
0xB0 0x11 0x03 Pulsate SLOW (period = 2.25 seconds)
0xB0 0x11 0x04 Pulsate FAST (period = 0.6 seconds)

NOTE: The device will acknowledge a correctly processed LED control change by returning same message back. For example sending 0xB0 0x11 0x01 to turn the LED on (solid) will receive 0xB0 0x11 0x01 back, which can be used to confirm the LED has been turned on (solid).

Restart

To restart the device's program, send it the system reset byte (0xFF). The device will send back a 0xFF when it resets or starts up.

Development

Use the files contained in the test/ directory to test. (This is known to work in Google Chrome.)

Circuit Diagram

Add'l Debugging Tools

  1. Google Labs web serial tester
  2. WebMIDI tester