Monday, July 24, 2006
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.