MIDI Controller Shield for Arduino

Home :: Reviews of DJ equipment :: MIDI Controller Shield for ArduinoReply
MIDI Controller Shield for Arduino
Posted on: 19.03.2011 by Marlena Mouer
I've been working on a shield for an arduino mega that would simply plug into the arduino and give you the folllowing layout options: 4 led push buttons (purchased from Livid Instruments), Either 4 vertical sliders OR 2 vertical sliders with 6 potentiometers, and 4 encoders with indicator led (3mm or SMD). Additionally, the bottom of the PCB would have pin hearders to break out an additional 30 digital I/Os (4 PWM) and 6 analog. The idea is that you can easily plug a 4x4 arcade button group (ie midifighter) into the board and have a nice customizable controller thats easy to solder and avoids using multiplexing chips. I have yet to get some boards made and would like to gauge interest. Thanks.

6 pots with 2 sliders




4 sliders




view of arduino mega
Arcelia Siebeneck
03.04.2011
Originally Posted by DjNecro
What's the dimensions of the board? It may be an idea to try:

http://dorkbotpdx.org/wiki/pcb_order

It's $5 per square inch shipped... No setup fee's no nuttin.. 3 copies of your board too, in any colour you want (as long as you want purple)...

that looks just the job; would save me loads of wire/solder work if i can work out how to create a pcb for my diy controller.

got any recommendations for where to start? I should be using eagle right?
Cammy Clegg
30.03.2011
Originally Posted by bobsagat666
So adding a 16pin mux chip onto this design is going to require increasing the board size=more expensive to manufacture. So I have instead broken out some pins so I could easily make a very small breakout board that could be plugged in the bottom. Here is a picture.



As for midi in/out I would consider ordering a bunch of Atmega8U2 and programming them with the MocoLUFA firmware. However, the end user would have to desolder thier chip and solder on a header to allow swapping of the chips (which would actually be great reprogramming via usb). But would it just be easy to get an ICSP cable if you want to change the firmware in the future? Let me know what you believe, thanks!
anything that involves not alot of soldering
Marlena Mouer
24.03.2011
Originally Posted by safefire
I have a question, particularly concerning the MIDI implementation on the Arduino.
Do you do midi over usb? If yes, over the USB plug already present on the Arduni?

If yes again, how?

If no, how do you communicate via midi, a plug?

Thanks, and looking AWESOME. Keep it up!
Good question. Im currently using the pervious mega board so use a program called sterial to usb to get midi over the usb connection. The new mega boards have the ability to be reprogrammed as a midi device.
Marlena Mouer
03.04.2011
Yeah shipping to UK shouldnt be a problem. The dorkbot service is great! Ive used it once for some small boards and they were very good quality. This board is roughly 4x5" so that would equate to about 100/3 boards= 33ish a board? Hmmm not TOO bad.
Leila Longman
03.04.2011
Would you be willing to send some to the UK?

I would definitely buy if so.
Arcelia Siebeneck
03.04.2011
Originally Posted by DjNecro
What's the dimensions of the board? It may be an idea to try:

http://dorkbotpdx.org/wiki/pcb_order

It's $5 per square inch shipped... No setup fee's no nuttin.. 3 copies of your board too, in any colour you want (as long as you want purple)...

that looks just the job; would save me loads of wire/solder work if i can work out how to create a pcb for my diy controller.

got any recommendations for where to start? I should be using eagle right?
Louisa Oberc
02.04.2011
What's the dimensions of the board? It may be an idea to try:

http://dorkbotpdx.org/wiki/pcb_order

It's $5 per square inch shipped... No setup fee's no nuttin.. 3 copies of your board too, in any colour you want (as long as you want purple)...
Marlena Mouer
02.04.2011
While u do raise a good point the setup fees alone with a board this size make a 2 board run very expensize. Ive had pretty good luck on my other designs so I feel fairly confident. I would love some links to any services youd reccomend. Thx
Louisa Oberc
02.04.2011
For the sake of your wallet... DO NOT BUY 20 BOARDS out of the gate!!! D O N O T!!!

The last thing you want to happen to to spend a couple hundred dollars only to find out the board has an error

Get a small run of one or two boards, just to make sure the layout, traces, etc are all going to work...

That way you can make tweaks to the board and you're only out the cost of 2, not the cost of 20...


Re: code... I'll be more than willing and happy to help test things out for you... I don't have a mega, but I can figure out a way to test the board...
Marlena Mouer
02.04.2011
Ok so I'm believeing Ill order a run of about 20 of these boards and actually build up two of them (for testing). I believe the soldering would be easy (even for a beginner) as everything is through hole and you don't HAVE to solder all the pins for the arduino interface section. If everything goes well Id like to just sell the bare boards and will prob sell the two I build up. I'm trying to avoid soldering these to completion before selling as I believe this is a great DIY project but I may depending on interest. My biggest obstacle at this point will be optimizing the code (I have a bunch of sketches for the individual controls that I need to make into 1).
As this is designed for the user to build up and purchase their own arduino mega, would people want to buy MEGA boards with the USB MIDI firmware already flashed? This would mean you would have to get a ICSP cable to reprogram the board as you cannot flash over USB once the MocoLUFA firmware is uploaded (take away the serial interface that Arduino IDE uses).
Louisa Oberc
01.04.2011
Mostly just trial and error... Lots of searching the web, lots of reading... The Arduino Forums are an amazing resource so much brainpower available to be tapped

I had an advantage of already knowing how to code in C, but it's not that tough to pick up enough to do what you wanna do..
Maryanne Weatherill
01.04.2011
@DJnecro where did you obtain this wealth of Arduino knowledge?? The reason i ask is because im in first year electronics in college and we are learning Picaxe which is so uninteresting and id prefer to direct myself towards gaining some sort of knowledge of Arduino which i could actually use.

Thanks
Soledad Kipke
31.03.2011
This is brilliant. And $30? Sh*t yeah.
Cammy Clegg
30.03.2011
Originally Posted by bobsagat666
So adding a 16pin mux chip onto this design is going to require increasing the board size=more expensive to manufacture. So I have instead broken out some pins so I could easily make a very small breakout board that could be plugged in the bottom. Here is a picture.



As for midi in/out I would consider ordering a bunch of Atmega8U2 and programming them with the MocoLUFA firmware. However, the end user would have to desolder thier chip and solder on a header to allow swapping of the chips (which would actually be great reprogramming via usb). But would it just be easy to get an ICSP cable if you want to change the firmware in the future? Let me know what you believe, thanks!
anything that involves not alot of soldering
Marlena Mouer
30.03.2011
So adding a 16pin mux chip onto this design is going to require increasing the board size=more expensive to manufacture. So I have instead broken out some pins so I could easily make a very small breakout board that could be plugged in the bottom. Here is a picture.



As for midi in/out I would consider ordering a bunch of Atmega8U2 and programming them with the MocoLUFA firmware. However, the end user would have to desolder thier chip and solder on a header to allow swapping of the chips (which would actually be great reprogramming via usb). But would it just be easy to get an ICSP cable if you want to change the firmware in the future? Let me know what you believe, thanks!
Louisa Oberc
24.03.2011
nah man... it's not thaat tough.. once you get the circuit working, the rest is cake.... though not processing midi-in does leave the arduino more time for other stuff...
Arcelia Siebeneck
24.03.2011
I believe I'm just gonna end up using my Arduino for midi out in that case! All I really need it for is a bunch of pots (via a mux) and some digital buttons. The encoders and LEDS are being dealt with by a Highly Liquid CPU which has no problem dealing with midi in (obviously!).

btw - I just replied to your pm
Louisa Oberc
24.03.2011
Yep, midi-in can be a PITA if you don't know what you're doing going into it... There are LOADS of bad schematics out there, with a few good ones thrown in to confuse us.

The toughest part I found (having not much real electronics knowledge -- i'm all self taught) was finding a suitable optoisolator (optocoupler is another term). Without getting technical, they physically and electrically isolate two circuits from each other.

Standard rs232 serial is usually around +/- 10v (+10v being logical 1, -10v being logical 0), remember that MIDI is nothing but normal serial data running at 31,500bps. So if you were to plug the midi-out (or is it in? the direction naming scheme for midi is mighty confusing) FROM a midi device into the midi in on your arduino, you would be able to see the magic smoke that makes electronics work (in other words, you'd likely fry your chip).

Therefore you need a way to convert the rs232 serial into TTL serial which is simply 5v (5v for logic 1, 0v for logic 0... Cake!), normally the on-board FTDI usb->serial converter will handle this for you (and does when you're programming the board), so if you want to directly connect incoming serial (midi IS serial) to the arduino, you gotta do things yourself

Enter Optoisolators! They are a very very simple IC that consists of an infrared LED emitter, and a photo-transistor as a detector. The rs232 connects to the led side, and the transistor connects to your micro-controller. This means that the only 'connection' is the light path between the emitter and detector.

This is also where the problems are encountered... In order for the serial data to be valid timing is VITAL and the input/output timings of the IC is very important, too slow to turn on and it you will have problems, too slow to turn off, again... problems... Once you get the right chip (there's a bunch that will work fine) along with the right resistors (these are the root cause of issues, incorrect resistors and, yep! Problems...) everything is hunky dory... but with a ton of bad information out there it can be a little daunting to the novice (myself included).

Right now I have used 4n35's and find them to work just fine.. I have recently picked up a bunch of PC900v's which are the IC's stated in the official MIDI spec, but I have yet to try them out.

Sorry for the wall of text, but it's a fairly complex topic especially if you want to understand the why behind things...
Arcelia Siebeneck
24.03.2011
can't wait!

is midi in difficult no matter which of the 4 options you choose?

someone needs to sell a pre-programmed arduino that comes with everything you need to get midi up and running with little-to-no programming needed... (hint hint!)
Louisa Oberc
24.03.2011
There are three (well, four, but one is not suitable) ways of doing midi from an arduino.

One method uses the hardware serial ports available on the atmega chips (1 on the uno/etc, 4 on the mega) to send midi messages directly to whatever midi device you want. (usb->midi, midi thru box, midi keyboard, you name it... it's freakin midi! )

Another method would be to use a standalone usb->midi device, hack it apart, connect things and install it into your case... BAM! instant usb midi... (note that you will still use the previous method to send the midi--direct thru the hardware serial port, it's just directly connected to the midi->usb converter).

The third method can only be used on the newest arduino boards, uno's for sure, not 100% sure about the mega's (the ones that use a dedicated atmega8 chip as the usb->serial converter instead of the regular FTDI chip). Since they use a dedicated microcontroller, you are able to reprogram it for your own purposes. Someone has already made a port of LUFA that will work on these new arduino's.. I don't have a link right now, but a quick google 'arduino uno lufa' should bring it up.

The fourth (and not suitable) method is what you're using right now, which is a client running on your computer to translate the serial messages into midi messages. This adds SIGNIFICANT latency, to the point of being useful for debugging only, not for performance.

Feel free to ask more questions... I have some work stuff going on at the moment, but when I get a chance I can post working midi-in and midi-out schematics.

Midi-out is nothing but a pullup resistor and the correct wiring.

Midi-in is a little more complicated, as you need an optoisolator to convert the rs232 midi signal to a TTL signal for the arduino.

It CAN be done My current setup consists of three homebrew midi controllers (one of them is still on a breadboard) all with midi-in and out, with the code performing midi-thru functions to daisy chain them. They're all connected to a single m-audio uno midi->usb converter. They work flawlessly... ZERO latency... One of them has a bunch of leds responding to midi-in FROM traktor, one set (of eleven) is the crossfader position, and I have two more that flash in time with the beats (one per deck).

I will be posting something regarding that one, since it is the more complex of the two (I hacked the MF source into my controller so I could emulate the MF's 4 banks mode. Allowing me to use the instant gratification mapping. In addition to providing me a complete dual deck transport section.
Marlena Mouer
24.03.2011
Originally Posted by safefire
I have a question, particularly concerning the MIDI implementation on the Arduino.
Do you do midi over usb? If yes, over the USB plug already present on the Arduni?

If yes again, how?

If no, how do you communicate via midi, a plug?

Thanks, and looking AWESOME. Keep it up!
Good question. Im currently using the pervious mega board so use a program called sterial to usb to get midi over the usb connection. The new mega boards have the ability to be reprogrammed as a midi device.
Lewis Stumpf
24.03.2011
I have a question, particularly concerning the MIDI implementation on the Arduino.
Do you do midi over usb? If yes, over the USB plug already present on the Arduni?

If yes again, how?

If no, how do you communicate via midi, a plug?

Thanks, and looking AWESOME. Keep it up!
Cammy Clegg
23.03.2011
Originally Posted by bobsagat666
I hear ya on the addtional analouge channels so ill look into squeezing a multiplexing chip in yhere. im working on getting a prototype done so ill have an idea of price hopefully soon but I guess maybe 20-30 usd??
Bob how much for a built one? Im looking for a design to use to control traktors internal mixer.
Leonardo Papajohn
19.03.2011
Originally Posted by MiL0
depending on the price, I'd definitely be up for getting one.
same! :eek:
Louisa Oberc
19.03.2011
30 for just the shield I am assuming, not including components (faders, buttons, etc)?

I'd most definitely get some muxes in there... it would allow us to even further customize things...

Any plans on releasing the schematic/board files? (or more importantly, the sketchup components? i spent way too much time mocking up faders and buttons.. yours look great! )
Marlena Mouer
19.03.2011
I hear ya on the addtional analouge channels so ill look into squeezing a multiplexing chip in yhere. im working on getting a prototype done so ill have an idea of price hopefully soon but I guess maybe 20-30 usd??
Arcelia Siebeneck
19.03.2011
depending on the price, I'd definitely be up for getting one.

why the I/O limitations? would be useful to be able to use 16 analogues to cover 4 channels (3 eq and gain)...

any ideas on what you'd charge per shield?
Allene Manitta
19.03.2011
big up, on this!

been looking into the arduino scene, and most certainly like that crap!!!
Marlena Mouer
19.03.2011
Originally Posted by kilobytekaushik
does the controller module have a integrated midi shield? Otherwise it would still require coding for every module .
It is strictly a "breakout" board for the listed components that plugs into an arduino mega so you would program your sketch just like they were all connected via wire. Im just trying to streamline the process
Karry Sappington
19.03.2011
does the controller module have a integrated midi shield? Otherwise it would still require coding for every module .

<< Back to Reviews of DJ equipment Reply

Copyright 2012-2023
DJRANKINGS.ORG n.g.o.
Chuo-ku, Osaka, Japan

Created by Ajaxel CMS

Terms & Privacy