I am trying to create something that will allow me to control an individually adressable LED strip using an electric piano using its midi output.

Some things to note:

  • The piano can output midi either via USB or via standard midi connectors.
  • I have an Arduino Uno and an Arduino Mega available
  • I'm using a WS2812B strip with +ve, ground and data cables

I don't believe there's a way to read midi from my piano direct to the arduinos without reflashing the USB controller. For this reason I'm connecting via USB to my mac. On my mac I've written a program which reads the midi input and can understand it and send it on to somewhere else.

The arduino for the light strip I think I can program pretty easily but I have some questions:

  • If I need to power the LED strip, should I be powering it from the arduino power or giving it its own power source with common ground?
  • Is splitting it up into midi -> computer, computer -> arduino, arduino -> LED strip sensible? If not how should I be going about it?
  • Am I making life difficult by going the USB route for Midi or should I switch to midi connectors and connect direct to the arduino somehow?

closed as too broad by gre_gor, sempaiscuba, MatsK, per1234, Greenonline Sep 22 '18 at 17:30

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    the Internet is full of Arduino and MIDI. you can connect it directly. the MIDI protocol is very simple. arduino.cc/en/Tutorial/Midi – Juraj Sep 17 '18 at 20:04
  • @Juraj you'd suggest going the route of using 5 pole MIDI cables then rather than USB? – Jon Taylor Sep 17 '18 at 20:08
  • of course. you glue the LED strip to a Jan Hammer style piano and where do you put then the MacBook? – Juraj Sep 17 '18 at 20:12
  • @Juraj Little bit confused. As I said in the question I'm currently connecting the piano via USB to the macbook and using software I've written on there to read the MIDI data. Just trying to figure out the best way to connect it all up given I have very little knowledge of electronics. I'm normally just a software developer. – Jon Taylor Sep 17 '18 at 20:15
  • but you know the Keytar? if you programmed the midi for computer, it will be simpler to write it for Arduino – Juraj Sep 17 '18 at 20:23

I did some time ago something very similar, except not using USB, and on an STM32 (Arduino compatible STM32F103C8T6), but the principle is similar.

Regarding another MIDI test I did on an Arduino, I used the 47 Effects library and for the WS2813 (software-compatible with WS2812B) the FastLed library.

One MIDI port is easy to use (supported by 47 Effects), which uses the single UART of the Arduino UNO.

You have to write a small program to convert the MIDI notes to WS2812 LED data, which is not much more than filling in a structure. Mapping 61 or 88 notes to 30, 60 or 144 LED notes is not so easy, just clip the notes, or use some mapping factor.

You cannot use the Arduino for powering the LED strip, use a separate adapter for that. Only the line signal comes from the Arduino, and connect GNDs together.

The Arduino should be fast enough to both read MIDI, translate it to LED data (unless you make some very time consuming algorithm) and send the data.

Not the answer you're looking for? Browse other questions tagged or ask your own question.