กลับไปหน้ารวมไฟล์
arduino-midi-controller-with-encoder-oled-display-eeprom-311960-en.md

I am a musician so I use recording software, vst instruments, playback devices and more. It is easy to use physical knobs or faders but if you are in front of the computer, you have to follow the screen.

It is impossible if you are a drummer :)

I built simple OLED encoder menu system before. In this project I improved that so much and combined with MIDI system.

Specifications

  • 1 joystick to control XY plotter
  • 4 faders (can be increased due to board)
  • 9 buttons
  • OLED display
  • Encoder controller
  • Enable / disable
  • Settings menu
  • Enable / disable
  • Easy to use (for me)

MIDI messages flows over the USB cable to computer. Hairless MIDI receiver takes the serial port signals and sends to MIDI channels.

Wiring is really easy. I will explain step by step

1 - Oled SDA to A4 2 - Oled SCL to A5 3 - Oled GND to GND, VCC to +5 4 - Encoder GND to GND, VCC to +5 5 - Encoder sw to switch pin defined in code 6 - Encoder CLK to Digital 2 pin 7 - Encoder Data to Digital 3 pin 8 - Joystick GND to GND, +5 to +5, 9 - Joystick x to A0, y to A1, 10 - Potantiometers to other analog pins

Hairless MIDI tracks serial messages so baud rates must be same. Hairless midi default baud rate is 115200.

Hairless MIDI receives serial messages so you have to get this data and send to MIDI port. loopMIDI can handle this job really nicely. It provides virtual MIDI input and output ports.

Case for components. I will manufacture this on my DIY CNC.

The Infinite Rotary Encoder Library

A standard volume knob stops spinning at 100%. A Rotary Encoder spins infinitely, making it the perfect tool for digital DAWs.

  1. The Encoder outputs two massive A and B pulse waves (Quadrature logic).
  2. If Pin A goes HIGH before Pin B, the user is spinning the knob Right. If Pin B goes HIGH first, they are spinning Left.
  3. The Hardware Interrupt: To never miss a microscopic tick, the encoder is wired strictly to Pins 2 and 3. attachInterrupt(0, readEncoder, CHANGE);
  4. The C++ code violently updates a counter variable. When it increments from 0 to +10, the Arduino must convert that into a massive MIDI CC payload!

The 31250 Baud MIDI Hex Stack

You don't send strings like "Turn up the bass" to Ableton. You must blast raw hexadecimal byte-arrays.

  • Standard MIDI runs at Serial.begin(31250); (A deeply weird, inflexible baud rate from the 1980s).
  • The Execution Command: To turn a knob, the Uno sends exactly 3 bytes:
    1. 0xB0 (Control Change Command on Channel 1)
    2. 0x07 (The specific target, e.g., Master Volume)
    3. 0x40 (The exact Value, 0 to 127)
  • The Uno utilizes an incredibly fast Serial.write(byte); command to pipeline these hexadecimal arrays directly into the PC!

OLED Patch Mapping and EEPROM Recall

A user wants to save their custom knob assignments.

  • An I2C SSD1306 OLED displays the current Menu: "Rotary 1 = Filter Cutoff."
  • The Arduino relies heavily on the <EEPROM.h> library. When the user assigns a new MIDI CC to Rotary 1, the Uno burns 0x07 directly into flash ROM EEPROM.write(1, 0x07);.
  • Even if the DJ unplugs the board during a concert, plugging it back in instantly retrieves the exact Ableton Live mapping from the silicon hardware memory!

The Studio Component Rig

  • Arduino Pro Micro or Leonardo (The ATmega32u4 chip is absolutely required to act as a Native USB-MIDI Human Interface Device. An Uno cannot be seen by Ableton as a MIDI controller out-of-the-box!).
  • Rotary Encoders (KY-040) with physical push-switches.
  • 0.96" I2C OLED Display.
  • Linear 10K Potentiometers (Slide Faders) for the mixing board layout.

There is a video about project. I finished that and I am using this now in my school. I will add subtitles. Until that you can see the controls

Progressing specs:

- Editable notes for buttons: Done - Encoder sensitivity settings Done - MIDI Input/Output -Done (not with opto isolator. I took risk) - Bank Select Done for buttons. - EEPROM for saving changes Done - Adding notes by pressing multiple buttons (Looks like not useful) - Mozzi Processing. (I will not do it with Atmega328) - Baud Rate select from menu to use USB or MIDI face Done

  • Now i am trying to control 12 channel slider with 4 physical buttons.

I want to add simple synth operations to my project. I need 2 serial communication. Hardware serial to pc over serial, software serial out to midi out(done) and serial input for mozzi synth operation.

I did something but i guess it will not work properly with arduino nano or uno. Because software serials are not fast enough to take midi notes from midi keyboard. Also 2 kilobyte program memory and global variable spaces are not enough for all midi, serial, software serial, gfx libraries, mozzi...

I will end this project due to program memory. I want to do something more so i started to work with STM32, esp32 (it is good because it has DAC converter) and Teensy board.

Stay tuned. I will be back!

Note: I guess it will take a while.

This code and configuration is tested and working properly.

Update: I finished this project. Arduino Nano is not fast enough to handle bigger operations. I wanted to add more controls but it looks like not useful. I will start to new project with Arduino Mega.

Because i need more faders, buttons, feedback lights, bigger screen while playing instruments or broadcasting. Thank you for your attention. As i said, stay tuned!

Important Update!

Arduino Nano or Uno is not enough to handle for smoothing fader signals, generating sound or driving screens.

I have to change the chip to STM32 or ESP. That means I need time...

If you want to tinker on it, please share this with us on github.

https://github.com/yilmazyurdakul/ArduinoOledMidiController

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Hairless MIDI"
  - "1x Arduino IDE"
  - "1x loopMIDI"
author: "yilmazyurdakul"
category: "Audio & Sound"
components:
  - "1x Soldering iron (generic)"
  - "1x Analog joystick (Generic)"
  - "1x CNC Machine"
  - "1x Breadboard (generic)"
  - "1x USB-A to Mini-USB Cable"
  - "1x Arduino Nano R3"
  - "6x Switch Actuator, Head for spring return push-button"
  - "1x MIDI Socket"
  - "1x Rotary Encoder with Push-Button"
  - "4x Rotary potentiometer (generic)"
  - "1x Jumper wires (generic)"
  - "1x Graphic OLED, 128 x 64"
description: "Professional DAWs integrated! Hijack the native 31250 baud MIDI protocol to construct an absolute studio-grade mixing interface featuring infinite rotary encoders and deeply nested OLED patch banks."
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles: []
encryptedPayload: "U2FsdGVkX1/R/sEuLptUWFpqA0Kg5ZahLQ1vYAdUwfnHaGjcxe74+z+Yrhlz1cJnKTmEruMjHsKSHCCq2i0Av7Ictyegaxry6EjljL5eT3CZcPi50332l1sS8jKmbp9PRL52iRQ5W52NMAGpQrLTIw=="
heroImage: "https://projects.arduinocontent.cc/cover-images/acd2a3da-2d4e-4b4e-b3e5-f4770fbf65fe.gif"
lang: "en"
likes: 34
passwordHash: "c4218aeeffc6f9b8aa1d27cae78eb3b38ccdb9b26ad3818b2b7e1fc321531415"
price: 2450
seoDescription: "Build an Arduino MIDI Controller with Encoder, OLED Display, and EEPROM. Features unlimited MIDI channels, XY plotter, faders, and visual feedback."
tags:
  - "midi"
  - "hairless"
  - "menu system"
  - "oled"
  - "arduino nano"
  - "encoder"
title: "Arduino MIDI Controller with Encoder + OLED Display + EEPROM"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/9IVsO4cGzYs"
  - "https://www.youtube.com/embed/Ju9ZYOijpMo"
views: 45638