This repository contain the files to be able to create a Max4live 4 controller with Oled as a 5HP Eurorack module to control your VST plugins.
This setup can easily be extended to a 4 units by using jumper cables on the same pcb together with the headers on the boards to maximize a 5 panel order from jlcpcb.
- Download this repo
- Open the Arduino code and upload to the Teensy
- Copy the
Max4Live Controller & Hub
folder to/Music/Ableton/User Library/Presets/Audio Effects
- Open Ableton and place the
Max4live Serial Hub OSC.amxd
to the master channel and select your Teensy device. - Place
Max4live Controller OSC.amxd
on to the track you want to control - Select the VST device in the pull down menu which you want to control
- Select the parameters for each potentiometer and button row.
After using excelent Eurorack Droid system and having created my own Launchpad type solution on it, I wanted to have more hands on controllers also for my VST plugins within Ableton.
I really like the SSL suite of EQ's so I first looked at the UC1, As it was too big to fit in my small studio, I decided to build my own eurorack version to fit into my controller case with visual feedback to limit having to look at the DAW screen when adjusting EQ.
I discovered early on the 127 midi steps were not fine grained enough. Even using the pitchbend range or using MSB/LSB (sending on CC1 + CC 32) were often with issues still:
- Still quite noisy with an analog encoder so hard to dail in precise values
- Ableton could not set a parameter as 14bit midi
So after some experimentation I decided to go with using an 3 euro AS5600 magnetic encoder and a cheap 0.75 Euro EC11 encoder to get a noise free 12bit 4096 step resolution which was precise enough to dail precise frequencies using this video as an example: https://www.youtube.com/watch?v=1UmqNF65rck
This worked surpisingly well and is a great hack!
The next challenge was to ensure the encoder did not switch back to 0 halfway if the parameter changed via mouse input or when the parameter type changed. The solution was to set the offset of the magnetic encoder chip when the value changed externally. That way the encoder is always in sync before it adjusts it's value.
I coded a piece of logic to ensure whenever the value of the encoder is outside of +-2 numbers, MaxMSP sends an offset value update to the Teensy. The encoder is only allowed to change the values when the values of the VST parameter and the AS5600 offset are the same.
Th next challenge was to ensure the value was updated before the encoder could output any values. Here I got a lot of race condition issues, and it took me a week before I could tackle this.
For all functions I use lists to iterate over all changed values which are updated and also to set each of the AS5600 controllers and OSC adresses within different functions. This makes the code more DRY and makes it easier to add more parameters.
I created one function to gather all values to be displayed which loops in the main loop of the Arduino code. I also created one function to set all updates from the encoders And created one function to parse to each specific OSC address recieving part.
- 1 Teensy 4.0 with headers
- 4-16 AS5600 magnetic angle sensors
- 4-16 EC11 rotary encoders
- 1-4 25mm wide SSD1306 Oled Screens, or Gadgetbouw.nl Check if they are really 25mm in width visible by the mounting holes being directly to the end of the pcb on both sides. Most cheap SSD1306 Oleds are 27mm.
- 1-5 PCB boards from jlcpcb
- 1-5 Alu front panels from jlcpcb
- Header pins and sockets
- M3 nylon spacers 6mm
- M3 nylon nuts
- 1 Superglue for mounting magnets and spacers
- 2-8 pushbuttons EAO or cheaper 9.2mm types from Ebay
The software side consists on 2 pieces of code. One for the Teensy and one for Max4live.
I tested first a simple setup with using the standard serial ASCII communication, but found it quite fiddly to ensure to retrieve each different piece of information being send. The Open Sound Control (OSC) addressing structure felt like a much more robust way to send information back and forth, but unfortunately the OSC library from CNMAT did not work properly any more in the current MaxMSP and via serial (instead of network port). After a lot of research I finally found a good working library to make this work on the Teensy with MaxMSP (jey!): https://github.com/thomasfredericks/MicroOsc
Max4Live using more than 1 instance fix: add r --- to create random unique numbers https://cycling74.com/forums/multiple-max4live-instances
Serial input Teensy to MaxMSP https://www.youtube.com/watch?v=6bT3G4Mep7E
Serial output MaxMSP to Teensy https://www.youtube.com/watch?v=68L-WHh3Ows
Button switch using internal pull up: https://www.pjrc.com/teensy/td_digital.html
MaxMSP scaling log https://cycling74.com/forums/vst-plugin-parameter-scaling-problem
Dynamically load bpatchers: https://cycling74.com/forums/dynamically-created-sub-patchersbpatches
Dummy virtual Serial https://arduino.stackexchange.com/questions/9857/can-i-make-the-arduino-ignore-serial-print
Best example with many displays https://www.youtube.com/watch?v=XFh9ZhL0jhE
Control Surface library struggle tttapa/Control-Surface#286
Good example to start with, also using 4 displays and using MCU: https://projecthub.arduino.cc/criusdigitalstudio/diy-usb-midi-daw-controller-ecdcf6
good example of display fader https://github.com/yilmazyurdakul/ArduinoOledMidiController https://github.com/yilmazyurdakul/ArduinoOledMidiController/blob/main/ArduinoFile.ino
4 rotary encoders with midi control http://little-scale.blogspot.com/2017/04/teensy-36-basicsusing-rotary-encoders.html
2 displays https://www.brainy-bits.com/post/two-is-better-than-one-how-to-connect-two-spi-oled-displays
4 displays with Arduino https://www.youtube.com/watch?v=MO6hbQcX8fE
4 displays and 4 encoders with visuals https://projecthub.arduino.cc/yilmazyurdakul/arduino-midi-controller-with-encoder-oled-display-eeprom-311960
display https://www.pjrc.com/teensy/td_libs_SSD1306.html encoder https://www.pjrc.com/teensy/td_libs_Encoder.html endless potentiometer: https://github.com/juanlittledevil/EndlessPotentiometer noise reducer analog signal: https://github.com/dxinteractive/ResponsiveAnalogRead
scroll text example: https://stackoverflow.com/questions/40564050/scroll-long-text-on-oled-display
midi https://github.com/tttapa/Control-Surface
http://midibox.org/forums/topic/29225-modul-box-ng-v2/?do=findComment&comment=199453
Oled display <25mm height https://www.winstar.com.tw/products/oled-module/graphic-oled-display/sh1106-oled.html
multiplexer met tutorial (zie ook youtube filmpje) https://www.tinytronics.nl/shop/nl/communicatie-en-signalen/io-converters/i2c-multiplexer-tca9548a
128 pulse encoder (too expensive) https://nl.mouser.com/datasheet/2/54/ace-777357.pdf
1024 to 256 midi values with 10 bit nano: https://forum.arduino.cc/t/potentiometer-send-midi-cc/142766/7
analog potentiometer Kore2: https://hackaday.io/project/171841-driveralgorithm-for-360-deg-endless-potentiometer with: https://nl.mouser.com/ProductDetail/Alpha-Taiwan/RV112FF-40B3N22F0B10K?qs=Znm5pLBrcAJwOGngbhkPgg%3D%3D
more examples: https://diyelectromusic.wordpress.com/2021/09/28/arduino-midi-rotary-encoder-controller/
magnetic encoder: https://curiousscientist.tech/blog/as5600-magnetic-position-encoder
working magnetic encoder example https://www.youtube.com/watch?v=1UmqNF65rck
Bourns dail 20 turn https://www.zendamateur-marktplaats.nl/componenten/componenten-anders/bourns-dial-model-h-46-36496.html
potential bigger potentiometer: https://www.gear4music.com/Guitar-and-Bass/Emerson-Custom-CTS-250K-Short-Split-Shaft-Pro-Potentiometer/1GAA
Encoder example fast/slow relative unsigned bit: https://remotify.io/community/question/absolute-14-bit
OSC https://github.com/CNMAT/OSC/blob/master/examples/SerialOscuinowithMessages/SerialOscuinowithMessages.ino https://www.ableton.com/en/packs/connection-kit/ https://github.com/thomasfredericks/MicroOsc
https://forum.arduino.cc/t/slipserial-and-osc-but-generally-reading-serial-across-loop-s/563369