# circuit to control resistance with an electric guitar?

Discussion in 'Electronic Components' started by Mad Scientist Jr, May 21, 2007.

I am looking for ways to use my electric guitar to control a color
organ or other lights & similar devices. Can someone point me to a
schematic for a circuit that takes the signal from an electric
guitar's magnetic pickup and translates that to a resistance which
varies depending on how hard the guitar's strings are picked? Are
there any circuits that translate the signal coming from the guitar
into a resistance or capacitance that varies based on the note being
played (the pitch / frequency of the string being plucked)? Any
pointers or advice would be most appreciated...

2. ### Andrew SmallshawGuest

First off, a guitar pickup has an incredibly high output impedance
and isn't much good for anything as is. You need to buffer it
first. I'd use an op-amp based voltage follower for that. Use a
FET input type eg TL081.

Next, consider the waveform produced by a guitar. I'm not familiar
with it (do your own homework there), but it may have a few spikes
in there that aren't representative of the overall volume. If so,
use a band pass filter one octave wide to isolate the fundamental
frequency. If it doesn't, you can probably skip that stage.

Then it depends on how you want to process the signal. Amplitude
is simplest: feed the signal through a precision rectifier (again
op-amp based) and into an RC network. You'll have to experiment
with the time constant as it's a toss up between smoothing out the
waveform and keeping responsiveness. I'd hazard a guess that 150ms
or so would be a good starting point. Take your output, which will
be a varying analog voltage, from just before the RC network.

Keying off frequency would be a little more challenging since you'll
need to get the signal to a uniform amplitude before proceeding.
Take a look at radio circuits for automatic gain control for
inspiration. Then precision rectify before the output stage.

That would be a series resistor and then capacitor to ground. Take
the output from between the two. Again, it is a varying analog
voltage that this time decreases with an increase in pitch. Reverse
the resistor and cap for the opposite sense.

3. ### LostgallifreyanGuest

Start with small AGC preamp with a bandpass filter to exclude pitches
outside the range you want. These might be found in kit form, I used one
that Maplin used to sell. Then feed the output to a Scmitt trigger based on
a CA3140E op-amp with a high value (megohms) resistor for positive
feedback, to act as a squelch control and to sharpen the pulse edges.
Choose a value that gives the right rejection of low level noise, but is
still sensitive enough to get all your signal.Send the output of that to a
PLL IC, 4046, using the XOR inputs. This works for whistling and other
sources of clearly defined pitch. If you find if won't lock on to a guitar,
first take care to use a fine monophonic playing style, and if you still
get trouble, use the other input. Either way it should be possible to get
good tracking. The resulting clean square wave can feed a freq/volt
converter, or you might be able to tap the PLL's VCO control voltage.

Like all circuits for this task, immunity to loud noise is poor, the
question is what happens if it hears loud noise, and what can you do about
it? In this case, it will make the PLL go to the highest frequency you've
set it to be able to do. (You can limit it). With a pitch to MIDI control,
that can be made to go silent by blocking the message data for that top
note, but in analog, you'd probably have to set the limit to one note
higher than you want, and set a comparator to detect that and mute the
output.

This circuit will be very small, very cheap, and very agile, but it doesn't
do Volts/Octave output. You might want that, and if you can get by with
just three octaves you might do it with a log converter based on a current
mirror. There's a Moog ciruit published online but I can't remember where
it is. Big Briar (firm run by Robert Moog) still sell the stabilising
thermistor needed for accuracy for that design.

If you want five octaves or better, best write to Doepfer and politely urge
them onwards on their pitch to MIDI project, as that will almost certainly
include analog control output for their A100 modular synthesizer. This
project is in slow development, and the speed might be proportional to
interest in it.

4. ### Cornelius J RatGuest

One thing to bear in mind when looking at frequency-to-resistance is what
you want to happen when nothing is happening.
Do you want to keep the last value (sample and hold) or go to a specified
default value (equivalent to zero hertz?)

5. ### LostgallifreyanGuest

In which case I can recommend an H11F1 optoFET. > Some things ARE still
best done in analog domain, as many experts already agree, despite claims
in a recent thread about that optoFET... The only snag is getting one, they
might not be available much longer.

6. ### MarraGuest

Sounds like a sound to light unit to me.
SPlit the sound into bass, middle and treble and use the rectified
output to trigger a triac that lights a coloured lamp.

7. ### LostgallifreyanGuest

NO, it doesn't. Read it again.

8. ### Andrew SmallshawGuest

With hindsight this could be simplified dramatically. Use a comparator
to square up the signal between minimum and maximum levels with no
need for AGC. Of course, squaring up the signal will introduce
harmonics in the ouput but since they'll be the same pattern for
any input I doubt you'd need to remove them. The use of a schmitt
trigger would be even better since it could be set to ignore any
low-level non-fundamental frequencies easily. That would eliminate
the need for a band pass filter.

I though my initial suggestion sounded a little overly-complex. ;-)
Different circuit entirely. You'd need to consider the bass alone,
and you'd also need to demodulate the signal. From memory a bass
guitar can go down to 44Hz (don't quote me on that because I can't
be bothered checking right now). Lights going on and off at that
frequency would at best appear to flicker.

9. ### LostgallifreyanGuest

The bandpass filter is vital in practise. Plosives from singing with
consonants, bumps on the body of a guitar, rumbling in a microphone from
slowly passing air currents from whistling or a wind or brass instrument,
will all make strong LF, and filtering it out is the only way. Same applies
to the strong HF from rustles of clothing, breathing, strings being
brushed, etc. Our brains tune that stuff out, but a microphone or high gain
guitar pickup won't.

The more you can condition the signal before extracting the pitch tracking
signal, the more natural and controllable the result. My earliest post in
this thread decribes what I felt was a minimum of process.

You might be right about the AGC though, I was never entirely sure about
that. I found it helped to have that as the Schmitt trigger's high-value
resistance for positive feedback could be chosen to set a squelch control
that needed little adjustment despite significant changes in ambient sound
level. That would be important to any live stage use. The circuit module I
used happened to have one (would otherwise have tried without it), and I
found that by adjusting it I got really nice tracking over a large
amplitude range despite strong chages in ambient noise level. Again, our
ears compensate for chages in level much like an AGC, so anything that
processes the signal as our brains do before extracting the pitch will
produce or more natural and controllable signal for music making.

10. ### Andrew SmallshawGuest

In my suggestion I was considering a guitar pickup rather than a
microphone as the signal source, so you would hope that the input
is relatively clean. However I've just looked up a guitar waveform
and it isn't a particularly nice signal to process - the harmonics
are probably half as loud as the fundamental which doesn't give a
lot of real-world tolerance for differing sound levels (without
analog AGC). You could still do it, however, by keeping the band
pass filter in place to isolate the fundamental from the harmonics.
That would make the job far easier for the schmitt trigger to sort
out, and far more simply than an AGC circuit.