Guitar Fret Sensing

I'm currently working on a project to detect which frets/strings of an electric guitar are being pressed. The arduino will then take that information and translate it into MIDI output. What I need help with is designing the actual sensing circuit. I need to keep the number of wires to a minimum so I can't simply run a wire to each fret/string position (that would end up being 132 wires on a standard 6 string). What I'm thinking about doing instead is running a one wire to each of the strings and one to each fret. Since both the frets and strings are conductive, touching them together can act like a switch. The arduino would then use the combination of string/fret pins to figure out the actual position. So for example if pin 22 (E string) and pin 23( fret 12) were both high then the arduino would output the MIDI for E0.

What I need to figure out is how to actually lay out the circuit in such a way that pressing a string to a fret changes the state of both of the corresponding pins. It also needs to be able to handle chords. So for example, if both the E string and A string were pressed to fret 12, three pins would change state, the pin for the fret and the two string pins.

bucpatr:
Since both the frets and strings are conductive, touching them together can act like a switch. The arduino would then use the combination of string/fret pins to figure out the actual position.

Would that not fall over once you started playing nearer the body with the frets being so close? You'd end up pressing down 2 or 3 at the same time on a given string. You'd have to filter out so you only got the highest (musically speaking) value.

You should have one output for each string and one input for each fret. For each string, set that output and look to see what fret the output returns on. Since you only need to know the ID of the highest fret, a good choice is cascading three 74LS148 Priority Encoders.

This will give you a 5-bit ID and a GS ('Got Something') flag. It will allow for very fast scanning since you can read all 6 bits in one shot.

How would you handle the specialized case of open strings being played?

I think the strings on an electric guitar are grounded so the pickups do not pick up 60 Hz from the strings acting as antenna.
So to start you need to get them isolated from each other on the bridge - a Schecter guitar where the strings terminate thru the body would be a good start.
Then feed each string with different frequency, and pick up that frequency at the fret contact. If the fret had 2 strings in contact then the frequency picked up would be a combination of the frequencies.
I think the key to success here would be in good multiplexing to get some isolation - other wise you'd get no seperation.
For example, an F chord - you'd have the high E string touching the first fret - and likely showing up on the 2nd & 3rd frets as well as the B, G, and D strings are pressed.

CrossRoads:
How would you handle the specialized case of open strings being played?

Eventually I'm going to use some kind of vibration sensor or accelerometer to detect the actual strums. For now though I'm not actually trying to 'play' the notes. I'm just trying to monitor finger positions on the neck for providing feedback similar to what Rockband 3 does with the 'pro' instruments.

You can't do this it will not work. It all ends up inashorted out mess. About three years ago there was someone who actually made one before trying to figure out how to drive it. It is not possible.

Not sure quite what you mean. Are you saying it's impossible to detect the strums with a vibration sensor, or is there some issue with my overall approach? Just to clarify, I'm not actually trying to detect which note was played via the vibration sensor; all the strum will do is tell the software to transmit the notes currently detected by the fret sensors.

Conneting to the frets and strings doesn't work - there's too much scope for issues (strings touching other frets, connections caused by your fingers etc etc).

I've been trying to think of a feasible way to do it and I can't think of one. If it was only one string then yeah but 6 strings that close together... no.

Yes as mowcius is said it is the fret sensor that you can't do.

Well, I will have to disagree with the naysayers. It has been done before:http://en.wikipedia.org/wiki/Vox_(musical_equipment) VOX V251 GUITAR ORGAN with Dick Denney a great innovator and a true gentleman. - YouTube.
I actually got to play one of these very briefly back in the day. I had to pester the music store owner for weeks before he let me. Though it worked, I certainly wouldn't call it a success. I'm sure it could be vastly improved with current technology, though.

This instrument was heavy and cumbersome with its steel neck and external circuit boxes, and rarely worked correctly, but was a hallmark of the ingenuity of this company.

Ahem.

Brian Jones of the Rolling Stones also tried one; when asked by the Velvets if it "worked", his answer was negative.

Yeah it can kinda work but it's not going to work too well and what they did is slightly different to detecting each and every note.

The problem with using the strings and frets as a keyboard matrix is that you can't do n-key rollover with a simple matrix. Let's say that when you are fingering a string at fret N it is likely to also touch fret N-1. This is not a problem because fret N will determine the note and all the frets higher up the neck won't make a difference.

If you have a fingering that includes fret N for the first string and fret N-1 for the second you will get a false indication of fret N for the second string. The signal will come up the second string to fret N-1 but will also travel across fred N-1 to the first string because of the accidental contact of the first string and fret N-1. Then it will travel down the first string and connect to fret N. When that signal appears on fret N it will look as if the second string is touching fret N when it is only directly touching fret N-1 (and accidentally N-2).

The way to fix it is to cut the frets into 6 separate parts and put diodes from each part to a common rail. That way the signal can't leak from one string to another. The scanning is done the same as for a plain matrix keyboard.

If you aren't using the fret position to set pitch you don't really need wire frets. Perhaps "Zebra Strip" rubber that is often used to connect LCD panels to circuit boards would work. It is a strip of closely spaced alternating conductive and non-conductive layers. It conducts across the width of the strip but not down the length. You could use the diode leads in the bottom of the fret slot and then cram in the Zebra Strip. Might be easier that cutting the fret into 6 parts and placing insulators between.

I did a bit more research and found an explanation of exactly how the GuitarOrgan worked: The VOX Showroom - Vox V251 Guitar Organ.

Pretty neat.

Engineering wise, it must have been pretty challenging to get all that wiring in place inside the fretboard.

And no, I haven't seen anyone claim success since Aug 2010 when I came around.

Hmmm... defenitely some major engineering hurdles I hadn't considered. Makes me wonder how the heck Fender managed to get their 'Squire' controller for rock band 3 to work. I've read some posts from people who own one and they claim that it only senses finger position when the string is involved; just touching the frets with a finger doesn't do anything. Someone out there must have done a tear-down at some point. I'll look around myself, but if anyone has a link and wants to save me some time that would be great :wink:

bucpatr:
Makes me wonder how the heck Fender managed to get their 'Squire' controller for rock band 3 to work.

Looks like they did exactly what I said had to be done. If you look closely at this picture you will see that the frets are segmented:

http://lazyreviewzzz.com/wp-content/uploads/2010/08/Rock-Band-3-fender-squire_strat-1280px-50p.jpg

I'm very curious how those frets are made and if they are removable so the guitar can be refretted when necessary. I suppose a circuit board with resistors could be placed under the fingerboard and elastomeric conductors used to make contact with the fret. But even designing the segmented fret would be a challenge.

Frets are designed to be removable and replaceable. It be possible (maybe tedious) to pull them out replace with 6 segments per fret, tricky part would be a little non-conductive spacer between segments.

Rather than trying to modify/ replace the frets, mabey an easier option would be some sort of thin masking material over the top. So you would have something non-conductive like double sided tape on the fret and on top of that would go some thin pieces of copper or other conductor, connected to a common rail via diodes as John suggested before.