Saturday 19 January 2013

Making my own Guitar Hero controller




Last year I had the privilege of being introduced to a video game called Guitar Hero. I had heard the name before but, being a musician myself I didn't think that pressing a few plastic buttons could have much to do with real musical talent, or could evoke in me any real excitement. Until I picked up that wonderful little piece of plastic... I was soon hitting those buttons furiously, playing song after song.



This first experience of mine was on a friend's Xbox with the official Guitar Hero controller, similar to the one shown below. On the fret board you have 5 buttons that have to be pressed according to the scrolling notes displayed on-screen. However, notes are only "played" once you hit the strum bar on the body of the guitar. The strum bar can be be alternated up and down which is useful for playing fast sequences of notes. The whammy bar works similar to that on a real guitar, and can be used on long notes to vary the pitch, adding vibrato to the sound. Using the whammy bar at the right time can also increase you Star Power which builds up during each song. As soon as you have accumulated enough Star Power you can activate it by tilting the guitar - this will momentarily make the crowd more lenient and reduce your chances of being booed off stage.



 After playing Guitar Hero on Xbox I downloaded a free PC clone, Frets on Fire. To play, you pick up your keyboard and hold it like a guitar, using F1-F5 as the frets. I enjoyed playing the three songs included but soon started longing after the real thing, so I ordered a copy of the PC version of Guitar Hero: World Tour. I enjoyed playing it on my keyboard and eventually finished career mode on Hard, but still wished I had a proper Guitar Hero controller.

As I had a lot of free time during the holidays I decided to make my own controller. About two weeks ago I went into a plastics store and found a nifty little plastic guitar just waiting for me to buy it. I am sure the guy who designed this thing had in mind that someone might want to transform it into a Guitar Hero controller. Instead of being glued together like most plastic toys this guitar was neatly fixed together with screws. It had a lot of space in the body for wires and circuit boards and various other contraptions. It had three ready-made plastic buttons which could be removed. It had a sound hole through which you could place a strumming bar. It had a removable bridge and a removable piece of plastic around the sound hole underneath which screw heads could be concealed. It had a removable fretboard underneath which circuitry could be placed. And last, but not least, it was just the right size and shape, and even came with its own guitar bag (admittedly made of very thin, very cheap plastic, but nonetheless).

No sooner did I reach home, than I was tearing it apart - the most enjoyable experience of a tinkerer, second only to putting something new together. I took as my example the original Guitar Hero controller and endeavored to make a similar controller.

Interface


I was designing a PC controller and decided to take apart an old PS/2 keyboard and use its circuit board for my own controller. The circuit board of a traditional keyboard is actually quite small, it can fit into the palm of my hand. Inside the keyboard you find three plastic sheets on top of each other. Underneath each key you will find two conductive dots facing each other, but not touching. When you depress the key, the two dots touch, connecting two different nodes on the circuit board. The circuit board detects which two nodes are connected and decides which key was pressed. 

The first thing I had to do was to label the nodes from 1 to 26 and test which nodes correspond to which Guitar Hero button. For example, the five fret buttons are V, C, X, Z, and Shift respectively, Space activates Star Power and Alt is for the whammy bar. Since I was using a multimedia keyboard I was also able to find the combinations for the volume up and volume down keys. In essence all of this meant that for every button in my guitar, two wires would run to the circuit board and a short circuit would be created between a certain two nodes when the switch is activated.

In the original keyboard, the "wires" on the sheets are not actually soldered to the circuit board, the thin coatings only touch the nodes on the board. For this reason graphite was used to coat each node, since graphite makes a good electrical contact. The only problem is, graphite is not a metal and can therefore not be soldered onto. I tried using insulation tape to tape my own wires to the circuit board but this was a failure since the wires would not stay put. I then realised that underneath each graphite node was probably a copper strip, so armed with a Swiss Army knife and great care I managed to scrape off some of the graphite on each node to reveal a nice clean, solderable metal strip.

I decided to use ribbon cable throughout the project since its wires are thin and stranded which means that they have less chance of breaking off where they have been soldered (which did happen once). Also, a group of wires can be run together.

I had the option to use the existing keyboard cable as is, but it would be too short and it would always be hanging from the guitar, even when it is not being used. Luckily I found an old female PS/2 connector in my room. Since the PS/2 connector would be placed on the other half of the guitar as the rest of the circuitry, I decided not to solder the wires onto the circuit board. Instead, I desoldered four metal pins from an old PCI card and soldered these to the circuit board. The female connector had a plug on the other end which could fit on these pins. For the cable, I took the keyboard cable and an old PS/2 mouse cable, checked which wires correspond to which pins and soldered the wires together, making a long male-male PS/2 cable.


Strum bar



This was one of the parts of the project I enjoyed most. I remember lying awake one night before the holiday trying to think of a way to make my own strum bar. I had acquired two neat push-button switches for a varsity project and wanted to use these. But how do you convert two push-buttons into a strum bar which can alternate up and down? Something told me that I would have to use some sort of a hinge. If you could place a hinge on top of the guitar and place one push-button on each side to hold it up you would have a strum bar, but that would be a very ugly sight. So I decided to place a door hinge underneath the sound hole, place a push-button on each side, and then fasten to the hinge a plastic strum bar which sticks out of the sound hole. This way, when you push the strum bar down, the hinge pushes up against the push-button, and when released, the push-button returns the hinge to its original position.

After fastening the hinge to the guitar I made two brackets from aluminium to hold the push-buttons in place. It was quite tricky to get the push-buttons properly aligned. At first I cut out a plastic strum bar from an old transparent CD (the ones you find at the bottom of a pack of recordable CDs), but it was rather flimsy and made two cracks where it was fastened to the hinge. Later I used this as a template and cut out a new one from the back cover of the old keyboard which proved to be much sturdier.


Fret buttons



For the fret buttons, I decided that I would cut out a row of five plastic keys from the old keyboard. Each key is made up of a removable plastic keytop, a plastic base into which the keytop fits, and a rubber cap underneath the base which acts like a spring. However, I decided to use the rectangular buttons such as Alt and Ctrl instead of the square keys, as this looks more like the keys on the official controller.

At first I tried cutting out the corresponding parts of the plastic sheets and very carefully soldering the wires to the conductive traces, but while it worked most of the time there always seemed to be one or two wires with a bad connection.





I saw that this was not a very reliable solution so I started looking elsewhere. The only other switches I could think of was mouse micro switches. So I gutted one or two old mice and desoldered five micro switches. I then placed these on a veroboard and soldered the corresponding wires.



I cut out a column of five key bases and carefully mades holes in the plastic fretboard through which these bases could fit. Two screws would hold everything together. A problem with the mouse switches was that you only have to depress them very slightly, while a normal keyboard key has to be depressed much more which gives a more natural feeling. I could not place the rubber caps underneath the key base as they would fall out. To solve this problem I cut out the middle part of the rubber cap (see picture) and placed it between the keytop and the base, instead of placing it underneath the base. This lifted the key slightly so that you have to press it down before it clicks.

Another problem was that, as you can see from the bottom-left picture, the keytop has a hole underneath so that it cannot press against the mouse switch. I therefore cut screws to the correct length and screwed them underneath the keytops so that the screw head can depress the switch (top-right picture).

After assembling all of this I placed the PC board underneath and fastened everything together. It was necessary to wrap insulation tape around the screws as they would otherwise cause a short-circuit between some of the switches.


Control buttons




The plastic guitar had three removable buttons that represent the volume/tone buttons on a real guitar. I needed one button for the Start button, and I also wanted to use one button each for volume up and volume down. I used the same principle as for the fret buttons and soldered three mouse micro switches onto veroboard. The bottom of the plastic buttons were hollow, so I filled it with epoxy.


Tilt sensor (Star Power)



At each step in my project I tried to keep the functionality of my own controller similar to that of the official controller. This meant that I needed to design a tilt sensor that activates Star Power (i.e. activates the Alt key combination) when the guitar is tilted vertically. In order to do this I took a small switch as shown and cut a piece of metal that could rotate and hit the switch when the guitar is tilted. This mechanism works more effectively when the guitar neck is "thrown" backwards in the air. I glued the switch to the inside of the guitar body at the correct angle. Between the switch and the piece of metal I glued two pieces of fridge magnet to prevent the metal piece from bouncing.



Whammy bar




This was an interesting part of the project. On the official controller you can move the whammy bar in various degrees; the more you press it down, the more the pitch bends. You can also do the same with your mouse by moving it left and right, but when you press Spacebar the whammy is either on or off; nothing in-between. I considered integrating a mouse circuit board into my controller but this proved to be too difficult, so I settled for the on/off system. I needed a long rotating rod that goes into the guitar near the bridge and makes contact when it is pressed down, and it needs to have spring-like motion.

An old project of mine, a soldering station, had an aluminium rod with a crocodile clip at its end for holding objects. I took this rod to use as the whammy bar. It has a nice matte metallic appearance and bends easily, but not so easy that you would bend the whammy bar during use.

It's hard to say how I came up with the first peculiar-looking prototype on the left. I had the idea of using a micro switch that presses against the inside of a cylinder when you bend the rod; allowing the whammy bar to rotate. However, this prototype didn't work very well.





I then started wondering whether I needed a switch at all. The only thing I really needed was two pieces of metal making contact. I kept the idea of using a cylinder, but this time a metal cylinder. If I had an aluminium rod and an metal cylinder, I only needed to make the rod touch the sides of the cylinder. So I went into the garage and cut off a piece of copper pipe, cut four slits on the one end and bent the sides into legs. I then cut four slits on the other end as well and strung elastic band to hold the rod in the middle (see picture). In this way the rod stays in the middle, but touches the sides when the whammy bar is pressed down. I soldered the one wire directly onto the copper. For the other wire, I placed a brass washer on the end of the rod and used a side cutter to pinch the aluminium above and below it, and soldered the wire to the brass washer.



The final product





Friday 18 January 2013

Appelkooskaaskoek

Om 'n bachelor te wees beteken dikwels dat jy dinge begin doen wat jy nooit voorheen aan sou gedink het nie. In die afgelope twee jaar het ek geleer om myself tuis te maak in die kombuis - nie dat 'n wasbak en 'n oondjie wat elke keer uit die kas gehaal moet word werklik die naam verdien nie, maar nou ja, mens sal verbaas wees wat jy met 'n tweeplaatstofie en 'n mikrogolf kan verrig.

Gister blaai ek in my verveeldheid deur 'n ou Huisgenoot en kom op die volgende resep af. Aangesien ek steeds op vakansie is sonder veel om te doen het ek besluit om hierdie kaaskoek te probeer, al was dit ook net om die verveeldheid vir 'n slag op sy plek te sit. Alles het goed verloop, die appelkose gee 'n effense suur smaak wat gepas is vir 'n yskaskaaskoek. Daar was net een probleem met die elektriese klitser - ek was nie bewus dat room die vermoë besit om botter te word nie. Hulle sê altyd mens moet versigtig wees as jy met power tools werk...

Kors
1 pakkie (200g) Nuttikrust-koekies, gekrummel (Ek kon dit nie vind nie toe gebruik ek sommer Tennisbeskuitjies)
60g botter, gesmelt

Vulsel
1 blik (410g) appelkooshelftes
1 pakkie (80g) lemoenjelliepoeier
250g maaskaas
250ml room, styf geklits
Ekstra appelkooshelftes of gekapte neute vir versiering

Kors - Meng die koekiekrummels en gesmelte botter en druk dit op die boom en teen die kante van 'n tertpan van 20-22 cm in deursnee vas.

Vulsel - Dreineer die appelkose en behou die vloeistof. Verhit die vloeistof en roer die jelliepoeier in tot dit opgelos is. Verwyder van die hitte en laat afkoel. Verpulp die appelkose in 'n voedselverwerker en roer dit saam met die maaskaas by die jelliemengsel in. Vou die geklitste room in en giet die mengsel in die kors. Plaas in die yskas tot gestol. Versier met appelkose of gekapte neute soos verkies.
Genoeg vir 6-8 mense.

Tuesday 1 January 2013

A resolution for a new year

It is one-and-a-half hours to midnight on the last day of 2012. For many, New Year's is a time of reflection. Most of us are on holiday and this is a time when we get a break from our normal routine and spend time resting and enjoying being with our families. We think about the year that has passed. For some it might have been a good year, for others a year of disappointment. We ask ourselves whether our expectations had been met, whether we have achieved our goals. It is as if we come up for a breath of fresh air before diving again into the ocean of daily life.

I am glad for a time like this. During the year I often find myself being so busy that I barely have time to stop and think about where I am and where I am going. When I look back at 2012 I regret that I have too often lost sight of the bigger picture, trying so hard just to survive from one day to the next that my life becomes filled with stress and worry about things which are not ultimately that important on the larger scale of life. I think part of the problem is that, as I pointed out last time, we tend to place all the importance on the things we can see, feel, and touch, while the more subtle things such as my relationship with God is often the first to go missing from our priority lists.

I have thought about this past year and what I would like to do differently in 2013, but I also know that New Year's resolutions have a reputation for not lasting very long. What I really need is not a long list of resolutions, but rather a principle that will help me to maintain perspective on a daily basis. I would much rather come up for air every day than taking one deep breath and only coming up again at the next New Year. For this reason I have made the following my New Year's resolution:
My first priority in all of life will be maintaining a personal relationship with Jesus Christ.
How do you maintain a relationship? By spending time together. God speaks to me as I read the Bible and as I experience life, and I speak to Him through prayer. I believe that I will be able to maintain perspective as I spend time with God daily - thinking about Him, talking to Him, reading his Word.

I would like to refer back to Psalm 23. David says, "The Lord is my shepherd; I shall not want." David says that having God, to him means having everything. There are many things that I want in 2013, but if I have the Lord, I already have everything that I need. Elsewhere David says, "Delight yourself in the Lord, and he will give you the desires of your heart." (Psalm 37:4). When your focus is on God, He will take care of your needs and even give you lasting joy and peace. The rest of Psalm 23 explains how God takes care of our needs. He gives us peace, He leads us on the right path, He guides us during suffering and He deals with our enemies.

It is very nearly midnight, and fireworks will soon signal the end of 2012, and the beginning of a new year. I pray for myself and for you that 2013 will truly be a year of new beginnings, that we may daily experience new depths in a personal relationship with God himself.