Arduino MIDI Controllers

Started by Elantric, May 07, 2013, 09:29:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Elantric

http://echolevel.tumblr.com/post/49737964614/knobber-usb-midi-controller-by-echolevel


Knobber - USB MIDI single knob/button controller by Echolevel






Well, here it is: the Echolevel Knobber! A tiny, class-compliant, USB MIDI controller with precisely ONE knob and ONE button. I always wanted something like this and could never find one on the market; fortunately, once the Teensy USB Development Board came of age,

http://www.pjrc.com/teensy/

making my own became very straightforward. The Teensy is an Arduino-like dev board with two major advantages (for me) over Arduino: it's extremely small while still having a USB (micro) connector, plus it natively acts as a class-compliant USB MIDI device allowing plug'n'play use on modern versions of OS X, Windows, iOS and - to a certain extent - Linux. Why? Well sometimes you're working in a coffee shop or playing live on a very tiny amount of table space, and you don't *need* the 8+ knobs that your favourite controller offers. In something like Ableton Live, where the Remote feature 'captures' your controller per track or device, being able to map one single knob to a parameter for the purposes of a carefully-controlled automation edit or a live performance tweak is handy. It is to me, anyway, and I primarly built this to cater for my own need :) The button is just there because a) there was enough space for it in the box and b) it's handy for toggling that device (or another device) on/off; great for automation stutter edits with a glitchy effect, for example.



See it in use controlling an Ableton Live Auto Filter cutoff in the video above, while the push-button toggles the device on/off, and check out the pics, schematic and code to see how you can build your own.



Dev Process - Short Version



The first problems I ran into were in stabilising the value from the potentiometer (knob). For MIDI CC automation, you want the value to stay still and for the device to stop sending MIDI data when the knob isn't being turned. Fortunately, my old friend and chipmusic compatriot Philip Cunningham (aka Firebrand Boy, aka unsymbol)
http://philipcunningham.org/posts

had made a slightly more complex MIDI controller a few years ago so I was able to use some of his code (available on his Github) to take a running average of the input values and smooth them out. That wasn't quite enough, though, and a bit more digging led me to the concept of power decoupling and the fact that a small capacitor would - for reasons I don't quite understand because I'm an electronics noob - smooth everything out nicely. Phil's code also clued me in on the Bounce stuff, which makes it much easier to get useful data from button presses. Cheers Phil!



I prototyped the whole thing on a breadboard (see below), testing the input with MIDI Monitor for OS X (MIDI-OX is best on Windows), and then packed it all into the smallest Hammond project box I could find in Maplin. The pot is a 100K linear (you can logarithmise the values in your code if you want to), the switch is the smallest I could find in Maplin (though Farnell/RS/etc probably have better ones; this one isn't great, to be honest) and I used a Dremel to carve out the micro-USB slot and the knob/button holes. The £16 Teensy board sits on the case cover so that the screws are face-down when the device is in use, and I glued that down with a hot glue gun - bracing it at the back with a Dremelled-down piece of veroboard (also glued) so it can withstand having the USB cable jammed into it without moving. Hopefully the glue will keep it nicely in place, though a more hardwearing option might be to break out the micro-USB to a B-type connector mounted to the chassis. Easily done in a bigger case, but there is almost NO free space in this one once the components and wires are packed in. Finally I soldered everything in, tested it and was met with success!



If you make one of these yourself, bear in mind that loading an update of your code onto the Teensy (which you might need to do if you want to change CC mappings, for instance) requires you to press the reset button on the Teensy itself. I can do this quite easily by unscrewing the bottom of the box, opening it slightly, then poking a finger in to hit the button. Not ideal, but then you shouldn't have to make changes very frequently. If you did, you could break out the rest switch to another physical switch mounted on the case. In the long term, I want to implement some SysEx control whereby you can send new mapping values direct from SysEx Librarian or something, or maybe a Max/MSP patch, which are stored in the Teensy's tiny amount of non-volatile EPROM. Just a thought.



I'll add other details as I think of them.











Note - you'll need to install Arduino and the Teensy stuff for it (which is all part of Teensy setup, explained on its website), and before you send any MIDI-related code to the board you should go to Tools -> USB Type and select 'MIDI'. Once the board is running in MIDI mode, you won't be able to see any useful output in Arduino's built-in serial monitor, but that's no problem - just use MIDI Monitor or MIDI-OX instead. You can also change the self-declared USB MIDI device name in a header somewhere, but I can't remember right now...I'll add it when I do.



#include <Bounce.h>



//define how many pots are active up to number of available analog inputs

#define analogInputs 1

//make arrays for input values and lagged input values

int inputAnalog[analogInputs];

int iAlag[analogInputs];

//make array of cc values

int ccValue[analogInputs];

// index variable for loop

int i;

boolean resettingbutton = false;

int buttoncounter = 0;

Bounce button0 = Bounce(0,5);

int channel = 1;





void setup() {

  //MIDI rate

  Serial.begin(31250);

  pinMode(0, INPUT_PULLUP);

}



void loop() {



  button0.update();

  if (button0.fallingEdge()) {

      usbMIDI.sendControlChange(30, 127, 1);

  }

  if (button0.risingEdge()) {

      usbMIDI.sendControlChange(30, 0, 1);

  } 

 

  for (i=0;i<analogInputs;i++){

    // read current value at i-th input

    inputAnalog = analogRead(i);

    // if magnutude of diference is 8 or more...

    if (abs(inputAnalog - iAlag) > 7){

      // calc the CC value based on the raw value

      ccValue = inputAnalog/8;

      // send the MIDI

      //usbMIDI.sendControlChange(i, ccValue, 1);

      int inverted = map(ccValue, 127, 0, 0, 127);

      usbMIDI.sendControlChange(1, inverted, 1);

      // set raw reading to lagged array for next comparison

      iAlag = inputAnalog;

    }

  delay(5); // limits MIDI messages to reasonable number

  }

}

mbenigni

#1
Oh, that's awesome.  I may want to install one of these chips in a volume pedal at some point.  $19 is very reasonable!

rolandvg99

#2
Very interesting and definitely something I must try to assemble (if my arthritis allows me).
To V or not to V: That is the question.

My little Soundcloud corner

DanVG

#3
 Hello
Send Midi codes with IR Remote Control is easy to implement on Arduino in addition of pots and switchs. (excuse my poor english).

DanVG

#4
Hello
My cheap (# 12€) DIY Arduino MIDI IR-RC + 4 foot controller + EV-5 (with variable curve) and FS-6 jacks for GR-55 (PC, CC and some SYSEX).

whippinpost91850

#5
Very cool, I love the wood switch pedals.

Elantric


admin

Expanding Amplifire Switching
http://www.thegearpage.net/board/index.php?threads/homebrew-solution-to-expanding-amplifire-switching.1685508/

---
I have been gigging with the Atomic Amplifire for a few months now and am loving the great sounds and compactness for the smaller gigs where big pedal boards and tube amps take up too much space. I have been using all three foot switches on the Amplifire in A/B mode to give me quick access to 6 core sounds and using outboard delay and mod fx in the loop (as I need to be able to switch these for each preset).

I really wanted to expand the preset access and use more of the internal fx so have come up with a home-brew midi switching solution that can be built into a small pedalboard as shown in the pics below.
[​IMG]
I used a cheap Arduino Nano board (£2 from china) and a few other components (about £20 in total - mostly for the footswitches) and wrote some simple software that I have put up on github:
https://github.com/boogiejem/amplifire-midi-controller.

So far I am pleased with the result as I now have access to 8 presets via the 4 A/B switches built into the board and for each preset am using the switches on the Amplifire for tap tempo and toggling fx and delay and this is pretty much what I need. I included midi control of the wah too but this is a bit 'steppy' (not sure if this is my software or the Amplifire but am working on it).

Anyway it's been a fun project and if anyone here is interested in having a go at this themselves I can provide more info.



https://github.com/FortySevenEffects/arduino_midi_library


Arduino MIDI Library v4.2
This library enables MIDI I/O communications on the Arduino serial ports. The purpose of this library is not to make a big synthesizer out of an Arduino board, the application remains yours. However, it will help you interfacing it with other MIDI devices.

Download the latest version here.

Features

Compatible with all Arduino boards (and clones with an AVR processor).
Simple and fast way to send and receive every kind of MIDI message (including all System messages, SysEx, Clock, etc..).
OMNI input reading (read all channels).
Software Thru, with message filtering.
Callbacks to handle input messages more easily.
Last received message is saved until a new one arrives.
Configurable: overridable template-based settings.
Create more than one MIDI port for mergers/splitters applications.
Use any serial port, hardware or software.

Elantric


This crazy tiny Arduino clone nestles into a AA battery slot
It's not as high-powered as a Raspberry Pi, but the AAduino is a tool many DIY types will find useful.

http://www.pcworld.com/article/3059312/open-source-tools/this-crazy-tiny-arduino-clone-nestles-into-a-aa-battery-slot.html

This crazy tiny Arduino clone nestles into a AA battery slot
It's not as high-powered as a Raspberry Pi, but the AAduino is a tool many DIY types will find useful.

aaduino comparison
Credit: Johan Kanflo
COMMENTS
Ian Paul
Ian Paul | @ianpaul
Contributor, PCWorld Apr 20, 2016 8:52 AM
Make it smaller.

That's what many DIY hackers cry out for when they see a new programming board. People even call for powerful mini-PCs like the Raspberry Pi 3 to shrink, as we saw in the reaction to our recent review. Well, get a load of this, makers: An Arduino clone that's literally the size of a AA battery.

Sweden-based coder Johan Kanflo was looking for a way to make the Tiny328, which he was using in his DIY projects as an ISM radio node, more portable. Kanflo wanted a case for the Tiny328 with a battery compartment, but he couldn't find anything that suited his needs. 3D printing wasn't in the cards either.

aaduino boxed JOHAN KANFLO
That's when he decided to go out on his own and shortly thereafter, the aptly named AAduino was born. This Arduino-compatible board fits neatly into a AA battery slot. Kanflo opted for this form factor to create a self-contained radio node that supplies its own power. In other words, he dropped the AArduino into one slot of a battery case with room for three AAs, and then put regular batteries in the others.

To take power from the batteries that are sharing the compartment Kanflo added Keystone battery terminals to the board, but with the poles reversed. He also had to file down some of the components without damaging them so they'd fit inside the battery compartment.

The board itself has an 8-bit ATmega328P micro controller running at 8 MHz, an RFM69C transceiver module for wide frequency communication, two temperature sensors, and an LED.

The impact on you at home: This is definitely not a Raspberry Pi replacement, but it is a nice little tool for any projects that require basic wireless communication between devices. If you'd like to create your own AAduino, Kanflo has posted all the information you need to get started on Github.


https://github.com/kanflo/aaduino
===
http://johan.kanflo.com/the-aaduino/
The AAduino
2016-04-13  Johan  Arduino
I have been using Nathan Chantrell's Tiny328 for quite some time as my swiss army knife ISM radio node. Now I wanted a more slim ISM node as my setup with a Tiny328 on a breadboard is not very "deployable". I could of course 3D print a case for the Tiny328 but I have limited access to 3D printers and do not feel I have the time to explore that exciting part of the maker world just yet. This leaves me with finding off the shelf project boxes with a compartment for 2x AA batteries and the "radioduino" (and in an acceptable form factor). That search came up disappointingly, and surprisingly, short. I did have a set of standard eBay AA battery holders and looking at the 3x variant it occured to me. I needed to shrink the radio node, and the AAduino was born.


Honey, I shrunk the radioduino!
The AAduino is an wireless Arduino clone the size of an AA battery with Keystone battery terminals rotated 180° to act as positive and negative terminals. It is powered by an ATMega328p and is fitted with an RFM69C companion. There is room for two DS18B20 temperature sensors and an indicator LED.


I still think it looks a bit weird :)
It runs at 8Mhz to allow for greater life span since the CPU can run at a lower voltage. I have fused the 328 to brown out at 1.7V which is a bit out of spec at 8Mhz and slightly below what the RFM69C needs. Running at 4Mhz would be more suitable but I will see how well the node performs when the batteries are draining out.


AAduino, RFM69C side
Since the RFM69C is somewhat wider than an AA battery I used a file to make it slightly narrower. There is some room for that kind of modification without damaging the module. Next I clipped the legs of the DS18B20 until about 5mm remained and soldered it to the 3x pin header on the AAduino. I then drilled a hole in the battery box where the sensor can protrude and a small hole for the LED to shine through. The wire out of the battery box was cut, shorted and stuffed away inside the box.


AAduino inside 3xAA box
I use battery terminals from Keystone available from RS Components, positive and negative. There seems to be a cheap eBay alternative but I have not tested those. The + and – markings on the PCB indicates (this is important, read carefully) the positive and negative poles of the battery we are pretending the AAduino is. The Keystone spring contact should be soldered to the + marking and the button contact to the – marking. There is no protection diode here so be careful. Also note! If you want to power the AAduino from a bench power supply, connect the power supply's black negative lead to the + marking and the red positive lead to the – marking.



The 3xAA boxes are also from eBay and there seem to be two different types. One that is really good and one that is really crappy. I will let you in on the secret of buying the correct one. The good ones have a nice build quality and plastics and look like this. Note the rectangular piece of plastic below the battery compartment extending from side to side.


Good 3xAA holder
Looking at the crappy ones, well you can tell can't you? In the top left corner it seems someone used a soldering iron on the poor thing. The lid does not snap in place very well and the plastics is really cheap.


Crappy 3xAA holder


Elantric

#10



https://blog.arduino.cc/2016/10/17/a-touchless-midi-controller-for-your-electric-guitar/


A TOUCHLESS MIDI CONTROLLER FOR YOUR ELECTRIC GUITAR

Arduino Team — October 17th, 2016

If guitar effects pedals aren't really your thing, perhaps Evan Kale's touchless MIDI controller will fit the bill.

Using an Arduino, along with a Colpitts oscillator and some other electronics, Kale has come up with a rather unique interface for his guitar. Instead of using a foot pedal, he put a strip of aluminum foil inside of a fingerless glove, then attached a homemade metal detector coil and circuit to the back.

This allows him to strum the guitar, then change the sound by moving his hand away and toward the strings as a MIDI input. Very clever, and as always, Kale outlines everything in his own zany video style!

You can find the code for this project here and check out the schematic on Imgur. On the other hand, if this looks slightly familiar, he uses the same type of circuit for this MIDI controller as the metal detector previously covered on our blog.



https://blog.adafruit.com/2016/10/24/arduino-powered-touchless-midi-controller-for-your-electric-guitar-arduinomonday-musicmonday/





DanVG

Another controler with Arduino Nano for my Cubase

Ed_Saxman

Looks great, Dan! Love the arcade buttons and the pots style.

gumtown

#13
Here is one I made as a parameter knob box for controlling the GR-55, GT-100, GP-10 and others.
It uses regular potentiometers so has no control feedback from the device.




I then started on a rotary encoder version, which is capable of reading back device settings,
but this one was not completed as I couldn't get the Arduino Teensy to read all the encoders at the same time properly.



Project source code here
https://github.com/gumtown/V-tone
Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

sixeight

QuoteI then started on a rotary encoder version, which is capable of reading back device settings,but this one was not completed as I couldn't get the Arduino Teensy to read all the encoders at the same time properly.

There are faster Teensies now, the 3.5 and 3.6. Using one of those together with interrupts should work. They also have more pins.

Elantric

#15





gumtown

#17
Here is my most recent one,
a wireless midi controller, the slave unit which interfaces 5 pin DIN midi in and out, and sends via NRF24L01 radio module (channels 100~125 are just above the 2.4GHz wifi band), these ready to use radio modules are found easily every where (eBay) and are very cheep.

The slave Arduino is a Nano clone,
the master/controller is a Teensy 3.2.

the code is here, and can be modified to suit your own uses.
https://www.vguitarforums.com/smf/index.php?action=dlattach;topic=23969.0;attach=18000

and a topic page about it here
https://www.vguitarforums.com/smf/index.php?topic=23969.msg174161#msg174161

For my use, a 4 button/rotary encoder and 4x20 lcd display,
the midi project is connected to my Yamaha 01v96 digital mixing desk, it requests parameter data required from the desk for the current 4 controls displayed to have updated values, then you turn the encoder knobs to adjust the desk settings remotely.
I installed a LiPo cell from a laptop which powers it continuous for more than 3 days, and recharges from a regular cell phone charger


Free "GR-55 FloorBoard" editor software from https://sourceforge.net/projects/grfloorboard/

admin



shannonrichards

Am I asking for to much if I ask for say an arduino MIDI keyboard or a pedal at least?

IMH1234

Quote from: shannonrichards on September 20, 2023, 08:45:35 PMAm I asking for to much if I ask for say an arduino MIDI keyboard or a pedal at least?

The Linnstrument is based on an Arduino platform so I would expect a Midi keyboard could be implemented in a similar way

https://www.synthtopia.com/content/2017/06/28/from-arduino-to-linnstrument/

I doubt it would be commercially viable for someone to manufacture - I don't really see any way anyone would implement this outside a high end product and the market for midi controllers in the £/$/Euro >1000 range is pretty limited these days

shannonrichards

That wouldn't happen. Despite the versatility of Arduino microcontrollers, commercial manufacturers tend to shun away from the device, because of the fact that it is a hobby grade microcontroller. It is therefore more viable to create and arduino based implement for your playing.

ElliotG

Quote from: shannonrichards on September 28, 2023, 10:35:12 PMThat wouldn't happen. Despite the versatility of Arduino microcontrollers, commercial manufacturers tend to shun away from the device, because of the fact that it is a hobby grade microcontroller. It is therefore more viable to create and arduino based implement for your playing.
Many use Arduino for prototypes, and then put them into production.  I heard this from a VP at Microchip.  Microchip is the parent company of Atmel.  Atmel are the microcontrollers used in Arduino - there is nothing "hobby grade" about the microcontrollers.

IMH1234

Quote from: shannonrichards on September 28, 2023, 10:35:12 PMThat wouldn't happen. Despite the versatility of Arduino microcontrollers, commercial manufacturers tend to shun away from the device, because of the fact that it is a hobby grade microcontroller. It is therefore more viable to create and arduino based implement for your playing.

Well, the Linnstrument definitely is not a hobby grade instrument but we are sort of saying the same thing - No-one is going to produce a keyboard on this platform commercially at any scale because even if they get past the hobby grade stigma there are cheaper solutions that work fine. The point about prototyping makes sense but beyond that Arduino really is more suited to low volume specialist products that need bespoke processors like the Linnstrument.

I could see it being an option for someone looking to build a keyboard for their own enjoyment/learning/unique vision or a one off custom thing