Midi reactive Blinkstick Flex?


#1

Hey everyone,

So i recantly got my Blinkstick Flex and already used it so much :smiley: and I’d like to know if it’s possible to get a Blinkstick Flex Midi Reavtive (not sound reactive!)
For Example: You put C1 in your MidiClip in (for example Ableton) and then the first Led on the Flex turns on and the velocity of the midi note then decides in which color the led lights up?
Is that pssoible?
And which programmig Language should then be used?
Thanks in advance. :smiley:


#2

Yeah, that should be possible. You can probably use whatever you like, as long as your language support playing around with midi and the blinkstick. Honestly no idea how you’d go about doing that. There seems to be plenty of libraries for python that can read, play, and otherwise interact with midi files. Maybe you could use one of those, play the midi file, then somehow ask it which notes are active at any point then send the color info off to the blinkstick.

Like I said, not sure how you’d do it, but I’m pretty confident that it’s possible.


#3

Thanks for responding so fast :smiley:

I managed to get it working with midi and now know how to triggerd a led with midi inputs :smile: .
But i still wasn’t able to get just 1 Led to light up.
What im trying to say is that i havn’t found a way to control for example the 5th led on the strip without the 4 others before the 5th to light up.
Do you know how to do that?
(Everything in python 3.6)


#4

That I do know how to do. Not sure why multiple LEDs would be lighting up like that, it would also be helpful if we could see the relevant bits of code you’re using that’s doing that, but:

stick.set_color(0, index, r, g, b)

will do the trick just to set one color for one LED. But the blinkstick needs to have a little rest (about 20ms) between commands, so if you want to be setting multiple LEDs at the same time then there’s also this fancy command:

stick.set_led_data(0, data)

where data is just a big list of the colors you want. So if you wanted to light the first 3 LEDs up red, green, and blue you’d do this:

data = [
    0, 255, 0, # 1st LED red
    255, 0, 0, # 2nd LED green
    0, 0, 255 # 3rd LED blue
]
stick.set_led_data(0, data)

a good way to work with that would be:

data = [0]*stick.get_led_count()*3 # Create a list of 0s as big as the number of LEDs you have. We multiply it by 3 so we have an R, G, and B for each LED.

So if you had that, and you wanted to set the first and last LED pure white, you could do

data = [0]*stick.get_led_count()*3

i = 0
data[i*3:i*3+2] = [255, 255, 255]

i = 31
data[i*3:i*3+2] = [255, 255, 255]

stick.set_led_data(0, data)