My first journey into writing VST plugins: a stereo expander
(A newer version is available!)
So perhaps you noticed that I’m a musician and also a coder. What better than to combine both of those and write software I can use when making music?
My first project for this was writing a VST plugin (VST is a trademark of Steinberg Media Technologies GmbH and it’s basically an effect interface supported by a large number of DAW applications) that does stereo expanding. What’s that, then?
A trick that’s well known among musicians and mixing engineers for making something sound fuller is to record the exact same thing twice and then superimpose these two takes. A special case of that is putting one take in the left stereo channel and the other in the right. If you do that, it will sound a lot “wider” in the song, and it will also dominate the overall sound of the song a lot more.
Sometimes, though, you’re short on time or don’t have two takes of something handy (or it’s actually impossible to get two takes). Enter stereo expanders! They basically pretend that you recorded two takes, and pan them left/right for you. I’ve got one right here for you, and it’s free to download.
Boring technical details
The first way you might conceive of doing that is to simply play the take in both stereo channels. Oh, wait, if both channels are absolutely identical, it sounds like the sound is in the middle. Mono, even. Tough luck.
The next thing you might come up with is to slightly delay one of the sides (something between 5 and 30 milliseconds). That works rather well, but there’s a small problem with it: the Haas effect. It means that when you listen to the result, the “earlier side” sounds like that’s where the sound comes from. Your brain basically almost ignores the “later side”.
What to do? The answer is actually quite simple: play the original signal “in the middle” first, then a slightly delayed version panned in one direction, then an even more delayed version panned in the other direction.
To make it sound a bit nicer (we’ve now got three copies of the same sound, that’s got to make sharp sounds sound a bit echo-y), we make the center signal a bit quieter than it used to be (and the Haas effect still works to make you believe the overall sound is centered), and we take the sharp edge off it (and the Haas effect is still alive and kickin'). That last bit is done by a Butterworth lowpass filter of order two. If you don’t know what that is, well, you don’t really stand to gain much by finding out. What matters is that it works.
Download
Current version for Windows: Stereo Pan 1.0 (ZIP archive, 218 KB)
Current version for Mac OS X: not available yet, sorry
To install, extract the ZIP archive to your VST plugins folder (often C:\Program Files\Steinberg\VstPlugins). You may need to restart your DAW after that, or tell it to re-scan the plugins folder. That’s it!
Documentation
If you can’t figure out how to use it, tough luck.