LED program for a song set

Hey all. I've been researching ways to get led lights to flash to my band's songs as a stage prop. My problem is all controllers I've found have terrible response to the music whether I use the controller's on-board Mic, or an aux in. So I decided to try and find a way to make a program for these led lights to run on. Currently, I have some 10w, 9-12v white leds.

I'm wondering exactly how doable it would be to write a program where one or two leds would simply flash at the songs beat, (sometimes double for effect), or otherwise program the change of the flash to any tempo changes. All that for one song of 5-7 minutes. Would it be possible still to store the data for multiple songs and it would run the next song's program with the push of a button?

If it matters to you, the leds well be put in a box with a momentary pressure switch. Stand on the box, the lights come on. If the program is always running, I won't need to choreograph exactly when to go stand on the light box. I go when I want to, and it's running to tempo already for me.

Thanks for the insight!

I'm wondering exactly how doable it would be to write a program where one or two leds would simply flash at the songs beat

Well, first you need to get the beat. How are you planning to do that? The rest is easy.

You could make an opamp circuit that would light the led every time a level (sound through mike or electric from the amp) is exceeded. Direct signal from instruments and mics are then your input and you won't need a processor so much as a EE to go over and make sure nothing burns or blows up.

Assuming you have a drummer, stick the sound-activation mic in front of the kick drum....

Would it be possible still to store the data for multiple songs and it would run the next song's program with the push of a button?

It's possible, but not really practical unless your drummer is playing to a click track with the click-track synched to the lighting.

You can search for "beat detection". People have done it. I've made a crude beat detection algorithm... I've got to get back to work, but for now... One of the tricks I used was to make sure the beat detection wasn't re-triggered too fast... It's limited to about 5 times per second.

And, I think it's boring if the lights flash exactly to the beat 1-2-3-4... for a long time... In fact, almost any single-effect gets boring before the song is over!

My thought was I could simply say "flash at 120 bpm for x minutes and xx seconds, then change to 100 bpm for x minutes" or just have it keep a clock and it can flash so fast until it reaches 2.30, then change.

As for beat detection, we do have both bass drums mic'd up, and I can run an audio signal from the house mixer, carrying just the kick audio. Powering the led straight from that has resulted in blown leds haha. I woulda need to figure out how to sry up a thing that says "flash when this threshold is passed".

I use a msgeq7 to analyse the music. It splits it into 7 frequencies and tells you how strong each of those frequencies are at that moment. It does that realllly fast. It runs a ledstrip in my room (red - bass, green - midtones, blue - high tones)

Chradke:
My thought was I could simply say "flash at 120 bpm for x minutes and xx seconds, then change to 100 bpm for x minutes" or just have it keep a clock and it can flash so fast until it reaches 2.30, then change.

As for beat detection, we do have both bass drums mic'd up, and I can run an audio signal from the house mixer, carrying just the kick audio. Powering the led straight from that has resulted in blown leds haha. I woulda need to figure out how to sry up a thing that says "flash when this threshold is passed".

Don't use mics. Use acoustic pickup piezo discs. Arduino can read these, you can tune thresholds with pots and transistors as long as the chip pin never sees more than 5V, easy to do.

Pickups get signal from the instrument they are glued (screwed or tattooed?) on without much else.
You can set it up so that each pickup has different lights or combinations it triggers.

Be real careful that you can't possibly flicker at seizure inducing frequencies! All flashes at least some duration!

If it matters to you, the leds well be put in a box with a momentary pressure switch. Stand on the box, the lights come on. If the program is always running, I won't need to choreograph exactly when to go stand on the light box. I go when I want to, and it's running to tempo already for me.

My thought was I could simply say "flash at 120 bpm for x minutes and xx seconds, then change to 100 bpm for x minutes" or just have it keep a clock and it can flash so fast until it reaches 2.30, then change.

You can do that, but the lights will be setting the tempo (like a click-track or metronome) and the lights will have to start before you count-in. (Or, you could have a small LED that you or the band can see before count-in and hit the "big lights".) That's a "big decision" if you want the lights leading the band...

You wouldn't need to program-in the 2:30 time if you simply stop the effect with a foot switch.

That's all fairly easy. It's just the Blink LED sketch with variable timing. But, you'd have to come up with a user interface concept... Do you want to simply turn a knob to set the tempo? Do you want a rotary switch or pushbuttons to set common tempos? If you have a continuously variable knob, do you want an LCD display to show the actual tempo?

Powering the led straight from that has resulted in blown leds haha.

At some point, we'll need to talk about your hardware... There's no need for the LED to go over "100% brightness" no matter how loud the signal is. I know you are not powering a 10W LED directly off the sound board. You could power (and blow) a regular LED from you speaker outputs. And hopefully, you'd have a current-limiting resistor so you don't blow the amp when the LED dies and shorts-out! :smiley:

I woulda need to figure out how to sry up a thing that says "flash when this threshold is passed".

Once you are detecting "loudness", that's just an if-statement in your software.

One of the simplest effects I've built is a "flicker effect" that turns the LED/light on when the signal is higher than average and off when it's below average. For the average, I save one reading per second in a 20-element [u]circular buffer[/u]. This works great since it's on half the time (whenever the signal is above average) and off half the time (whenever the signal is below average) and it automatically adjusts to the volume. To keep things interesting, this effect is randomly "inverted"... That is, loud sound turns the light off and quiet sound or silence turns it on. (All of my lighting effects are randomly inverted.)

This effect should work well with a kick-drum, but you might have to add a 100mS or 200mS delay if you don't want a quick-flash with every drum hit. (Because of the nature of the drum sound, it probably won't be on half of the time.)

one or two leds would simply flash

Another of my effects is a "toggle" effect with two lights on opposite sides of the stage (I'm using 90W halogen floods). One light is on while the other is off and it toggles back-and-forth (approximately) with the beat. There's also an option where the toggle speed is determined by loudness (again with reference to that 20-second moving average).

Beat detection - I'm not going to give you my beat detection code because it's intermixed with other code, and like I said, it's "crude"... Sometimes it misses a beat and sometimes it's triggered when there's no beat.

The basic concept is this: First, there's a delay (200mS, I think) after the last beat. That's just some extra logic to keep the triggering realistic... I don't want to detect 500 beats per minute... Then, I look for a "peak" that's the same as the highest level in my 20-second buffer.* If a beat isn't triggered right-away, I start ramping-down the trigger threshold over the next couple-hundred milliseconds... In other words, the longer it takes to trigger a beat, the more sensitive it gets.

Like I said, other people have made beat detectors so you might want to look for a better one. IMO - A better one would be more like the way a human taps his/her feet to the music... You "get in rhythm" and anticipate the next beat... You don't wait 'till you hear the next beat before you tap your foot. :wink:

  • I use a [u]peak detector circuit[/u] with an R-C time constant of about 100mS. This gives a varying DC voltage that tracks the volume. I can read the "volume" signal at about 10 times per second (or faster) and I don't have to read the audio waveform thousands of times per second.

That also means my 20-second average is not a true average, but it's an average of short-term peaks and it works OK as a reference. Some of my effects use the average as a threshold/reference. And, some effects use the highest peak in the past 20 seconds. Again, it's a peak but it's it's not the true peak, because I'm only saving samples once per second.