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.

Friday, November 7, 2008

TQM Church: Small Groups


If you had the Spirit of Gawd, you wouldn't be afraid of that snake!


So, you're sitting in a small group with a bunch of normal people, having a normal discussion... when all of the sudden you feel something slither against your leg. Then someone to your left starts praying out loud in gibberish while the one across from you just starts moaning and crying. [1]

Wanna get away? [2]

This has got to be the worst fear of any evangelical church leader. And, believe it or not, stuff like this does happen. And experiences like this can be extremely damaging if it happens to you. How do you prevent something like this from happening?

Most churches implement their quality control by micro-managing the small groups (for example, requiring everyone to use the same curriculum or the sermon notes) and by being picky and choosy about who can be a small group leader. In churches where I've seen this, you notice that the people who have been in the church for years, "aren't ready" to lead groups and ministries. But... new people who just joined the church are "an answer to prayer." That is, until a couple of years rolls by and we see their mistakes and imperfections. Their names quietly go to the 'D' list ('D' for damaged goods).

Why does this happen? New people are perfect. They've never made a mistake.

Micro-management and high standards will prevent embarrassing situations like snake handling and weird doctrines and such. However, they promote another atmosphere where information is spoon-fed to the masses. That's fine on Sunday morning, but small groups are where you can interact — even argue. But a spoon-fed curriculum and yes-man leader will continue the trend of lulling people to sleep. Nice. Safe. Nothing to see here.

Also, the number of groups is reduced because you can't find enough qualified leaders. As people make more and more mistakes (which people do), the standards get higher and the group count gets smaller.

So, how to you keep stuff like this from happening?

Well, for starters: give up. Let Jesus be responsible for his own quality control. It's his church, right? He's responsible for our discipleship and for the growth of the church.

And then... because we do have some responsibility in this area: be in relationship with your leaders. (What a concept!) In fact... erm... isn't this how Jesus does it? With the disciples... and with us. Try not to make it like a boss-employee relationship... but more like friends or a partnership.

Kudos to my home church which has done this for years. Yes, there are down-sides to having a networking model of organization/management... but the up-side is small groups that change lives — imperfect people seeking God together... creating an atmosphere of God's power. The down-side of a network model is that sometime, someone will drop the ball... and since the organization is built around relationships someone else gets hurt. Also, sometimes the snake-handling might happen. It won't be the end of the world.

[1] I stole this idea from Garrison Keillor (A Prairie Home Companion).

[2] Southwest Airlines commercial tag-line.

Thursday, November 6, 2008

Synth: Subtractive synthesis and VCO's

A few months ago, I promised Mike to talk about FM synthesis and subtractive synthesis. I ran into technical difficulties with that... so it's taken me this long to give up and take another approach. [1]

Most analog synthesizers take an approach called subtractive synthesis. This is where you take a strong starting signal (sound) and you remove parts of the sound to get the sound that you want. A very simple example of this is volume pedal. You take a strong input signal (like a guitar) and plug it into the volume pedal. When the pedal is all the way up, the signal should just pass through (unchanged). When you turn the pedal down, it subtracts from the original signal to make it quieter. This is actually one way to get synthesizer-like sounds out of your guitar (by doing volume swells or emulating an envelope generator).

Everything starts with a signal source. The source can be:


  • An oscillator — an electronic device that creates basic wave-forms like a sine wave, triangle wave, sawtooth wave, etc.

  • A sample — an actual recording of an instrument or sound. It's usually relatively short, and just a single note.

  • An instrument (like a guitar, voice, electric piano)



But, let's start by talking about the voltage controlled oscillator (VCO).

A basic VCO has an input (a DC voltage from 0 to 10V) and an output (the audio signal with the desired osciallation). Most VCO's will let you select between several types of waves (click for Wikipedia links, some with audio clips): a sine wave (flute-like sound -- like a hearing test), a square wave (computer beep), a triangle wave (a harsh, electric-organ-like sound), and a sawtooth wave (a very harsh, annoying alarm-clock-like sound). As you turn up the voltage on the input, the frequency of the output signal will also go up. The standard is that the frequency will double for every 1V that you add. (Thus, they say "one volt per octave.")

The VCO does not have a volume knob, nor an on/off switch, nor keyboard, nor any other sort of nice things. The VCO is always on. If you plug the VCO directly to the power amplifier... you will always hear noise.

To control the voltage, you will typically feed it a signal from a keyboard controller that has a voltage output. Since you can only send one voltage to the VCO (and the VCO can only take one), this is a monophonic setup. No matter how many buttons you push, the controller will only send one voltage to the VCO (so you only get one note out).

So, what would happen if I put something between the keyboard controller and the VCO? Something that changed the voltage a little... like a slow-moving oscillator or something? What would happen? Answer: Vibrato.

Or... what would happen if I put something like an envelope generator between the keyboard and the VCO, and I made the pitch go up slightly after striking the note, and then have it go back down gently? Answer: It will sound like a string being plucked, or like a gong.

These two ideas are actually the start of a concept called FM Synthesis.

Now, as we said, the the output side of the VCO is always on. So, next time we'll talk about how to use an envelope generator and a voltage-controlled amplifier (VCA) to create attack, sustain, decay, etc.

[1] See the comments for a description of what I tried to do and the problems that I had.

Sunday, November 2, 2008

Not Lyrics

In writing lyrics for rock
I used to think I ought
To learn the wit and form
Of poetry.
That in the mastery of such,
With rhythm sound,
I may transfer the thoughts -- emotion
To the form of melody.

It is not.

The word and mouth combine
In ways ineffable.
In consummate voice and breath:
One instrument.
And if the voice, unfaithful,
Conforms them to a tune
The words commit divorce
At this adultery.

But all this toil has not been wasted.
Begin with melody and rhythm,
And then you salt your note with lyric.
'Cos in the act of learning meter
And forcing words into a channel
A useful tool is in your purchase
To shape and sculpt the sound of singing.