pico-midi configurator

Accel SCL GP3 Accel SDA GP2
Ch 1

Project

Component Wiring

Input Components Pins Connection
Button Momentary switch GP0–1, GP4–22 Switch between GPIO and GND (internal pull-up, no resistor needed)
Touch Conductive pad (copper tape / foil / bare PCB) GP0–1, GP4–22 Pad connected to GPIO only (capacitive sensing, no GND)
Pot Potentiometer (any value) GP26, 27, 28 Outer legs to 3V3 + GND, wiper to ADC pin
LDR LDR + 10kΩ resistor GP26, 27, 28 Voltage divider: 3V3 → LDR → midpoint → ADC pin, resistor → GND
Accel LIS3DH or MPU6050 module GP2 (SDA), GP3 (SCL) I2C: SDA/SCL to GP2/GP3, VCC to 3V3, GND to GND

Pin Summary

PoolAvailable PinsMax
Digital (buttons / touch)GP0–GP1, GP4–GP2221
Analog (pots / LDR)GP26, GP27, GP283
I2C (accelerometer)GP2 (SDA), GP3 (SCL)fixed

The Note and Velocity fields for buttons and touch pads accept expressions. An expression can be a plain number, a sensor variable, or a formula combining both.

Variables

VariableDescription
pot0pot2Potentiometer values (0–127)
ldrLight sensor value (0–127)
accel_xAccelerometer X-axis (0–127)
accel_yAccelerometer Y-axis (0–127)

Operators

OperatorDescription
+Add (saturates at 127)
-Subtract (saturates at 0)
*Multiply (saturates at 127)
/Integer divide

Functions

FunctionDescription
min(a, b)Minimum of two values
max(a, b)Maximum of two values
clamp(val, lo, hi)Clamp val to range [lo, hi]
lerp(a, b, t)Interpolate from a to b (t: 0–127)
scale(root, pos)Quantise pos to a musical scale starting at root (default: Lydian)
scale(root, pos, mode)Same, with explicit mode (see below)

Scale Modes

The scale() function maps a 0–127 position value onto notes of a diatonic scale, spanning about 2.5 octaves from the root note. This makes it easy to assign musically consonant notes to controls.

Mode#Character
lydian0Bright, dreamy (default)
major / ionian1Happy, standard
mixolydian2Bluesy, dominant
dorian3Jazzy minor
minor / aeolian4Sad, natural minor
phrygian5Dark, Spanish
locrian6Dissonant, unstable

Conditionals

a > b ? x : y — if a is greater than b, use x; otherwise use y.

Examples

Notes