Get any kind of info from guitar signal

I’m working on an LED project for a friend. It would be very helpful if I could make it react in ANY way to his electric guitar. Fast/slow would be best but obviously that would be pretty complicated. So I’m just looking for anything to get cues to make the LEDs react. My goal is to also get it to self calibrate every few seconds so that it can get cues whether the playing is quiet or loud. But for now, I would really appreciate any advice on how best to do this. I realize I cannot expect it to synchronize perfectly like a lighting display at a concert, I’m just looking for cues to trigger the LED’s to change speed and patterns.

ANY info on this subject would be great, I’ve only just began to look into it.

I also was wondering how to most efficiently connect the guitar to the arduino. I wasn’t sure if it would be as easy as simply connecting the line to an analog input.

Thanks!

How to connect the guitar: You will need some sort of pre-amp to boost the guitar signal so that it's between 0V and 5V, once you have done that then you can sample it with the analog inputs. For what kind of amplifier, well a TL072 op-amp based AC coupled non-inverting amplifier, run off the arduino's +5V supply, and with an adjustable gain between 2 and 5 will do nicely. As an alternative perhaps take the output of an FX pedal, or the FX loop/line out from a guitar amplifier, however this is likely to be more compressed and difficult to make out the attack of the picking.

Synchronising LED's You need to decide how to sample the guitar signal. For a code-only minimal electronics approach you could sample it using timer interrupts as shown in this real-time audio FX example http://interface.khm.de/index.php/lab/experiments/arduino-realtime-audio-processing/. That will have the guitar signal going into the arduino is sampled at 31.25kHz via interrupts, and then you can do something with it in the main loop. Alternatively, you could sample at regular intervals within the main loop using the analog read function. You could quite easily sample 10 times a second, and then say if the level is above a certain threshold an event will be triggered. If you're willing to build more electronics then some sort of peak detection circuit might be useful, because then you can just use a digital input.

Good luck!

1 Like

Since the guitar will be plugged into effects/amp will my little preamp affect the signal?

Also I was thinking, I have no clue what is setup is like exactly because the guitar input stuff was originally an afterthought, but I know he has a channel selector and lots of effects. The effects will likely always be on, then switched with his channel switcher, could I tap into the channels and make the arduino know which one is active? I don't really know how it works though and how I could tell which was selected... Any thoughts?

Also, that page shows the line in plugged directly into the arduino through a capacitor and some resistors in parallel, why doesn't it have a preamp?

Since the guitar will be plugged into effects/amp will my little preamp affect the signal?

Depends what you build. Let's say you build a pre-amp with a thru output, then the output that goes to the rest of your signal chain will be coloured by the pre-amp, probably not a good idea unless you know what you're doing. If you split the signal before it goes to the arduino with a buffer then you will be less likely to affect the rest of the sound.

I think you need to get a good idea what the set up of your friend is, otherwise you won't be able to build a decent solution. This means you need to determine where you can tap off the guitar signal. Something line level would be best, because it will be a low impedance signal and up to 10V peak to peak, so you just need to step it down a bit with a potentiometer so the arduino can sample it.

Also, that page shows the line in plugged directly into the arduino through a capacitor and some resistors in parallel, why doesn't it have a preamp?

This circuit is designed for something that is already at line level, i.e. low impedance and many volts, so it doesn't need to be amplified first.

could I tap into the channels and make the arduino know which one is active

perhaps, depends on the amplifier though, you will likely have to modify something. Perhaps you could insert a small box in the footswitch signal path that will provide a control voltage for the arduino to say what channel is selected.