The Robot Guitarist

Steve Smit

Issue 9, March 2018

This article includes additional downloadable resources.
Please log in to access.

Log in

"The Commodore 64 was my first real computer, so i decided to see if I could stretch myself to use a 35-year-old eight-bit computer as the master of this system."

The Commodore 64 has a special place in many hearts, and most of us have dreamed of being in a band. With a bit of ingenuity, Steve found a way to combine the two into something special.

Whether you’re a great guitarist and need a rhythm player, or you can’t play a straight note, perhaps a robotic guitarist friend is the way to go? Whatever the reason may be, Steve took the challenge to build a guitar playing machine, with a Commodore 64 computer, an Arduino, and a huge collection of servo motors!

This is a very fun sounding project, but not an easy one to tackle. What made you decide to take this project on?

After leaving school my career started at a manufacturer where I learnt the basics of electronics, early TTL digital logic, and eight-bit computer programming. While I did some low-level projects back in the 80s on my Commodore 64, I really didn’t get the chance to do anything that I could say was a completed project. After selling the C64 I went on to own an Amiga 1000 and many PCs after that, but something inside me wanted to see if I could really finish something cool, so I decided to start a project. The project I decided to try is to build a “robot guitar”.

It’s definitely a big project to embark on, but there’s a lot of satisfaction from complex projects too! You’re sending commands to a Mega from the C64. For those unfamiliar with a Commodore 64, is the C64 user port essentially a serial port?

Whilst the user port on the Commodore 64 is generally used as an RS232C port to connect to a modem for instance, under programming control there is a complete eight bits on port B on the second CIA chip that can be configured for input or output and a bit on port A (bit 2, PA2) that can be used to clock bytes out. For speed purposes, I decided to send bytes from the C64 to the Arduino Mega (which is the controller that can handle the large number of servo motors of this project) in eight-bit parallel, rather than in serial.

User port

It does sound like a pretty good system for developing on. Things were more complicated, but also simpler when it was first released! Was there a specific reason for using a C64 over something else?

The Commodore 64 was my first real computer, so I decided to see if I could stretch myself to use a 35-year-old eight-bit computer as the master of this system.

I think we all have fond memories of our first pieces of technology! Did you write the tablature software from scratch, or does it piggy-back on something?

I wrote the tablature software entirely from scratch. I really like Forth but a friend of mine suggested Pascal as this still exists today in commercial use - in Borland’s Delphi for instance. Meaning that if I wanted to develop later for other platforms I will hopefully have learned some of the principals of this language. Pascal was, after all, designed to help new programmers develop good habits. I found however that some parts of the code needed to be rewritten in assembler as the speed of playing would otherwise be compromised such as writing the screen when moving to a new line of tablature while playing the robot guitar.

The tablature for Jingle Bells as displayed by the C64. Watch the video https://youtu.be/p9JClx--cbU
A servo not for the faint hearted.

In music timing is everything, that’s for sure! Something we often forget about is clock speed. We get used to Arduino processors having microsecond timing, things were much slower in the 80s and clock speeds are a fraction of what they are now (not even comparing to a regular PC). The C64 is barely 1MHz.

When it comes to actuating strings on the guitar, you’re using a huge amount of servos! Did it take some trial and error for the rigging to get everything working correctly?

I did indeed suffer quite a bit of trial and error, which even included burning out a few servos along the way. To help avoid surges of current I had to store default values for all the servos into the Arduino Mega’s EEPROM memory, as well as keeping a master table on the Commodore 64 disk storage. I also found it wise to initialise six servos at a time, rather than activate all the servos at once. There are 24 servos at the time of this writing, but my plan is to get this up to 30 servos soon, so that 4 fret rows on the neck of the guitar have “fingers” poised over them.

We watched your YouTube video, and the servo noise is notable. Would it be possible to enclose them and use longer actuators? Of course you could use an electronic pickup, but much of the awesomeness here is seeing it in action.

In my research I am led to believe there are two kinds of servo motors: digital and analogue. The digital servos use current to hold their position, which is why they buzz a bit when stationary. However, to minimise costs I chose what I could afford (considering how many servos I needed), and found the SG90 servos to be the best for size and value I needed; but they are digital. I’m still on the look out for analogue servos to try, because apparently when they’re in their stationary positions there is no buzzing. There is also noise in servos when they turn, which is minimised with the quality of the cogs they use, so that’s another consideration. A pickup can be added where video can be shown of the servos in action, but you only hear the notes the pickup detects, so this might not detract too much from the awesomeness!

early attempt
An early design using solenoids didn't press hard enough so sound was muffled on the guitar.

I also plan to take the pickup output and feed this into the Commodore 64’s SID chip, which under programming control, would allow distortion of the sound using filters.

Would it be possible to have actuators move along the fretboard, allowing full note flexibility? One for each string?

I have seen another “robot guitar” use this approach. I wanted to keep my design simple in that it can be mounted easily to the neck of the guitar. Other designs I have seen in YouTube videos require a guitar to be mounted against a backboard with many systems arranged around the guitar. There is also noise if these external actuators need to move down the whole fret board, not to mention this would be slower than my method and result in tunes only being able to be played very slowly.

I may one day add a second Arduino Mega and keep adding servos as far down as fret row nine (more than this means I’d have to come up with a way to display two-digit numbers on each tablature position, which is not easy with a limited display area!).

You’re definitely nudging the limitations of a single Mega. Do you have any upgrades planned for your current setup, or are you happy with its performance as is?

I have seen there are very fast servos available; the kind that are used to turn the front wheels of very high performance racing remote control cars, for instance. As my budget allows I will start with replacing the “plucking servos” with six of these. This will allow for things like strumming actions and for much faster playing speeds. Another idea for an upgrade that I’d like to test is to use stepper motors to manipulate the tuning knobs for each string, which could also let the robot guitar do bends!

Now that would be awesome to see! Auto-tuning abilities, along with some bends and other advanced functionality would help the machine add some personality to the final sound output for sure. If you were tackling this project from scratch, with the knowledge you know now, what would you change?

I don’t think I would change anything. During this project there have been many times where I nearly gave up, but every time I worked through the faults to find resolutions, and I think this is an important part of getting better at anything you try. For instance, along the way I had to deal with a way to work on source code on a PC, and convert these into PET ASCII (the text used by the Commodore 64) and back again, to help improve development/testing time.

testing the veroboard version
Testing the veroboard version.

Any complex software and hardware solution will present a lot of challenges. We’re glad you persisted! What awesome project are you working on now?

I am currently working on a version of the Commodore 64 software of this project, where you don’t need to hook up a robot guitar to use the software. The tablatures can be played using the SID chip to hear the notes. It will also show where to place your fingers on the fret board, so the software can be used to learn how to play a guitar. Use the software with a robot guitar and you can play along hearing both your guitar and the robot guitar!

It would be like a C64 Guitar Tutor - awesome! We’d love to see where this goes in future. Thanks for taking us through your project!

Steve Smit

Steve Smit

National Account Manager at LRS Output Management.