7

(avery) #1
LENS

Six separate strings (actually lengths
of threaded metal bar) are fixed to the
guitar’s body, each one again acting as a
digital input. When a string is touched with
the metal plectrum (which is part of the
circuit), a voltage is detected and the note
is triggered.
While this playing mechanism takes some
time to get used to, it is perfectly possible
to play both chords and melodies accurately
with practice. However, generating musical
data is only half the battle – we also
need sound...


A TEENSY BRAIN
To produce sound (and manage the data
from the guitar’s many inputs), I needed a
microcontroller, and decided on a Teensy
3.6 with an audio add-on board. For the
uninitiated, the Teensy is roughly like an
Arduino but with more processing power,
more inputs, and a brilliant audio library
which allows you to build a fully functioning


synthesizer from within the Arduino IDE. I
did consider using a Raspberry Pi, but the
near-instant boot time of the Teensy was
the deciding factor.
I was able to write most of the code
(and test it fairly extensively) before the
project started to look anything like a guitar.
Although the Teensy is pretty fast, I still
had to do a lot of optimisation before I
could get the latency (the time between

plucking a note and hearing it) down to an
acceptable value. The sheer number of
digital and analogue inputs being read made
things difficult: there are 72 fret contacts,
12 ‘strings’, 28 potentiometers, five toggle
switches and an arcade push-button, not to
mention the LEDs.
One sacrifice I had to make during this
breadboarding stage was capacitive touch.
My original idea was for everything to
work by just touching the frets and strings,
allowing naturalistic left-hand playing
and finger-picking with the right hand.
Sadly, however hard I tried, I couldn’t get
satisfactory speed or sensitivity using this
method. It’s possible that different materials
could have helped, or that my code or wiring
was inefficient in some way, but there
came a point (while hacking the Teensy’s
core libraries!) that I decided I had spent
enough time on this one feature, and gave
up. I added a metal plectrum to the body
and modified the design of the neck so
that both would simply read conductivity

Teensy audio library
The guitar’s synthesizer code features
a huge number of oscillators, filters,
envelopes, and other effects, all
connected together with a complex
web of virtual audio cables. Luckily,
there is an intuitive drag-and-drop
interface for the Teensy audio library,
which allows you to create your audio
setup in flowchart form, then click
‘export’ to generate code which you
can copy and paste straight into the
Arduino IDE.

Left
Building electronics into the neck of the guitar

Below
The join between neck and body; ribbon
cables carry fret data to the main board
Free download pdf