Go Down

Topic: Using USB to send sound signals (Read 368 times) previous topic - next topic

DavidWilh

This is going to be my first post on here so please let me know if i'm doing something wrong.

I want to make a reactive LED strip. I'm using a ws2812b led strip and i have it mounted behind my monitors. I have messed around with some standard light shows but now i want to make it reactive to sound. There is a catch though. I want it to receive the sound signal over USB and not by using a microphone wired up to the arduino. The board i'm using is an UNO.

I have done some googling, but i can't find any useful info. Does anyone here have any knowledge if i can even do this?

Thanks for any help!

Best regards
/David

wvmarle

Do the sound processing on the part of your kit that can handle it (i.e. your PC), send the results over the USB to the Arduino, and have it control the LEDs based on those commands.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

GoForSmoke

What will you use for software on the PC?
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

DVDdoug

#3
Apr 23, 2019, 05:11 pm Last Edit: Apr 23, 2019, 05:11 pm by DVDdoug
Quote
Using USB to send sound signals
Without going into all of the "difficulties", I'll just say, that's probably impossible with that the same time Arduino.   Plus, the computer would have to send digital audio to the Arduino plus a soundcard and without special software or drivers the computer can only use one "soundcard" at a time...


Quote
...but now i want to make it reactive to sound. There is a catch though. I want it to receive the sound signal over USB and not by using a microphone wired up to the arduino.
It's fairly common to send a line-level (or headphone level) signal to the Arduino, and you can easily "split" the signal, sending it to your amp and the Arduino at the same time.

Just to get you started take a look at my World's Simplest Lighting Effect.   ...It's a pretty boring "flicker" effect so it's mostly just an example but there is a schematic showing how to bias the input so it can read the negative-half of the AC audio signal.

USB can be useful if you have a "programmed show" with the same-exact music and same-exact lighting every night.    But if you want it to "react", an analog audio signal is the way to go. 

DavidWilh

Do the sound processing on the part of your kit that can handle it (i.e. your PC), send the results over the USB to the Arduino, and have it control the LEDs based on those commands.
That makes sense, do you have any tips on how i should go about handling it this way or any tips on where to look?

DavidWilh

What will you use for software on the PC?
I'm not sure what software to use as i'm brand new in the field. Do you have any experience with any software that can help me with my project?

DavidWilh

Without going into all of the "difficulties", I'll just say, that's probably impossible with that the same time Arduino.   Plus, the computer would have to send digital audio to the Arduino plus a soundcard and without special software or drivers the computer can only use one "soundcard" at a time...

It's fairly common to send a line-level (or headphone level) signal to the Arduino, and you can easily "split" the signal, sending it to your amp and the Arduino at the same time.

Just to get you started take a look at my World's Simplest Lighting Effect.   ...It's a pretty boring "flicker" effect so it's mostly just an example but there is a schematic showing how to bias the input so it can read the negative-half of the AC audio signal.

USB can be useful if you have a "programmed show" with the same-exact music and same-exact lighting every night.    But if you want it to "react", an analog audio signal is the way to go. 

I will give it a look, Thanks for the input. Tbh, I didn't think about using the line-out signal from my PC.

wvmarle

No experience with any PC based sound processing software.

First you have to figure out how you want your lights to react. What exactly should they react to? Volume, rhythm, pitch come to mind. Maybe others. You have to come up with very specific ideas as "reacting to music" is way too vague to even start turning it into something computers can work with.

Second step is to find software that can recognise this, and turn it into a specific command for your LEDs.

Now the easy part. Send that command to the USB port in plain text data, have the Arduino read it (there's a "serial communication basics" thread out here telling you exactly how that works), and control your LEDs accordingly.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

DavidWilh

No experience with any PC based sound processing software.

First you have to figure out how you want your lights to react. What exactly should they react to? Volume, rhythm, pitch come to mind. Maybe others. You have to come up with very specific ideas as "reacting to music" is way too vague to even start turning it into something computers can work with.

Second step is to find software that can recognise this, and turn it into a specific command for your LEDs.

Now the easy part. Send that command to the USB port in plain text data, have the Arduino read it (there's a "serial communication basics" thread out here telling you exactly how that works), and control your LEDs accordingly.
I have been messing with some ideas when it comes to the light show itself. I have some idea on how I should mess around with that piece of the code. There is also plenty out there that I can look at. I haven't found anything on the USB side of things, where all I have been finding is the standard ones with the microphone.

Do you know of any software that can do this?

wvmarle

As said no experience with such software. Audacity comes to mind, that can do all kinds of interesting things with audio. Maybe that's suitable for you.

Otherwise replace the microphone signal with a line signal. Mind the voltage level difference between the two.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

GoForSmoke

I'm not sure what software to use as i'm brand new in the field. Do you have any experience with any software that can help me with my project?
Nothing that makes COM outputs synchronized to sound.

PJRC has a sound suite to run on their ARM Teensies with audio DACs, it will likely run on a Due, you might do everything on one board with that.

If you can get the sound out of the PC into MIDI, Arduino can read those signals but I've not worked enough with MIDI to say how to get it to read sounds. MIDI is supposed to able to drive lots of leds according to one Arduino article I have read.

Since you're going to have to learn a lot to do anything, you might as well check out options.

Is it possible that the effects you want could be made as circuits driven by sound signal?
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

wvmarle

MIDI will only work if the original sound file is in MIDI format... but if the source is in MIDI (normal recordings are not) it should be very easy to sync LEDs to it, as MIDI is a kind of musical notation.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

GoForSmoke

If the sounds in this case could be sampled, and I have heard long samples before, a MIDI system could be used to control sound and lights/motors.

MIDI used to run on PC's, maybe still does. The old PC gameport is a MIDI port ready to connect. Now you get a USB to MIDI cable/hub/converter instead.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

DavidWilh

Nothing that makes COM outputs synchronized to sound.

PJRC has a sound suite to run on their ARM Teensies with audio DACs, it will likely run on a Due, you might do everything on one board with that.

If you can get the sound out of the PC into MIDI, Arduino can read those signals but I've not worked enough with MIDI to say how to get it to read sounds. MIDI is supposed to able to drive lots of leds according to one Arduino article I have read.

Since you're going to have to learn a lot to do anything, you might as well check out options.

Is it possible that the effects you want could be made as circuits driven by sound signal?
I'm currently open to a lot when it comes to the effects, I haven't decided exactly how I want my effects yet. I have some ideas though. But then again, I'm not married to them. Anything would be cool IMO. This is my first real project with my LED's. I already have a rainbow effect running but like I said, I want to make it sound reactive.

I will definitely have a look at PJRC though. I'm currently in the planning phase of it all, so I'm probably missing some components. (and some skill/knowledge)

GoForSmoke

Get or build a 3-way bandwidth splitter for both audio channels and you have 6 outputs the Arduino could read. That could connect directly to an MP3 player.

Make Magazine has run articles on making effects boxes for musical instruments, a reverb pedal that only reverbs the lights?

 
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

Go Up