Skip to content

autr/4BY4

Repository files navigation

4BY4

4BY4

4BY4 is a prototype MIDI / OSC / WebSockets controller. When changing between pages of assignments, values are locked ( ie. do not send ) until the position of the knob returns or passes the previously recorded position.

I'm told this is similar to MIDI pick up mode on Novation controllers!

To indicate the state of the knob ( locked or unlocked ), an LCD is used to display the original value alongside the current knob position, and is highlighted in red until the knob position passes it.

Pots vs Encoders

The idea is as a low-cost alternative to using rotary encoders. Rotary encoders have the benefit of no fixed start or end point, but the downside of having less resolution than potentiometers (unless very expensive), and not the same feel as an analogue potentiometer. The 4BY4 uses a rotary encoder for switching between pages, but potentiometers for the 16 knob bank.

Sending Messages

When connected via USB, the 4BY4 sends serial messages over USB with 10bit / 1024 points of fidelity, so bridge.js must be run to forward those messages into MIDI, OSC or WebSockets.

It's possible to load MIDI firmware onto the Arduino - or use a Teensy - and skip this process, but will reduce the resolution to MIDI 7bit / 128 points.

Parts

The prototype is built easily sourced Arduino bits (ie. Uno + TFT + rotary encoder):

Usage

Prerequisites

Arduino

4BY4.ino can be opened in the Arduino IDE and uploaded there, or if you have arduino-cli installed run it with ./compile.sh, after making sure to set BOARD_TYPE and BOARD_PORT in config.env:

BOARD_TYPE=arduino:avr:uno
# use "arduino-cli board list" to find BOARD_TYPE

BOARD_PORT=/dev/cu.usbmodem1D131
# use "ls /dev/tty*"" to find BOARD_PORT

Bridge

pnpm i 
pnpm start

Once the sketch is uploaded to the Arduino, you can run the bridge script which will forward serial messages into MIDI, OSC or WebSockets. This is done with pnpm start. To configure OSC, make sure to set OSC_ADDRESS and OSC_PORT in config.env:

OSC_ADDRESS=0.0.0.0
# the IP of the computer your OSC messages will be sent to
# 0.0.0.0 is localhost

OSC_PORT=4444

Check package.json for a list of scripts which can be run.

Wiring

=======================
POTENTIOMETERS x16 (1K)
=======================

MIDDLE PINS = Multiplexer C0-C15
LEFT PINS = 5V zig-zagged
RIGHT PINS = GND zig-zagged

=========================
MULTIPLEXER (MUX74HC4067)
=========================

C0-C15 = Potentiometer Center Pins
S0 = Arduino D3
S1 = Arduino D4
S2 = Arduino D5
S3 = Arduino D6
EN = Arduino D7
SIG = Arduino A0

========
TFT 1.8"
========

SCK/CLOCK = Arduino D13
SDA/MOSI = Arduino D11
CS/SS/NSS/SELECT = Arduino D10
A0/DC = Arduino D9
RST/RESET = Arduino RESET

==============
ROTARY ENCODER
==============

CLK = Arduino D12
DT = Arduino D8
SW = N/A

TODO

  • make a KiCad design with through-hole potentiometers
  • use better quality potentiometers, and correct resistor values
  • switch MIDI / OSC / WebSockets script into GUI panel

Misc

Some resources I found helpful while building this:

License

MIT

About

MIDI / OSC / WebSockets Controller

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published