1. Overview
This is an example project for getting Arduino to work as MIDI device. There is three buttons to trigger notes and one potentiometer to control change. It's been tested on Win 7 x64, however should work on x86 and older system versions.2. Shopping list
- Arduino board
- Breadboard
- Push buttons (each button for controlling one note)
- Rotary potentiometer (for CC - Control Change), code on mine says "B50K", but most should work
- 10k resistors for push buttons connection
- Some wires, USB cable to connect Arduino,
- Optional: some Lego Technics for push buttons & potentiometer base + masking tape to keep things steady
3. The plan
4. Software
- Arduino MIDI Library - get v3.2, copy files to Arduino/libraries
- LoopBe1 - virtual MIDI cable
- Hairless MIDI<->Serial Bridge - used to read serial data from Arduino and send it to virtual MIDI device
- DAW or other music software to make some noise:) (on video I'm using new generation tracker - Renoise. Ableton Live, Cubase or any will do)
5. Arduino Code
Get the code6. Wire it up
- Start LoopBe1 (tray icon)
- Open music software, go to preferences and select LoopBe1 as MIDI input device
- Open Arduino editor, connect board and upload program
- Open Hairless MIDI, select Arduino COM port (i.e. COM4), check "Serial<->MIDI Bridge On"
- That's it!
7. References
I used following resources to make this working:
Superb tutorial, thanks - this is by far the easiest one to understand that I have been able to find, and lots of comments in the Arduino code for the modifications that I needed. Thanks so much!
ReplyDeleteThank you!:)
DeleteVideo is private, please correct
ReplyDeleteThere you go (sorry for the delay)
DeleteHello! Thanks for the tutorial!
ReplyDeleteBut i have a problem...
I've connected my arduino UNO via usb to my pc, and used your code and libraries, but almost always, hairless show me this message...
"+176.52 - Error: got unexpected data byte 0x1." (the byte changes with the movement of the pot), and a very few times, the program reads a correct midi data...
I have only the pot connected to my arduino...
Hmm.. Hard to say. But you get it working sometimes and sometimes is error?
DeleteThanks so much for this - just what I was looking for. Very clear tutorial and very clear comments in the coding making it easy for me to understand and modify. Champion!
ReplyDeleteThanks, I'm really glad to hear it could help people :-)
DeleteHi! Really nice tutorial and code. Cant wait to get this up and working. Problem is, everything works beside getting daw to receive midi. Hairless recognize and gives me signal everytime I push the buttons, I send the signal to ipMIDI Port 1 (which is the updated version of LoopBe1, and everything seems ok. In Ableton Live I choose ipMIDI port 1 as a midi input, but it dont receive any data at all. Do you know what could be the problem?
ReplyDeleteWhen I for example push a button while having the "Debug MIDI messages" checked, it says Serial In: Ch1: Note 55 on velocity 127. So I dont understand where the problem is.
DeleteIt looks like there's an issue on live..
DeleteThank you for reply. I just found the reason, and of course it was a scenario of me being silly. The problem was that IPMidi had been turned off because I just have the demo. Now everything seems to work. Again, thank you for beautiful code.
DeleteHi! this is so helpful!!! But how to put more pins?
ReplyDeletethank you :)
https://www.google.ie/search?q=arduino+shift+register+74hc595&ie=UTF-8&oe=UTF-8&hl=en-ie&client=safari
ReplyDeleteIt's possible to use midi out connector?
ReplyDeleteYes, it is, but not exactly like in this example. Check out Arduino MIDI library, it comes with code snippets
DeleteIt's possible to use sanwa buttons???
ReplyDeleteI cant set it in cubase 8 LE
ReplyDeleteDear friend how to exit audio, which pin used.
ReplyDeleteIt's only for Midi, your synthesiser is responsible for producing sounds
DeleteThank you, everything works but I have a problem. I'd like to add more potentiometers, I did it but when I add the second one it's not stable because it changes continuously the note. In other words I assigned to the first potentiometer the command MIDI.sendControlChange(1, analogValue1, 1); and to the second MIDI.sendControlChange(2, analogValue2, 1); but in this mode the first potentiometer works correctly but the second one is unstable.
ReplyDeleteAny advice?
It's been a long time since I did that but as far as I remember there will always be some fluctuation in analog reading, however if it's large I'd look at the hardware first and maybe swap potentiometers and observe if they act the same way...
DeleteHave you tried the ESP32? It can do a lot more than Arduino with BT/BLE and WiFi built in, for cheaper than an UNO board. I can talk to my esp32 with my AI App and BLE using Koban's Arduino ESP32 BLE lib and the BLE extension in AI. I want to go direct to the ESP32 and wire a MIDI port to it. Another guy has begun to put the ESP32 harddward and MIDI lib part of this together and the the ESP32 hardware has a two good DACs and libs for most sound formats to output to external DACs so it can turn MIDI into wav output to file, web or a pins. I saw your post in the AI forum where I have posted about MIDI.
ReplyDeleteGreat tutorial.. i have some problem, whenever i connect to hairless, it always show 127 and 0 velocity randomly even i unplug all the wiring from arduino... can you help me?
ReplyDelete