How to make a low-cost guitar amp with Linux

With just a guitar, a cable, and open source software, you've no need to "Gimmie Some Money" to take your home recording studio to 11.
549 readers like this
549 readers like this
How to make a low-cost guitar amp with Linux

Dustin Gaffke on Flickr. CC BY 2.0

Back in the old days, if you wanted to record guitar music at home (or, stereotypically, in your garage), you got an electric guitar (or another instrument capable of making noise, such as a synthesizer), an amp to produce the sound, some effect pedals to customize the sound, and a multi-track recorder such as a 4-track or 8-track recorder. You would plug the guitar into the effects pedals, the pedals into the amp, and the amp into the recorder (or you might mic the amp and record that).

That was the classic setup, and it endures today because it's powerful, raw, flexible, and all-around beautiful. Modern technology, however, has provided musicians with more options, like using Linux as the entire toolchain beyond the guitar.

Choose a guitar

If you're an experienced player, you'll know exactly what type and quality of guitar you want. If you're a beginner, you may have more flexibility, because any guitar is better than no guitar. Purchasing an electric guitar is easier than it might seem. Nearly every thrift store or pawn shop has at least one electric guitar sitting in a corner. For under $100, you should be able to get a guitar that's good enough to start practicing on.

Contrary to what you might think, an electric guitar isn't actually electric. It's an analog sound generator, just like a traditional guitar. The difference between an electric and a classical guitar is that the latter amplifies the sound with its hollow wooden body, while the former requires electricity for amplification. That means you need cables to wire your guitar to something electrical, like an amp.

Electric guitars accept quarter-inch audio jacks. Your computer, however, probably accepts eighth-inch audio jacks. This is pretty common, so cables with a quarter-inch jack on one end and an eighth-inch jack on the other are easy to find. You might have to go to a guitar or music store for them, since the larger quarter-inch jack is not widely used outside of pro audio. If you're adventurous, you can even fashion your own for just a few dollars and a little soldering.

audio cables

opensource.com

Since your guitar is a single source of sound, you need only a mono audio cable.

The good news is that, since you're using Linux as your amp and effects rack, that's all the money you need to spend!

Get your applications

Part of the beauty of music engineering is the flexibility in its setup, but here is a simple schema that will get you up and running:

  1. Start JACK with QJackCtl or from a terminal, depending on your preferred interface.

  2. Start a virtual effects rack, such as Rakarrack, Guitarix, or whatever you prefer. Since Rakarrack has a fun collection of presets, that's the one I recommend starting with.

Rakarrack

opensource.com

Everything's live now, so it's time to hook it all together.

Connect your cables

  1. Turn the volume down on your electric guitar and plug it into the line in input on your computer.

Line in

opensource.com

  1. Turn the volume up. You won't hear anything yet, but this prevents you from banging on your guitar, wondering why you're not getting a signal later.

Volume dial

opensource.com

  1. In the Connections window of QJackCtl, send the output of System capture to Rakarrack. This sends sound from line in to your effects.
  1. Send the output of Rakarrack to your System playback so you can hear what you're playing.

JACK connections

opensource.com

  1. You should now hear something, even if it's just the buzz of cable interference. If you hear nothing and you're using Pulse audio on your system, open it to verify that your speakers or headphones are active and that line in is detected. If you're using only Advanced Linux Sound Architecture (ALSA), verify your levels in alsamixer.
  2. Play your guitar. Its sonorous sounds should pipe through the Rakarrack effects and out of your speakers or headphones.

Amplifier

opensource.com

Add effects

There are several packages available for Linux that provide effects. Rakarrack is an easy gateway to soft effects because it's self-contained and comes with plenty of great presets to get you started.

Guitarix is slightly more modular, at least in its UI. It models itself after a physical rack, with each effect unit being a separate rackable item.

Guitarix

opensource.com

Calf is similar in look and feel to Guitarix. It's got the visuals of a physical rack of effects, with Edit buttons that pop up the detailed interface for each item.

Calf

opensource.com

The list doesn't stop there. There is a host of LADSPA and LV2 plugins out there, and they're waiting to be discovered, jacked, tweaked, and used.

Record your music

There are several ways to record what you play, but the easiest way is to jack record.

Jack Capture

opensource.com

Jack capture, by default, records anything connected to JACK. It's just a recorder, so it's a lot like turning on a minidisc or tape recorder. Once you have your recording, you can take it into your favorite audio editor, whether that's Qtractor or Ardour or something simple like Audacity.

Get ready to jam

It's never been easier to make noise. If you have the inclination, find a guitar, plug it in, and jam. And if you make anything cool, be sure to share!

Seth Kenlon
Seth Kenlon is a UNIX geek, free culture advocate, independent multimedia artist, and D&D nerd. He has worked in the film and computing industry, often at the same time.

9 Comments

Great article Seth. I recently moved my old electric guitar back into my home office from the storage room, a.k.a. the room where things go to never get used, in hopes I might pick it up again. Do you have any recommendations for resources on troubleshooting JACK? I struggled a few months ago to get past an error message when I was playing with Ardour, and while I eventually figured it out, for someone like me who is an audio newb it was definitely harder than I had expected.

JACK has gotten a lot easier since The Big Low-latency Patch of 2.6.38, so if you think you may not have tried it since then, give it another go. The problems that existed prior to that kernel simply do not exist any more, and mostly it's just a bunch of routing exercises.

However, that's basically saying "works for me", which is useless. So here's some ideas off the top of my head:

Most JACK problems fall into one of two categories: low-level (memory and CPU) problems, or high-level audio routing problems.

The low-level stuff is mostly solved, in my experience, by kernels version 3 and above. But if you encounter them: 1) find and delete any old config files (especially .jackrc). 2) Make sure your user is appropriately privileged; in fact, launch JACK with sudo to really make sure you're not just butting heads with system permissions. 3) If desperate, lower JACK's requirements (for example, tell JACK *not* to seek realtime performance, even if only for testing).

For audio routing issues, get to know your audio devices. JACK talks to Pulse, but JACK also needs to know what device you want it to govern, and for that, you have to look at available sound devices and determine which one you want to use with JACK. It can all be done in QJackCtl settings, but it's easier to type commands, so here's the process:

1. Look at your audio devices:

$ aplay -l | grep card

or

$ cat /proc/asound/cards

2. Identify your preferred output device:

ALSA probably lists your standard speaker (PCH) and maybe a fancy digital device, like HDMI. This is hypothetical; just an example - but assuming your HDMI gets priority, it gets designated by your computer as hw:0 (first device). But your speakers are probably not hooked up to your HDMI port, so you actually want to use your PCH device, designated in this example as hw:1.

So now you know you want to use hw:1 as your JACK output.

3. Set your desired output in QJackCtl settings. Or just try launching jackd from a terminal:

$ jackd --realtime -d alsa --midi seq --playback hw:1

4. Once that's all set, you should be able to use JACK as intended, bearing in mind that Pulse could, theoretically, be routing sound away from hw:1 (in this example, your speaker), so do a dummy check in pavuctl (Pulse Volume Control) to make sure your output is set to something sane.

These great tips - and more! - can be found here:

http://slackermedia.ml/handbook/doku.php?id=jack
and, a little more broadly:
http://slackermedia.ml/handbook/doku.php?id=linuxaudio

Hope that helps.

In reply to by Jason Baker

Good article, but I thought I you were going to talk about a way to make an actual Linux-powered AMP. Like, some kind of Raspberry Pi-powered, headless preamp mated to a power amp and a speaker that you can hack with LADSPA effects, similar to a Mod DUO.

The thought hadn't occured to me. Great idea, and maybe it's something I'll ponder for the future. With a good process monitor, like systemd or ninit, I guess the Pi part wouldn't be too hard. Controlling effect selection would be the real trick. I'll have to take a look at the Mod DUO.

In reply to by Ted Curran (not verified)

When I last taught the Usability of Open Source Software, one of my students did a usability test of Guitarix as their final project. It fared well. A few rough spots (expected in any test) but overall very easy to use.

I suspect this is because as you said, "Guitarix is slightly more modular, at least in its UI. It models itself after a physical rack, with each effect unit being a separate rackable item." So the UI is modeled after an actual amp. If you know how to use a physical amp, you can figure out Guitarix pretty easily.

Be aware that the signal from the guitar with passive pickups is not strong enough for quality use wit the Line In or Mic jack. To avoid excessive noise from having to increase the virtual amp volume, you will benefit from having a buffer/preamp between the guitar and computer.

Good point! It's worth noting that the Zoom H4n digital recorder has an inbuilt preamp, and it can be used as an audio interface. Since the Zoom H4n is so useful, it's not a bad investment in general for audio creators.

Maybe a topic for a follow-up article...

In reply to by Zipslack (not verified)

I have been recording with Linux for some time and can get pretty good results with Guitarix, although I have to admit I have switched to physical pedals for more control. Other things to consider are that you may need a DI box for some soundcards as they don't handle the variable input from a guitar well, but I have had good results with low end Behringer cards.
It's possible to build an effects box with a Raspberry Pi: most tutorials suggest using PureData because it would be less graphics intensive than Guitarix, and there is a commercial (but open source) project called MOD (https://moddevices.com) which is worth a look.

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.