Miniature Light (LED) Show

I am making a miniature diorama. In the diorama i would like the leds to put on a programmed light show in sync to music when a button is pressed. The music is played from a Raspberry Pi. My trouble is telling the lights to come on/off/dim at the right time. I cant figure out how to do this without delay, which I cant use because many leds have to do different things at different time. I read a lot about 'millis' but i cant figure out how to get that to work or even if thats the right direction to go. I also heard about timers but i dont know how to use them or even if their the right way to go.

-I also cant use external softwares like vixen to control the lights, it all has to be controlled in the arduino.

  • I am basically trying to do something like this - YouTube

Thank you so much if you can help! :slight_smile:

Very pretty, I must say :wink:

Yes, millis() is the way to go. The BlinkWithoutDelay example sketch contains all the information you need - you just need to expand that out to doing multiple LEDs.

You might want to look into arrays as well, and crafting animation sequences controlled by those arrays.

Before you get to how to program it, I think you need to solve the conceptual problem. In the video you linked to, I image somebody is pressing buttons off-screen to trigger the light changes. I can't think of an algorithm that would be able to automatically make the changes that were happening in that video. How do you know when the verse starts (the pattern changed to a chase pattern at that point)? Finishes?

So, what is your plan for the algorithm?

There are a few possibilities off the top of my head:

  1. Just do an EQ light show. At each point, measure the loudness of different frequency bands and set different light brightnesses accordingly.
  2. Do a chase pattern where the the next transition is triggered by a low frequency, high amplitude sound. i.e.: a bass drum detector.
  3. Randomly switch between the above two choices
  4. None of the above, in which case what did you have in mind?

That's not done by programming the lights one by one.

There will be an input device with an effect on each button/pad. eg. in the first part of that video the big lights pulse and the bottom lights change randomly. That would be one effect.

Then you have a person sat at the back who plays the lights like another instrument, tapping along to the beat. You can do it live or via MIDI.

That's the concept. That's what you need to recreate on the Arduino, not program individual lights

Cross-post merged, duplicates deleted.

Do not cross-post blah blah blah blah