Author Topic: Real Time Lighting Project  (Read 6356 times)

Offline csf

  • Sr. Member
  • ****
  • Posts: 118
Re: Real Time Lighting Project
« Reply #30 on: April 05, 2012, »
Thanks all for the offers to beta test! Looking forwards to getting a version of this out for public use!

Offline rwave

  • Sr. Member
  • ****
  • Posts: 555
Re: Real Time Lighting Project
« Reply #31 on: April 05, 2012, »
Quote
Real Time = Instead of playing a song you can attach you mic / line in and the lights will respond to what ever comes in. (Only main Beat detection works in the mode).

Can you briefly explain how you detect the "main" beat?  Do you use an FFT algorithm and display the instantaneous dominant frequency at the given sample rate or . . . ?  I'm trying to envision what a display might look like if I used Tchaikovsky's "1812 Overture" or Pachelbel's "Canon in D".

Richard (from SoCal)   :)

Offline csf

  • Sr. Member
  • ****
  • Posts: 118
Re: Real Time Lighting Project
« Reply #32 on: April 07, 2012, »
Since originally posting that, I got all beat detection working with both audio files and mic / line input.

There are two different algorithms at work in this program.

The main beat detection is based off of spikes in the audio level.

Then I have frequency detection that makes use of FFT that detects sounds in a cretin frequency range. Right now I have them set up for low, mid range and, high frequencies.

Using all four of the above beat detection values along with some additional logic makes the designees shown in the last video.

I am not sure how it will respond with classical music since I have yet to try it, but its something I can try.

Offline rwave

  • Sr. Member
  • ****
  • Posts: 555
Re: Real Time Lighting Project
« Reply #33 on: April 07, 2012, »
THANKS for the info.

You are further ahead than I in this endeavor, as I am still in "thinking" mode.  The classical music mentioned is a type of "stress" test for my ideas; if the display works for this music, it should work for most holiday music as well.

My current thinking is to use many more frequency "buckets".  One way is to use the MSGEQ7 Graphic Equalizer Display Filter, an incredibly easy chip to interface to a micro-controller (uC).  For even more buckets, an FFT algorithm seems to be the method of choice, as you have incredible control over the number of buckets and frequency range.  Using another uC, you can do further filtering and control, especially if an RGB string is used.  Seems like a fun project; I only need to find the time!   ;D

Richard (from SoCal)   :)

Offline csf

  • Sr. Member
  • ****
  • Posts: 118
Re: Real Time Lighting Project
« Reply #34 on: April 08, 2012, »
You are not allowed to view links. Register or Login
THANKS for the info.

You are further ahead than I in this endeavor, as I am still in "thinking" mode.  The classical music mentioned is a type of "stress" test for my ideas; if the display works for this music, it should work for most holiday music as well.

My current thinking is to use many more frequency "buckets".  One way is to use the MSGEQ7 Graphic Equalizer Display Filter, an incredibly easy chip to interface to a micro-controller (uC).  For even more buckets, an FFT algorithm seems to be the method of choice, as you have incredible control over the number of buckets and frequency range.  Using another uC, you can do further filtering and control, especially if an RGB string is used.  Seems like a fun project; I only need to find the time!   ;D

Richard (from SoCal)   :)

Do you know how to program? Chances are after I build the base, beta test, and document the code, I am going to release this as open source.

Offline smeighan

  • Patron Member
  • Sr. Member
  • ****
  • Posts: 2285
    • Nutcracker RGB Sequence Builder
Re: Real Time Lighting Project
« Reply #35 on: April 09, 2012, »
You are not allowed to view links. Register or Login
You are not allowed to view links. Register or Login
THANKS for the info.

You are further ahead than I in this endeavor, as I am still in "thinking" mode.  The classical music mentioned is a type of "stress" test for my ideas; if the display works for this music, it should work for most holiday music as well.

My current thinking is to use many more frequency "buckets".  One way is to use the MSGEQ7 Graphic Equalizer Display Filter, an incredibly easy chip to interface to a micro-controller (uC).  For even more buckets, an FFT algorithm seems to be the method of choice, as you have incredible control over the number of buckets and frequency range.  Using another uC, you can do further filtering and control, especially if an RGB string is used.  Seems like a fun project; I only need to find the time!   ;D

Richard (from SoCal)   :)

Do you know how to program? Chances are after I build the base, beta test, and document the code, I am going to release this as open source.

Have u looked at widi recognition system?

This is a tool that takes an mp3 as an input and then changes it into a midi file. You are not allowed to view links. Register or Login

It was original written in 1998 , so 14 years old. I came across forum entires where they were going over the detection methods they use for beat detection and the fft they use to get dozens of channels out of music.

I tried their demo on different mp3s. some worked ok, some not so good. The issue is the timbre of the music that is all mixed together. Think of clarinets, flutes, trumpets, strings all playing together. Now try and detect the 3rd clarinet part out of that mp3, not quite yet.

 They are making progress and i do foresee a time when it will be a great asset.

This takes me back 20 years to those boxes radio shack had to connect to your stereo so they would turn lights on to the beat of the music.

Your tool looks very promising.





Sean
Littleton, CO
Latest releases You are not allowed to view links. Register or Login
xLights/Nutcracker Forum You are not allowed to view links. Register or Login
Fbook You are not allowed to view links. Register or Login

Offline rwave

  • Sr. Member
  • ****
  • Posts: 555
Re: Real Time Lighting Project
« Reply #36 on: April 09, 2012, »
Quote
Do you know how to program? Chances are after I build the base, beta test, and document the code, I am going to release this as open source.

I do.  I will be interested in seeing your approach in action.  Many approaches have been previously implemented in "color organ" design; I have always felt that a software FFT with a few additional uC filters may allow for a better display to a broader range of music.  I believe trying to detect too many instruments simultaneously creates a very busy display and may be less visually satisfying.  YMMV.

Richard (from SoCal)   :)

Offline csf

  • Sr. Member
  • ****
  • Posts: 118
Re: Real Time Lighting Project
« Reply #37 on: April 14, 2012, »
You are not allowed to view links. Register or Login
You are not allowed to view links. Register or Login
You are not allowed to view links. Register or Login
THANKS for the info.

You are further ahead than I in this endeavor, as I am still in "thinking" mode.  The classical music mentioned is a type of "stress" test for my ideas; if the display works for this music, it should work for most holiday music as well.

My current thinking is to use many more frequency "buckets".  One way is to use the MSGEQ7 Graphic Equalizer Display Filter, an incredibly easy chip to interface to a micro-controller (uC).  For even more buckets, an FFT algorithm seems to be the method of choice, as you have incredible control over the number of buckets and frequency range.  Using another uC, you can do further filtering and control, especially if an RGB string is used.  Seems like a fun project; I only need to find the time!   ;D

Richard (from SoCal)   :)

Do you know how to program? Chances are after I build the base, beta test, and document the code, I am going to release this as open source.

Have u looked at widi recognition system?

This is a tool that takes an mp3 as an input and then changes it into a midi file. You are not allowed to view links. Register or Login

It was original written in 1998 , so 14 years old. I came across forum entires where they were going over the detection methods they use for beat detection and the fft they use to get dozens of channels out of music.

I tried their demo on different mp3s. some worked ok, some not so good. The issue is the timbre of the music that is all mixed together. Think of clarinets, flutes, trumpets, strings all playing together. Now try and detect the 3rd clarinet part out of that mp3, not quite yet.

 They are making progress and i do foresee a time when it will be a great asset.

This takes me back 20 years to those boxes radio shack had to connect to your stereo so they would turn lights on to the beat of the music.

Your tool looks very promising.

Thanks I did not know about that, I will take a look.

You are not allowed to view links. Register or Login
Quote
Do you know how to program? Chances are after I build the base, beta test, and document the code, I am going to release this as open source.

I do.  I will be interested in seeing your approach in action.  Many approaches have been previously implemented in "color organ" design; I have always felt that a software FFT with a few additional uC filters may allow for a better display to a broader range of music.  I believe trying to detect too many instruments simultaneously creates a very busy display and may be less visually satisfying.  YMMV.

Richard (from SoCal)   :)

From my experiments the real trick to making it look good is how what you do between beats and how you respond to when there is a beat.

Lets take my first video of the spot light, its much simpler to explain the logic.

If I get a beat I turn the intensity up full, then each frame of no beat I decrees the intensity until I hit my low intensity limit that  I stop decreasing Intensity at. Now if I am at a mid intensity and a new beat comes in I keep the same color. If I am at my low limit intensity and a new beat comes in I change the color and make the intensity full power.

If you just do a hard on / hard off to each time you get a beat I am not a fan of the results. Its just to spartic for my taste.

Offline rwave

  • Sr. Member
  • ****
  • Posts: 555
Re: Real Time Lighting Project
« Reply #38 on: April 14, 2012, »
Quote
From my experiments the real trick to making it look good is how what you do between beats and how you respond to when there is a beat.

Lets take my first video of the spot light, its much simpler to explain the logic.

If I get a beat I turn the intensity up full, then each frame of no beat I decrees the intensity until I hit my low intensity limit that  I stop decreasing Intensity at. Now if I am at a mid intensity and a new beat comes in I keep the same color. If I am at my low limit intensity and a new beat comes in I change the color and make the intensity full power.

If you just do a hard on / hard off to each time you get a beat I am not a fan of the results. Its just to spartic for my taste.

One of the best analog implementation I have seen can be found at You are not allowed to view links. Register or Login. Take a look at their 20-channel implementation, using discrete, sharply tuned filters for each color channel.  They chose rings for the visual pattern of each channel (a uC can define any desired pattern, changeable at any time) and cleverly interleaved adjacent channels for a more visually enjoyable experience.  You can view various audio demos (look at "Vivaldi Concerto for Two Recorders").

At any instant in time, an FFT will identify numerous active channels.  A uC allows you to decide which of the active channels will be displayed and at what intensity.  In addition, you can control the sample rate, thus determining how active your display becomes.

My initial thinking was to merge a color organ and RGB matrix, thus allowing short passages of the show to free-run in color organ mode before switching to RGB matrix mode, sequenced in the normal manner.

Richard (from SoCal)   :)