LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing lights with music

Solved!
Go to solution

Hello, I am a Undergraduate student doing a project which consists in me synchronizing lights with music using LabView. I am still learning LabView and don't have that much experience from it. Since I am pretty much told that I have to do the project by myself and the only thing that my university will help with is the equipment, I am kind of lost to be honest.

 

I would like to know if the LabView community could shed some light on how should I try this. I cannot use Arduino. At my disposal I have a USB-6000, USB-6009, USB-6341, USB-6002 and USB-6525. Some of these seem to bee designed to more complex tasks, however at the same time I can't pin how complex is to sync lights to music, so that is why I would like to also ask which one you guys suggest me. Also, this might sound a bit stupid but, is there an

 

Just to clarify a little bit more. I intend to make lights ''dance'' along the music. At the moment I still can't choose between led strip lights or Pixel led lights. I think the latter would make the project more complex, since I can make the lights have different colors and intensity (while the led strip would only have the same color and intensity through the whole strip). It also needs to have voice recognition and Bluetooth (So if any of you would like to recommend me a Bluetooth adapter or mic that you think would be the best choice for this, please do).

 

I would really appreciate any help. Thanks!

0 Kudos
Message 1 of 10
(244 Views)

There are lots of ways to do this but think about a "color organ"

 

  1. Use one of the DAQ's analog inputs to "hear" the music, then do some simple analysis on it
  2.  Apply a few filters (High pass, low pass, band pass)
  3. Take the outputs of the filters and compare them to a (variable) level. So you can adjust the sensitivity
  4. When the output if the filter is greater than the level light a Boolean indicator 
  5. Make that Boolean indicator also toggle a Digital Output that turns on a light
  6. Each DIO would trigger a different color light

 

As for Bluetooth it kind if depends on what you want to do with it. But the easiest I have used is the HC05 or HC06 BT boards. They are basically a BT serial port. So once you get them setup and paired with Windows they install a virtual serial port and become "transparent". Communicating with a device through them is no different than communicating with a device on a wired serial port.

 

Voice recognition is beyond my abilities

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 2 of 10
(198 Views)

Look into how much delay is acceptable for this kind of thing to work. You will need to read the audio info, process it, then update the outputs very quickly, which may not be "acceptable" for a Windows computer. It might be fine, I'm just not sure.

 

Also, there are built in "microphone" VI's that'll read from your computer's mic. That may help.

 

Another way to do what RTSLVU mentioned would be to run an FFT on the signal and convert the FFT to an RGB value. Individual filters might be easier to use though. You could convert a specific frequency band to each of R, G, B, mapping the magnitude of the signal to the magnitude of each color channel.

 

I do suspect you'll want to add a one-direction lowpass to the output of this. That way, sudden spikes in the intensity of a channel would cause sudden brightness increases to the R/G/B signal which would then fade out.

 

Imagine you just clap your hands once- what effect do you want the signal to have? A single blip when it gets loud? Or do you want them to get really bright, then fade down somewhat slowly? A lowpass would help with that, but you'd have to make sure you're only lowpassing loud->quiet, not quiet->loud.

 

And I'd VERY heavily recommend you use a single light to get started. You can always add more lights later once you get the code acting the way you'd like it.

0 Kudos
Message 3 of 10
(177 Views)

RTSLVU, thanks a lot for your answer!

 

Could you clarify a little bit your 3 point? I did not understand anything of that point.

 

How would choose that variable level? I could choose any frequency value and compare to that? Also, how would that help me with sensitivity? I am sorry if I am asking something that is obvious. I am literally a LabView beginner

 

One last question: Do you know how to make a equalizer graph that updates in real time as the music plays?

 

Once again, thanks a lot for you time!

0 Kudos
Message 4 of 10
(159 Views)

BertMcMahan, thanks a lot for your answer!

 

The light does not need to act at the right moment as the music play, I would say that a 1 sec delay is fine. In regards of audio info and processing it, what would you recommend me?

 

In regards to the microphone issue, I decided to leave it for a moment and focus on the "analyzing audio" part.

 

I will try to search some more about what you said about converting FFT signals to RGB value. This seems like it might be a good approach. Thanks a lot for that!

 

The lights are going to react only to the music, so they will not react to anything that the mic captures. So no, the lights would not blip if I clapped my hands.

 

I will also follow your advice and make my job a little less complex haha I will only use one light (at least until I fully understand how this project will work out).

 

Do you have any idea on how to make an equalizer graph that works as the music plays? Even using wavelenght charts just give me graphs that appears once the song has ended. It seems like it waits for all the song to be played so then it send the data to the wavelenght chart.

 

Thanks a lot for your time and answer! Honestly, just being able to solve of my doubts is a major help!

0 Kudos
Message 5 of 10
(155 Views)
Solution
Accepted by topic author Josevie

(I'm not RTSLVU but I'll try anyway...)

 

@Josevie wrote:

I am literally a LabView beginner


I'd recommend starting here: https://www.ni.com/getting-started/labview-basics/

 


@Josevie wrote:

 

One last question: Do you know how to make a equalizer graph that updates in real time as the music plays?


There may be some off-the-shelf equalizer (just google "LabVIEW Equalizer") but in general, LabVIEW is a full featured programming language. If you want something, you'll need to either write it all from mostly scratch or find a toolkit that does some of it for you. Maybe look for audio processing toolkits.

 

I will say, this is a very ambitious project for a LabVIEW beginner to take on. You need to break down your project into manageable steps. At the minimum, I'd break it into:

 

1- Acquire some data and show it on the screen

2- Learn how to process the data to give you some different parameters to work with

3- Display these parameters on the screen ("simulate" your LED strips)

4- Figure our how to control your lights with some simple pre-programmed sequences

5- Connect all of the above together

 

Unless you can find a toolkit, asking "How do I make a LabVIEW-based reactive light show" is like asking "How do I write a book about pirates?" It's not like LabVIEW is a visualizer program that you can add modules that automatically connect sensors and lights. It's much lower level than that.

0 Kudos
Message 6 of 10
(153 Views)

@Josevie wrote:

BertMcMahan, thanks a lot for your answer!

 

The light does not need to act at the right moment as the music play, I would say that a 1 sec delay is fine. In regards of audio info and processing it, what would you recommend me? There are some audio toolkits out there- google "LabVIEW Audio processing". I haven't used them myself. NI has a "sound and vibration toolkit" but its' probably overkill for you. You just need to get the audio file into an array, then you can do math on it.

 

In regards to the microphone issue, I decided to leave it for a moment and focus on the "analyzing audio" part. Probably a good call. Preprocessing a song will be a lot easier than trying it in real time.

 

I will try to search some more about what you said about converting FFT signals to RGB value. This seems like it might be a good approach. Thanks a lot for that!

 

The lights are going to react only to the music, so they will not react to anything that the mic captures. So no, the lights would not blip if I clapped my hands.

 

I will also follow your advice and make my job a little less complex haha I will only use one light (at least until I fully understand how this project will work out). Very good call, projects like this can often get overloaded with scope creep. I'd try to reduce it even further (no actual output, just on screen stuff) at first.

 

Do you have any idea on how to make an equalizer graph that works as the music plays? Even using wavelenght charts just give me graphs that appears once the song has ended. It seems like it waits for all the song to be played so then it send the data to the wavelenght chart. All indicators (including charts and graphs) will update when data is sent to them via dataflow. You'll have to break things up into shorter timed segments and update the graph continually.

 

Thanks a lot for your time and answer! Honestly, just being able to solve of my doubts is a major help!


Responses in red

0 Kudos
Message 7 of 10
(149 Views)

@Josevie wrote:

RTSLVU, thanks a lot for your answer!

 

Could you clarify a little bit your 3 point? I did not understand anything of that point.

 

How would choose that variable level? I could choose any frequency value and compare to that? Also, how would that help me with sensitivity? I am sorry if I am asking something that is obvious. I am literally a LabView beginner

 

One last question: Do you know how to make a equalizer graph that updates in real time as the music plays?

 

Once again, thanks a lot for you time!


Well you may not even need that, I was just thinking about the old Color Organs we used to build that were basically a 3-way speaker crossover network that each output drove the gate of an SCR. The volume of the music would set the over all sensitivity but each channel had its own sensitivity control.

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 8 of 10
(128 Views)

BerthMcMahan, once again, thanks a lot for your answers! Your last reply was specially helpful. Sorry for the late reply, I had 3 exams last week so I had decided to put this project to the side for a while and totally forgot to check this forum. 

 

Right now I am basically pretty much doing what you recommended me: trying to get an output (with that, I mean just screen stuff) and after that, I intend to go on to sync one light and try to implement more as I get more mastery. Once again, thanks a lot!

0 Kudos
Message 9 of 10
(61 Views)

RTSLVU, Thanks for the reply! Sorry for replying so late, I had 3 exams last week so I focused on them and totally forgot about this forum. 

 

To be honest, I think I still am too much of a beginner to make much sense about how you recommend me to set the sensitivity. You said that I might not really need it, so I will try to not focus much on that aspect for the time being. If later I see some problem related to the sensitivity of each channel or overall music sensitivity... Well, then I will have to dig a little more to make sense of stuff.

 

Once again, thanks for the reply!

0 Kudos
Message 10 of 10
(58 Views)