Led bar

Status
Not open for further replies.
The LEDs are not particuarly difficult, the tricky part would be the code to parse music to lit pixels.

There are a number of ways to light the keys, either addressible LEDs like WS8211/neopixels https://www.adafruit.com/product/1376 or using shift registers https://www.pjrc.com/teensy/td_libs_ShiftPWM.html. What will be potentially tedious is getting the spacing right. You can get cheap LED strips/bars in various flavours but matching a piano keyboard spacing will take some experimentation unless you are really lucky. An ugly way to do it might be a wide spaced (30 leds a meter) addressible strip and fold/bend the strip onto a marked base to get whatever the spacing you want. Otherwise it's some very tedious soldering.

Next step would be working out which LED to light. If you have PC side code that already does that then you can just send USB serial data but assuming you don't you either need to manually transcribe it, or make a MIDI 'instrument' that plays lights instead of sounds. https://www.pjrc.com/teensy/td_libs_MIDI.html
 
I don't have a problem with the music part nor the MIDI messages
My question is what led model to choose and how to connect them to be able to power from USB 176 leds and decide what led to light !
From your documentation, 30 RGB leds are using 2A ! too much for usb
ShiftPWM is nice too, but ... how many can be connected, and the power from usb? ...
 
Lots of any LED will be power hungry no matter how you slice it. WS2811 are cheaply designed so worse than most but if you want to light all 176 LEDs at 10mA (not that bright) that will still be 1.76 Amps.

Key here is how much light(current) you want and how many will be lit at once. In your case I'm assuming you won't have more than 10 keys lit at once and not at full brightness, so the current demands are much lower. Of course during your testing phase DO make sure you have enough power to light all the LEDs for the inevitable software error that glitches them all on. Once your code is working you can go back to the USB 500mA limit with reasonable confidence.

I don't think you are after more options but the really cheap way to do this is charlieplexing https://www.evilmadscientist.com/2010/on-the-design-of-the-bulbdial-clock/ but unless you are up for a custom multi layer PCB design not an easy way to do this.

Going back to your original question if you are new to the electronics end of things the addressable LED route may be easiest, since you just have a numbered array of LEDs so your code is mapping numbered MIDI notes to pixels using some form of offset and the wireing is very basic (one or two signal wires ). You are possibly overthinking this, since you really want to break this down into stages something like:
Basic bread board 20 note version, with one ordinary LED+resistor per pin to get midi working
Modify breadboard version to try different light control methods (strips, shift registers, charliplex, whatever else works)
Modify code to actually work to play music, note just notes (displaying note length, experiment with how to cue next notes ahead in time)
One or more shortened versions matching actual key spacing to try different methods to make a long thin set of LEDs
A full width version that will most likely be hairball in some way or other that proves you can make this full size
The sleek minimalistics version you are actually seeing in your head.

This all takes a lot of versions but breaks things down into manageable steps, and you can get started for the cost of a Teensy, or any other midi capable micro and a bag of resistors and LEDs.
 
I'd suggest starting with a strip of WS2812s, simply because they are so easy. That way, you can get a good start on the project and begin to tackle the work of interfacing them with the music score.

When they're off, each uses 1 mA. Presumably you're not going to turn on more than 10 at a time, right? So 87 off at 1 mA each and 10 on at 15 mA means about 237 mA for the LEDs. That's too much for an unpowered USB hub, but should be fine if plugged directly into a PC or a hub with power.
 
Status
Not open for further replies.
Back
Top