Tuesday, November 11, 2008

Synth: Envelopes, VCA's, and the ALSA Modular Synth

While learning about subtractive synthesis, it works a lot better if you have a modular synth available to play with. The problem is that modular synths are boucoup expensive. So, the next best thing is a virtual modular synth... a program that runs on your PC. The best one I know of (for learning) is the ALSA Modular Synth. "ALSA" stands for "Advanced Linux Sound Architecture," and is the sub-system that provides sound drivers for Linux. Therefore, it's only available for Linux (and possibly Mac OS X). But any other software you find on non-free operating systems will probably have similar concepts.

Here's a screen-shot of my setup for this lesson. You have the ALSA Modular Synth (AMS) in the top window, JACK in the bottom left [1], and the MIDI Virtual Keyboard in the right. Using JACK, I plug the keyboard into AMS.



Inside of AMS you see a MIDI Controlled Voltage (MCV) module and a PCM Out module. The MCV converts MIDI messages into various voltage signals that can be used to control things like VCO's (voltage-controlled oscillators). The PCM Out module is how the sound will get to our sound card. What we put between will determine the kind of sound that we have.

In the next figure, I've laid out several modules:




  • MCV - Midi Controlled Voltage module

  • VCO - Voltage Controlled Oscillator

  • ENV - Envelope Generator

  • VCA - Voltage Controlled Amplifier

  • PCM Out - output to sound card


However, I've directly plugged the sawtooth wave from the oscillator to the sound card output. Here's what it sounds like when I play C-G-C' (slow, then fast):



The clicks at the beginning are because the VCO is always on... it just started with a low frequency. Also, I didn't hold the keys down. When I released the keys, the note kept going. The VCO never stops.

Since we usually need to make our notes have a definate start and stop, we need to put the notes in some sort of envelope. Something that contains the duration of the sound. For this, we use an envelope generator and use it to control a voltage-controlled amplifier (VCA), like this:



The envelope generator is not an oscillator. It's more like a cuckoo clock. When the clock strikes 12: a door opens, the cuckoo comes out and says "cuckoo!" and then goes back in, and then the door closes. In the same way, when you hit the keyboard it triggers a pre-defined set of actions or motions. It will turn up the voltage, then hold it, then turn it down. You can use this voltage signal to drive lots of different things: filters, VCO's, LFO's (low-frequency oscillators), or possibly even another envelope generator.

The voltage-controlled amplifier is like a volume pedal. However, instead of controlling it with your foot, it gets controlled by an input voltage. By plugging the voltage signal output of the envelope generator to the input of the VCA, we can make notes start and stop.

The envelope generator we're using is an ADSR (Attack, Decay, Sustain, Release). When set like this:



It will sound like this:



The notes start and stop, and have a little fade-in and fade-out. The envelope generator is triggered by the MCV through the "Gate." A gate is an on/off device that says "we're playing now." "Ok, not now." So, it typically sends something like 1V when a key is pressed, and 0V when it is released.

When you set up an ADSR: Attack is time (usually milli-seconds), Decay is time, Sustain is volume (as a percent of full-volume), and release is time. When you press a key, the attack and decay will happen according to their timing. The sustain volume will last as long as you hold the key. The release determines how long it takes for the note to return to silence after you release they key.

If we want to make something that sounds more ethereal, softer, or just plain like a mosquito, you would increase the attack and release times to something relatively large (like 1/2 of a second):



And these settings sound like this:



So, the oscillator is your noisemaker. The envelope generator is like a computer program that will automatically turn a knob for you. The MIDI controller allows you to control notes and durations through frequency and trigger signals. The VCA is like a volume knob.

You can probably see that the VCA and the envelope generator (since they pretty much are manipulating voltage signals) to do things they were never intended to do. For example, suppose that instead of having the MCV control the frequency... you make the envelope generator control the frequency. This would get you annoying siren-like noises. Sounds something like this:



Have phun!

[1] Actually QJackCtl, but this only matters to people who already know what it is.

No comments: