Saturday, April 30, 2022

Root Commander DIY Arduino Smart MIDI Controller - No Wrong Notes

 







Root Commander is a smart Arduino MIDI controller that sends single note commands when a button is pressed. The scale or 'mode', key, and octave are selected with 3 potentiometers. Then the note or 'step' in that scale is sent out via MIDI when you press any of 7 normally open, momentary buttons. Every note you play will always be in tune with the scale you selected because Root Commander sets the proper notes for you on the 7 step buttons. There are only 7 instead of 8 because the 8th note of a scale is the same as the first note but 1 octave higher. You can play that note by shifting the octave pot up one octave and playing button 1. An OLED display is used to show the scale, key, octave, and step (shown in Roman Numerals) you've selected.

How to Use Root Commander

  • Use a 5 pin MIDI cable to connect Root Commander to a sound generating instrument such as a synth or computer DAW.
  • On Root Commander select the scale or mode you want to play in with the scale pot. Included scales are Major, Minor, Dorian, and Mixolydian.
  • Then select the key you want to play in with the key pot. Starting from all the way counter clockwise, the note selection goes from A2 chromatically up to Ab3 at full clockwise.
  • Then select the octave of the note you want to play with the octave pot. There is a 4 octave range from -2 octaves up to +1 ocatve.
  • From here use any of the 7 buttons to select the note you want to play in that scale. Root Commander populates the values so that you can't play a wrong note outside the scale.
  • Typically you'll set the scale and key and leave them alone. Then play using the buttons and the octave pot.

Board Info

This code is set up for an Arduino Pro Micro. The SDA and SCL pins used for I2C OLED are different on different Arduino boards, so you will need to adjust your pins in the code and the wiring if you use an Arduino Nano. On Nano SDA = A4, SCL = A5. Make these adjustments in your wiring and on lines 29 - 30 in the code.

Pro Micro has the benefit that it can be used as a native MIDI over USB instrument if coded with the usbMIDI.h library instead of the MIDI.h library. This requires changing the commands for note on and off in the code. If you use a Pro Micro be careful of the power supply you select. The generic Pro Micros I use require 5 - 7V input on Vin, and 9V may be too much. I have included a 6V power supply in the parts list below.

Code Info

Download my Arduino code and schematic from github here.

MIDI.h and ss_oled libraries are required. You will need to download them if you don't already have them. Be sure they're stored in your Arduino Libraries folder.

The Root Commander code uses a lot of memory due to storing the strings for the OLED display. There may be a better way to do this, but it functions perfectly as is. If you make adjustments to improve memory usage, let me know.

You can add more scales to the code. If you do so you'll need to add additional cases to the scale switch case portion of the code.

Space has been left between the cases in the potentiometer value readings for each case to account for flutter inherent to potentiometer readings. Without the gap between the end of one case and start of the next case you could have the potentiometer dialed right on the edge of one case and have it switch to the next case on its own without you touching the potentiometer due to constant and inherent noise in the signal. This is not desirable, so I included buffers in the case values.

Schematic

MIDI and 5 Pin DIN Socket Info

Please see the schematic I posted and also look at the MIDI diagram I posted so that you don't flip which pins to use on the MIDI socket when you're soldering this up. This is looking at the back of the socket where the lugs come out.

MIDI

I have some code commented out that you can use to send MIDI note off commands. I have this set up to play nicely with my Skeeter sequence synth, but you may want to add the note off commands. You can do this by sending a note on command with a 0 velocity. Some instruments prefer that and will not respond to note off commands. So just use note on commands with 0 velocity to be safe.

Pro Micro boards support native USB MIDI, so you can plug this build into your computer via the onboard USB and send MIDI commands from the Root Commander that way instead of the 5 pin MIDI socket. Cool, huh? If you want to use your Root Commander that way, replace the MIDI.h library with the usbMIDI.h library and change the MIDI commands to the appropriate command syntax used in the usbMIDI.h library.

I find the good 'old fashioned' 5 pin DIN MIDI socket to be the most versatile allowing you to make easy connections to standalone instruments such as synthesizers as well as to a computer. You just need the right cable. See my parts list below for MIDI to MIDI and MIDI to USB cables.

My Motivation 

After building an Auduino synth with MIDI input (Notes and Volts tutorial) I immediately saw the value of building a smart MIDI controller for myself that would keep me in the right scale at all times. I play guitar and study music theory, but I don't play piano. It's not easy for me to quickly grab, say,  the 6th of B flat Dorian scale on a standard MIDI keyboard controller at a glance. I wrote this code from scratch as my first all original project. I imagine there are other controllers similar to this out there as well as many ways to go about this. This is the way that made sense to me as a novice coder. 

Disclaimer

I'm just a woman who loves making my own instruments and making music. I'm not a coding expert or schematic creation wizard. But I hope this helps!

Sharing

I invite you to use this code or build your own Root Commander with attribution reference back to this original project.

Parts


Friday, April 22, 2022

Perculator Arduino Mini Pops Drum Machine

 Jupertronic Perculator Mini Pops
DIY Arduino Drum Machine
*Note - I spelled Perculater with a 'u' on purpose!

Start with the video demo by clicking above or clicking Here

Here's my Github repository with code and schematics: Jupertronic Perculator

About

Perculator is essentially an OLED display addition to the Arduino based Mini Pops drum machine originally designed by Jan Ostman. 

I've also made significant changes to the drum sequences to emulate 80s electro pop and dance beats.

*This project runs on 2 Arduinos connected through a common ground, the pattern pot, and a few pins*

Board 1 runs a sound generating drum machine with sounds emulating the Korg Mini Pops. This code, Perculator, is a modified version of The Wee O3 (Mark Dammer) expansion of O2 Mini Pops (Jan Ostman) code which has been popularized by Bloghoskins.

  • Minor changes made for sending pulsed outputs for Perculator's 3 LED design.
  • Extensive changes made to the beat patterns to produce 80s 4 on the floor dance beats
  • Switched to 8ths (1 and 2 and 3 and 4 and) instead of 16ths to work with timing input from my Skeeter sequence synth project

Board 2 runs original code operating an OLED screen showing the number and name of the drum pattern selected by the pattern pot and 3 LEDs which are userful for live play for visual cues showing the beats so you can syncronize your changes with the first/last beat of a sequence.

  •  LED 1 blinks on the first note of the beat sequence
  •  LED 2 blinks on each beat of the sequence
  •  LED 3 blinks on the last note of the beat sequence

Fabricating

Breadboard prototype


Laying out the interface




Hard to see, but here are small indentions pressed into the project box lid with a punch to aid with drilling pilot holes.


Very small pilot holes

Use calipers to measure the exact hole sizes you need for your components.


All the holes drilled to full size using stepper bits


Prepping the OLED screen for installation through the lid. Fine wire cutters were used to cut the plastic headers off. Pinch at the break points and slide them off.


The headers are crooked afterward and must be straightened out. It is possible to buy OLEDs that don't have the headers pre-soldered, but this is what I have. Just bend them back by hand. It's easy. In the background you can see 4 small holes in the lid for the headers to pass through.


Below we have the OLED headers on the inside of the lid with 4 wire leads attached. The screen is held in place with small M3 nylon screws going through the corner mounting holes of the screen, through holes drilled in the lid, then attached to standoff posts on the underside of the lid. It's easier to grasp the standoffs inside to tighten the mounting screws than it is to wrangle a tiny, tiny M3 nut. Don't over tighten or you might crack the screen.


Inside of the lid with the potentiometers, buttons, LEDs, and OLED screen installed

The 2 Arduino Nanos are installed on solderable breadboard (more expensive than perf board but easier for a beginner like me to use) with connections from the potentiometers, buttons, LEDs, and power inputs. 


The full interior of the build: The boards are powered by a single input jack wired separately to each board. I labeled the leads from the buttons for which digital pin to solder them to on Arduino 1 because I wanted specific sounds on adjacent buttons in order to have the bass drum, snare, high hat, and cow bell together on the button interface for better playability. 


All buttoned up - just need to put the potentiometer knobs on. 


Parts Links

OLED

Arduino Nanos

Latching Buttons

Wire

Potentiometers with knobs

Project box

Solderable breadboard

Lots of solder

A little solder

3.5mm audio jacks

5.5mm power jack

Step bit drill set


Code Installation

I've posted my code here on Github.

Install Jupertronic_Perculator_O3Minipops.ino on board 1. *Include Perculator_data.h in the same sketch folder when you upload.

Install Jupertronic_Perculator_Display.ino on board 2. You will need to install the ss_oled.h library for the OLED.

Wiring


These diagrams show the basics of the connections of the Arduino board which runs the OLED. 

The first Arduino which handles all the noise making should be wired according to The Wee O3 schematics. The schematics detailed by Mark Dammer for The Wee O3 are here https://github.com/mark-orion/The-Wee-O3 .  Add the changes shown above in Perculator_Display_schem.pdf and Perculator_Display_diagram.jpg available for download in my github repository.

Also see Bloghoskins' detailed drawings for the original O2 Mini Pops. This version has simplified controls with 2 potentiometers and fewer sync options. http://bloghoskins.blogspot.com/2016/11/korg-mini-pops-diy-drum-machine.html

With your sound generating board all wired up, move on to the OLED board using my plans.

Wire board 2 according to the Fritzing schematic and drawing posted at the top of this section above.

  • Connect grounds from board 1 and board 2 to a common ground point.
  • Run 2 wires from the middle signal lug of the pattern pot so that it can be connected as an input to both Arduino boards. 
  • Be sure the ground lug of pattern pot is connected to the common ground. 
  • Power the pattern pot only from board 1. 
  • Connect the other pins as shown in the schematic for inputs to board 2 from board 1 for timing pulses and the LEDs.
  • LEDs can be run off board 1 as in The Wee O3. They are split off to the extra capacity of board 2 here to remove possible audio coloration on board 1.
  • Suggest green LED for first beat, blue LED for each beat, and red LED for last beat. 
  • Suggest a smaller resistor on the green LED because the red and blue are brighter. This evens it out with my parts. Value determined by trial and error. 
  • My LEDs are very bright in the dark but good in a light room. Use larger resistors to dim the LEDs.
  • You could put diodes on the connections between board 1 and 2 if desired.

Pattern Names

Change the pattern names as desired in the display code. These Perculator beats are promarily 4 on the floor 80s dance beat sequences. 'Boots n' pants' is slang for beat box sounds. ;) 

General

OLED display and LED interface code by Jupertronic aka Janis Wilson Hughes aka J Dub aka vitalWho aka Evolution Stoneware (youtube).

OLED shows what pattern you're playing with pattern number and pattern name so you can tell what the heck you've selected on the pattern potentiometer.

Pins for OLED are dependent on type of Arduino used. This is set up for Nano. If you're using Pro Micro SDA = D2, SCL = D3. Check your SDA & SCL and adjust accordingly.

Disclamer

I'm neither a coding expert nor a Fritzing wiz, but I hope this helps!

Links

Perculator github code and schematics for download

My tip jar - donations appreciated

Bloghoskins O2 Mini Pops post and discussion - tons of great info

Video of The Wee O3 upgraded O2 Mini Pops by Mark Dammer

Github repository for The Wee O3 with code and schematics

Thank you!

Big thanks to Bloghoskins, Jan Ostman, and Mark Dammer.

Wishing wellness and wellbeing to all.

- Janis



Root Commander DIY Arduino Smart MIDI Controller - No Wrong Notes

  Video Demo & Walkthrough Root Commander is a smart Arduino MIDI controller that sends single note commands when a button is pressed. T...