Thursday, December 17, 2009

Body Structure, Fret Sensing, and PD code


1) Body Structure

We first considered a minimalist shape, maintaining only the necessary contact points of an acoustic guitar. See an example of this in the Yamaha SVC-210 electric cello -->



However, after further consideration, much of an acoustic guitar is a contact point, and for simpler construction and electronic packaging we went with a traditional shape.

We wanted to keep the body fabrication simple. The guitar body is lasercut from 4mm wood, to create front and back sides. The two sides are joined with standoffs, and the electronics are attached by velcro to reduce necessary hardware. The only complication was the maximum size of the blanks which fit in the lasercutter, which forced us to cut the guitar from four parts instead of three.
We are pleased with the final shape and durability. It's blue paint, block M and recognizeable shape drew people to it at the expo, and it's structure was robust enough to survive with no damage.

2) Fret Sensing Concept

One of the key features of our instrument is its expressive range. We desired to keep all the note range and capability of an acoustic guitar as a baseline functionality. In order to sense each possible fret position of each six strings, we needed to be able to sense 6x24 positions independantly of each other. However, in a real guitar, only 6 positions are needed at a time, which is each string at the lowest fret fingered. Instead of attempting to assemble 144 sensors, we instead built the 24 frets to each carry a unique voltage, and then use the six metal strings themselves to close the circuit to the arduino analog in ports. The guitar neck is a giant voltage devider, and the strings pick off the voltage when applied to a fret. Otherwise the strings are pulled down to ground. As the analog in ports draw little current, the voltage devider sees very little change in Vout when the string 'load' is applied, and all strings can be fingered with reliable results.
In practice, it is difficult to establish a good connection between the strings and the frets, and while possible, each string must be carefully fingered to acheive the desired chord.

3) Pd code
We chose to produce MIDI output from the guitar, and use Pd as a synthesizer. We decided to do this because we were confident we could produce a satisfying output in this manner. MIDI was only used as a communication standard, as we were creating the Pd patch from scratch, we did not use standard MIDI commands.
Basic MIDI includes note-on and note-off commands, and the simplest synthesizer will produce a pure tone of the commanded note at the commanded volume until the note-off command. A guitar is much different, with each string acting largely independantly of each other (ignoring the excitation one string may cause on another) and each sounding at the same time as the others and with their own overtones. Additionally, ignoring fret-work (hammer on/off, bending) the strings work on their own after initial impulse excitation, dynamic volume is not necessary. The structure of the Pd patch reflects the impulse input control, and independance of each string.
The Arduino sends the note and volume when the string is triggered. Pd receives the command and acts on the trigger, sending the command to the appropriate 'string' subsystem, which sounds the note and calculated overtones with the triggered ASDR envelope ("Attach, Sustain, Decay, Release"), tuned according to our observed acoustic guitar behavior. Each of the six strings has its corrosponding subsystem, which follow their own envelopes. This allows chords when multiple subsystems are sounding at the same time, triggered quickly in succession in a natural strumming motion.
There is also capability to pitch bend the final total output of the patch. If there is a continuous sending of MIDI information above the string information range this will work on the pitch shift.
The sound generation is simple: a phasor is constructed at the main frequency and at smaller magnitudes at the first two overtones. The ASDR envelope has an aggressive attack to emulate the aggressive attach in a string pluck. While effective in creating a pleasant and musical tone, there is further room to acheive a more accurate acoustic guitar sound, if desired.


Pd guitar front-end. Note-in sends information to correct 'string' or pitch bending


Example 'string'. Each string has unique asdr envelope


Borrowed ASDR envelope patch

3 comments:

  1. Congratulations on a great expo; I thought you guys had a really neat device. I think it was a very good decision to keep the familiar form factor of a regular guitar. Looking at the Yamaha instrument pictured above, it seems like it would be unwieldy and a little annoying to manipulate it because there are fewer places to rest it against the body.

    The fret voltage-divider was a brilliant and unique design. It is interesting for an electronic instrument to have the musician actually becoming a part of the electrical circuit. You mentioned fret work and bending, and I was wondering if/how you were able to pull off these features? Also, I'd be interested to see the the effect of using the string as the higher voltage node, and giving each fret a different resistance so that touching the string to the fret pulls the fret up. I'd have to know more about your wiring scheme but it could potentially streamline the design or help with distinguishing multiple frets being pushed on one string at the same time.

    ReplyDelete
  2. Thanks for help with the ADSR envelope. I think the combination of phasors, the added harmonic waves and the ADSR enveloped help to give you guys an incredible sounding guitar.

    ReplyDelete
  3. I think you just have to let the musician play for a while. They will eventually get sweaty and the electrical connections can only improve. I forget but was the connection made with the largish plate that would normally be between the actual contact points of the frets of a real guitar? If so, you could perhaps recreate these ridges, so that when you pull down the string behind the ridge it would have better contact.

    Kudos for building your own guitar. I always wish I had more reasons to use the laser cutter.

    ReplyDelete