An Electric Guitar as a Controller for Doom

DOS Storm was able to turn an electric guitar into a gamepad for Doom.

I can't even begin to count how many articles I've written for Hackster about people who got Doom running on unusual devices. That's a very popular pasttime in hardware hacking circles and those projects are always entertaining. But they rarely do anything creative with the controller input. Often, they use external gamepads or whatever controls are built into the hacked device. DOS Storm decided to focus on the control aspect and was able to turn an electric guitar into a gamepad for Doom.

An electric guitar works by using magnetic pickups. As the strings vibrate over those pickups, they induce a tiny electric current with a matching frequency. The guitar outputs that signal, which then gets passed to an pre-amp to increase the amplitude and then finally an amplifier to crank up the volume. But the sound you hear coming from the amplifier's speaker is the same frequency as the plucked string. If you can identify the frequency, you can identify the string and finger position on the fret board—or at least narrow it down to a couple of positions where that note is possible.

DOS Storm took advantage of that fact for this control scheme. His computer monitors the frequency of notes coming from the guitar, then performs a corresponding virtual key press to control the game. The low E (E2) string, for example, has a frequency (about 83 Hz) that is distinct from the high E (E4) string (about 330 Hz). You may notice that the E4 frequency is the E2 frequency doubled twice and that is because it is two octaves higher. DOS Storm just had to assign specific notes (frequencies) to specific virtual key presses.

To achieve that, DOS Storm utilized three pieces of software. The first is Dodo MIDI 2 and it analyzes the signal coming from the guitar andattempts to identify the current note based on its frequency. The second is LoopMIDI, which acts as an intermediary and grabs the MIDI note from Dodo MIDI 2 to pass along to the final piece of software. That is MIDIKey2Key, which assigns virtual key presses to MIDI notes. As far as Doom knows, those key presses are coming from the keyboard. So the chain of events looks like this:

Guitar string plucked > guitar pickup outputs signal > computer accepts signal > Dodo MIDI 2 analyzes the signal and assigns a MIDI note > LoopMIDI passes that MIDI note on to MIDIKey2Key > MIDIKey2Key activates a virtual key press > corresponding action occurs in Doom.

As you would expect, it is actually quite difficult to play Doom using a guitar. But DOS Storm managed to get through the first level using an appropriately named Schecter Hellraiser Deluxe.

cameroncoward

Writer for Hackster News. Proud husband and dog dad. Maker and serial hobbyist. Check out my YouTube channel: Serial Hobbyism

Latest Articles