Go Down

Topic: HELP!! Control Anything on Arduino Using MIDI (Read 1 time) previous topic - next topic

Budgewink

Hi guys,
I'm trying to follow this guide on how to control arduino using a keyboard and midi output.
I'm gonna be honest that i'm completely new to Arduino, i've bought an UNO board and have the appropriate LED's but could use some friendly/helpful advice on which power supply cables and connectors etc I need to get this going.
I realise i'm gonna need a midi cable splitter as I need to record the midi into my computer as well as feeding it to the arduino.
If anyone can give me a ehlpful hand i'd be really appreciative.
Cheers!

Control Anything on Arduino Using MIDI

Grumpy_Mike

#1
May 30, 2019, 05:39 pm Last Edit: May 30, 2019, 05:45 pm by Grumpy_Mike
Quote
i've bought an UNO board
Well this is the wrong sort of board if you want to make the Arduino look like a MIDI device to a computer.

Assuming your keyboard has a 5 Pin MIDI output and not a USB MIDI output then you are going to need a MIDI shield, to convert the MIDI input into a serial input for the Arduino.

Quote
I realise i'm gonna need a midi cable splitter as I need to record the midi into my computer as well as feeding it to the arduino.
Not really, you just send what ever you receive to the MIDI out and connect that to your computer via a MIDI/ USB lead.

What do you actually want to control?

From that page they say:-
Quote
To demonstrate, I'm going to write the code for a basic MIDI visualizer that uses my favorite WS2812B addressable LEDs. The goal is to have LEDs on the strip correspond to different notes on the keyboard so they light up when a key is pressed, and turn off when the key is released.
This will only work at low speeds of key presses. When driving a WS2812 the interrupts are turned off when sending data. This means that any MIDI data received during this time is missed.

Budgewink

#2
May 30, 2019, 06:07 pm Last Edit: May 30, 2019, 06:08 pm by Budgewink
Hi, Thanks for your reply. trying to recreate the keyboard lights in this youtube users videos. inside info says he is using a custom arduino build running from the tutorial I posted.
He manages to achieve fast keyboard playing and good responsiveness with the LEDs.
https://www.youtube.com/watch?v=H1Dvg2MxQn8

Grumpy_Mike

Quote
He manages to achieve fast keyboard playing and good responsiveness with the LEDs.
No he can not physically do that. We have many people here who try that and they always drop MIDI messages.
What makes you think that is controlled with an Arduino using WS2812 LEDs? Certainly the "sparks" off it are not created with WS2812s.

Quote
inside info says he is using a custom arduino build running from the tutorial I posted.
What inside info?

Budgewink

Other people have managed to do the same or similar builds with success.
Everything on the top half of the screen is done with computer, everything on the keys is done with LEDs.

Grumpy_Mike

Well obviously you don't believe me so I am assuming that you don't want anymore help from me.

Good look with trying to recreate that video with WS2812 LEDs.

Budgewink

Well obviously you don't believe me so I am assuming that you don't want anymore help from me.

Good look with trying to recreate that video with WS2812 LEDs.
It's not about not believing you its about seeing the builds other people have managed. Maybe there something i'm missing in between the lines. Or not understanding a fundamental thing about the project. I appreciate any help of course as am a complete novice and just listening to anyone who is willing to shed light on this.
Thanks

Budgewink

would it sound right doing as such Mike....

Put the midi directly into the pc...Not splitting like I aforementioned
Then run "hairless midi", connect the arduino into the pc.
Powerwise a 5a 5v powersupply?

Grumpy_Mike

Quote
its about seeing the builds other people have managed.
And miss understanding what you see, and not believing me that you are miss understanding it.

Budgewink

#9
Jun 03, 2019, 05:10 pm Last Edit: Jun 03, 2019, 05:26 pm by Budgewink
No worries fella, and I do appreciate your expertise.
Would you recommend Adafruit NeoPixel instead of WS2812bs or would that encounter similar difficulties? or even APA102?
it's ashame because I've already bought 2 sets of WS2812bs ha.

Or maybe even abandoning the Arduino and buying a Raspberry pi like this guys setup...
https://www.youtube.com/watch?v=IZgYViHcXdM

Grumpy_Mike

Quote
Adafruit NeoPixel instead of WS2812bs
They are exactly the same thing.

Quote
or even APA102?
Yes the APA102 requires clock and data signals and can be interrupted given the correct library and configuration of it.

Quote
Or maybe even abandoning the Arduino and buying a Raspberry pi like this guys setup...
https://www.youtube.com/watch?v=IZgYViHcXdM
Having read through some of it on the Git Hub page his recommendation of how to drive the WS2812 LEDs from the Raspberry Pi is crap. It may work but often will not, the voltage from a Pi is not enough to reliably drive the LED strip. This is the crap page:- https://tutorials-raspberrypi.com/connect-control-raspberry-pi-ws2812-rgb-led-strips/

Now a Pi runs off Linux and that means anything over 6 months is considered very old and normally will not work. The code in this page is no exception. These days you have to load "Board Python" from Adafruit to get Neopixels running on a Pi.

But yes, you could do that on a Pi but not on an Arduino, but it is not the effect you saw before, just what he shows on the video.

The Raspberry Pi forum is here. https://www.raspberrypi.org/forums/

Budgewink

Thanks again for your valuable information Mike! :)
Can I ask if you were to try and undertake this project what would you use?

Grumpy_Mike

Just lighting the keyboard I would use the APA102 and the Arduino. However if you want that graphics display from the Pi that is the way to go. You can use the APA102 with the Pi as well there are a couple of libraries for that.

The thing I don't like about the Pi is the bother in turning it off. You have to do a shut down in code and then wait until the green blinking light stops blinking for about three seconds before removing the power.

Budgewink

I really don't need the graphics display, I assume I can eventually control colours etc from the PC itself from the script. Interesting you'd use the APA102's though.

Go Up