Music controlled devices.

I would like to use the arduino to control not only some leds but other devices based on audio input. I am going to start with leds to keep it simple as I figure out how to do it.

I’ve seen VU meter and spectrum analyzers for the arduino. However, everything I have seen has a computer that processes the audio and sends commands to the arduino over serial.

I want to cut out the computer if possible. What I would like is something that takes stereo audio and mixes it into mono. I am not going to deal with stereo right now. Then using filter circuits connect a low, mid and high line to analog pins on the arduino.

I would like to know if this is a possible and how to make the circuits needed.

It is not really possible to digitize music with any great quality on the arduino. You can do small snatches as a sort of demonstration but it simply hasn't got enough memory / computing power / A/D resoloution to do anything seriously. For what can be done look at:- http://interface.khm.de/index.php/labor/experimente/arduino-realtime-audio-processing/

I am not trying to digitize music. I am trying to have music control stuff.

Let's make a simple example. Let's say I want to make a 3 band VU meter using the arduino, but without a computer doing the processing and sending commands to the arduino. The arduino will have three leds for each filter - bass, mids, highs. The music will drive how bright the led is.

I figure the arduino itself cannot take audio input and do the processing - if it can it might be too much for it. So I figure there would be a way to take audio and using band pass or other circuits to feed a single for bass, mid, and high into the arduino that can be read and processed. If the base input is at mid-strength the led is half as bright.

I'm not an electrical engineer, nor an audio circuit expert. I would like to know if something like this is possible and how to do it.

Do a google search for "color organ schematic": you'll find examples of the frequency-pass filter circuits you need. You may want to do some hardware filtering of the filter outputs so you get a signal that represents an "envelope" of the audio, rather than the peaks and troughs of the individual cycles. But you can try doing that in software first, to see whether you get acceptable performance.

Ran

You might want to check this:

http://macetech.com/store/index.php?main_page=product_info&cPath=4&products_id=11&zenid=0afcfaa1d183393c833af41b1565aafa

MikMo, that is almost what I am looking for. That only does a lowpass filter so bass only. However, the example code shows how the idea can be done in code.

Also I need to build my own circuit. I am using an arduino mini so everything can fit into a 3/4" wide container.

As I said, I am not an electrical engineer. I can follow a schematic and solder. Coming up with a circuit on my own is something I cannot do.

Thinking about this a little more basically what I am looking for is two parts. A stereo to mono mixer. I could probably find a circuit design for that somewhere. Second I think what I am looking for is a 3 band EQ but instead of combining the 3 channels each channel will go to an analog port on the arduino. See the 3 band EQ circuit here. Another variation.

Basically if I take the second opamp out I have what I am looking for, correct? Using that second circuit as an example: If I want analog pin 1 to be bass, 2 to be mids, and 3 to be low I would take the output connection from R4 to pin 1, R7 to pin 2, and R9 to pin 3. I would need to find an opamp that will work with 5v.

I take it this circuit assumes line level input, not mic level? Also as long as the input power is 5v do I have to worry about hurting the arduino's analog ports?

That probably explains why the shifty vu has a bunch of resistors and caps.

Second I think what I am looking for is a 3 band EQ but instead of combining the 3 channels

Those EQ circuits you're looking at aren't really splitting the audio: think of them as a single filter whose frequency response curve wiggles up and down depending on how you twiddle the pots.

What you want is something like the "color organ", with multiple filters that have separate outputs for each frequency band.

Ran

Ok, looking into color organs. Though most of what I see seems to be designed for high voltage. I am trying to find something for 5v that the arduino uses.

^v is close enough. This might work but I am not sure how I would mod it to do what I want. I assume I have to pull out all the LED parts. With my basic knowledge of electronics the LED chain is a VU meter for that frequency.

Let’s take the high for example. Can I cut out everything to the right of the diode/4.7k resistor at the top? The output of that diode and resistor would go into a pin on the arduino? The mic would be replaced with a stereo to mono mixing circuit?

I think what I said about the 3 band EQ is correct after looking at color organ circuits they are practically the same as a 3 band EQ. But instead of each channel being combined into one output each channel uses a light for output.

It looks like this chap has what you need:- http://www.andregoncalves.info/ag_blog/?page_id=61 It's an audio envelope shield.