So I made a simple midi controller since there was a discussion about midi in an arduinome, just wanted to see what would be involved. It’s pretty simple to make a stand-alone version.
Here is the schematic, very simple (Potentiometers can be any size):
![]()
Here is the the code. It’s stupid simple, it might be too simple. I don’t know if the delays have to be there but I didn’t want to spam the serial port, also this is just for 2 controls.
// Super Simple Midi Contoler int val = 0; int val2 = 0; void setup() { Serial.begin(31250); // Default speed of MIDI serial port } void loop() { val = analogRead(1)/8; // Divide by 8 to get range of 0-127 for midi MIDI_TX(176,1,val); // 176 = CC command, 1 = Which Control, val = value read from Potentionmeter delay(10); val2 = analogRead(0)/8; // Control point 2 MIDI_TX(176,2,val2); delay(10); } void MIDI_TX(unsigned char MESSAGE, unsigned char CONTROL, unsigned char VALUE) //pass values out through standard Midi Command { Serial.print(MESSAGE); Serial.print(CONTROL); Serial.print(VALUE); }
And here is a video:Now go make your own controller with photoresistors, pressure sensors, touch sensors, whatever!
Great!
This is very useful!
Thank you for sharing!
Happy to help, I’m working on a midi sequencer, that also sends a clock signal so it can be used for syncing.
Hey, I was wondering if the pots were noisy at all? I used a different method for an arduino midi controller (via simple messaging system and max) but the pots are really noisy.
I can’t say that I noticed they were, but you could use an array and read in a few values, then average them out.
cool!
what software are you using on the PC?
are you connecting the midi cable to which computer port?
i’m thinking about building a midi controller to use on lmms over linux, but perhaps i’ll use a PIC microcontroller instead..
I’m using ableton, but any thing that has midi capabilities will work. I’m using a midi 2×2 USB adaptor, this outputs actual MIDI communication.
I see.. perhaps I could use a usb to serial converter cable instead of the midi converter, since MIDI communications is serial, right? I think that would be easier and faster for me, because I already have the usb to serial cable 😛
Well there is a small freeware program out there that will take USB serial and convert it to midi that can be used by any software, only have to change the baud rate of the program and get the software. I’ll let you know when I’m not at work.
Thanks for sharing mate.
how would you go about exchanging the analogue input to a touch screen?
hi!
thanks so much for the schematic and code examples.
truly appreciated.
is there any reason the code couldn’t be modified to send
MIDI_TX(176,x,val);
to analog output x, x being bounded by the number of analog outputs on the arduino being used?
cheers