Monday, July 24, 2006

Effect: LADSPA Vocoder (Howto)

While working on a project, I decided I needed a Vocoder. A vocoder, for the uninitiated, makes the user sound like a robot, a cylon, a transformer... whatever you want. This is accomplished by mixing the formant (voice) with the carrier (synth sound, usually a drone). The combination results in something very strange and robot-like.

Back in the day, one needed an expensive vocoder unit to do something like this. Some VST plugins range up to $150 (Orange Vocoder). Now, however, Linux Rock Star's can do it with a plugin and a softsynth.

There's an excellent LADSPA plugin called, surprisingly enough, Vocoder. At the homepage, there is a good explanation of the workings of a vocoder. We'll look at making the vocoder work here, however. Having the regular LADSPA plugin pack, JACK, and Jack-Rack installed is a prerequisite for this. A realtime kernel patch doesn't hurt at all.

Pick up the plugin here. Now, you'll uncompress it in a directory and find a bunch of sourcecode. Before you compile and install this however, there is a patch that will make it work with Jack-Rack really well. Get the patch, provided by a very cool user on the Linux Audio Users group here.

Now the tricky part. Open up a shell and go to the directory where the files are. Make sure the patch is with the source code you unzipped. Now, type "patch vocoder.c stereo-0001.bin". This will modify the source code to make it jack-rack compatible. Now run "make" and "sudo make install" (it will ask for root password). It will put this with the rest of your LADSPA plugins, possibly overwriting the old vocoder (same thing without the jack-rack patch).

Now open up JACK and start it. Also launch jack-rack. Now you should see "Readable Clients" on one side, and "Writable Clients" on another. Both should have "alsa-pcm" in them. Now start up your favorite synth. This will be the 'carrier' of your robot voice. A good saw wave could do nicely, but be sure and try out all kinds of things. ZynAddSubFX, amSynth or a VST (polyiblit is shown) should do nicely.

Next, open up jack-rack. Click Add -> Uncategorized -> V -> Vocoder. This will add a vocoder to your effects chain in jack-rack. Here, you can choose the number of bands, etc. (I won't go into what that is here).

Now for the somewhat tricky part: First, in your mixer, select your recording source (microphone, for example) then go back to JACK connections. Click the (+) buttons next to jack_rack in "Writable Clients". Notice the two inputs. One of these will be the formant and one will be the carrier. Connect "alsa_pcm" under "Readable" to "in_1" under "jack_rack" in "Writable". Next, select the synth and connect it from its heading under "Readable" to "in_2" under "jack_rack" in "Writable". Click on the screenshot at the top of this entry to see what this looks like.

Everything's almost there. Next, either make the synth play a drone note and talk into the microphone, or play some notes and talk. By playing notes, the vocoder can, "sing" according to what is played. Welcome to robotland. Vocoder's can be a lot of fun. Experiment with it and have fun using Linux!

Acknowledgements: Thanks Linux Audio Users List.
Disclaimer: I'm not responsible if anything goes wrong or is messed up; you're on your own.

Posted by DCZX @ 10:19 PM

Read or Post a Comment

Hello DCZX! I just ran across Linux Rock Star and the blog is fantastic! I've added it to my daily bookmark folder and look forward to reading more. I'm very slowly working on getting my own GNU-based recording rig up and running. I'll be in touch with info about it when it's ready.

Thanks for all the good reading!

Kris Bergstrom

Posted by Anonymous @ 8:37 AM #

Thanks Kris, I'll look forward to hearing about your new rig!

Posted by DCZX @ 12:06 AM #

Hey, thanks for this great tutorial. I was killing myself trying to get this to work before I came across your page.

However, your instructions regarding the JACK connections did not work for me on my Ubuntu machine. Instead of the part that reads: "Connect "alsa_pcm" under "Readable" to "in_1" under "jack_rack" in "Writable". Next, select the synth and connect it from its heading under "Readable" to "in_2" under "jack_rack" in "Writable","
I had to do the following:

Using the JACK connections, Connect 'out_1' of your synth (I use Zyn synth) to 'in_1' on the JACK Rack, and 'out_2' to 'in_2'. Under 'alsa_pcm', connect 'capture_1' to 'vocoder_1-1_i1' (I believe these extra vocoder connections are created by the beautiful patch you mentioned). Connect 'capture_2' to 'vocoder_1-2_i1', and lastly, JACK rack 'out' to alsa_pcm 'playback'.

I don't know why this would work so differently for me, but maybe they changed the plugin. In any case, I hope this helps someone.

If it wasn't for your article, I would never have got this working at all (the standalone vocoder program from the same site as the plugin won't compile on my machine at all).

When I get something recorded that is worth listening to, I'll let you know. Thanks again!

Posted by [euchrid] @ 3:36 AM #
<< Home

Linux Rock Star Sponsors

SynthStudio Pack
Energy XT2