Into to Synthesis - BleepLabs/Arduino-Light-And-Sound GitHub Wiki

We’ll be using this Moog styled browser based synth to explain some of the basics.
You can use your computer keyboard to play the on screen piano keys but it will also receive MIDI information.
(It only runs in chrome and is a little touchy unfortunately. The best way to get it to run seems to be opening a new incognito window and paste the link there. You do not need to install it, that wasn’t working for me at all.)

Here’s what’s going on inside of it:

This is basically the same configuration you'll see in every keyboard based synthesizer.

The oscillators create the sound. They are always going no matter what the other modules are doing. The sound passes through the filter then into the amp.
The pitch of the oscillators are controlled by the keyboard.
The keyboard also puts out a gate signal. When a key is held down the gate is on or opened.
The envelope generator gets this gate signal and when it’s opened it starts to output the attack of the envelope. When closed it begins the release.The amplifier is basically turned all the way down unless it's getting a signal from the envelope generator.

Oscillators

On the left side of the web synth we have 3 oscillators. An oscillator is just something that changes regularly. We can hear it directly or we can hear it affecting a variable of another device.

MOD is a low frequency oscillator, an LFO, with the tremolo knobs changing how much it alters the pitch of OSC1 and OSC2.

OSC1 and OSC2 are the oscillators you hear.
You can select from different waveforms, detune them (12 o’clock on the knob means that osc is playing the note you hit on the keyboard in tune), and change their volumes with the MIX knobs.
Interval changes the pitch range aka octave. The smaller the number the higher the pitch. (This nomenclature of “feet” is left over from old organs and is seen sometimes on synths).

Different waveforms give different harmonics which are all the little frequencies that make a sound unique. A sine wave has no harmonics so it’s just one clear tone. A triangle wave has a few more and saw and square wave have many more.
Different analog oscillators have slightly different shapes with different harmonics but most produce these simple geometric waveforms. Digital oscillators can produce any signal we program for them to step through.

Detuning the oscillators can give very interesting effects. Though both oscillators are controlled by the keyboard at the same time and go through the single filter together, you can change the relative tuning of one or both so it’s anywhere from several notes off of the intended pitch or just a few cents.

Keyboard - Triggers and Gate

A keyboard puts out a gate signal when the key is held down. When the key is pressed a high level is sent out. When no key is pressed, a low low is sent. It’s simply on and off.
This on off signal is used to start the envelope generator and also holds it at the sustain level. Once the key is released the release part of the envelope begins.
Like a lot of the terms here trigger and gate can get mixed up and are sometimes used interchangeably but they are different. A gate is a signal that turns on and off when a note from a keyboard or sequencer or anything is held “on” and a trigger is a signal that happens at a set length when engaged. If you send a trigger to an ADSR envelope it won’t work as expected since there is very little “on” time. A gate sigan can be used to trigger things, though.

The keyboard also sends data to the oscillators to control what note they are playing.

A sequencer could also be used in place of or in addition to the keyboard. We can think of it as a player piano putting out note and gate data.

An arpeggiator is a device that takes note data in and outputs a small sequence that is based on one or more notes.

Filter
The oscillators are mixed together and then go through a lowpass filter. Only frequencies lower than the cutoff can get through. This means we can remove harmonics.
Cutoff changes the frequency of the cutoff. All the way to the left would be almost no sound would get through, all the way to the right and the filter is not removing anything.
This filter follows the keyboard meaning that the cutoff frequency moves automatically with whatever key is pressed so each note is filtered the same amount. Otherwise a high note would not be heard at all.

Q aka resonance is the amount of feedback. It produces a pretty distinctive ‘70s synth sound.
All the way to the right means you will have another sine wave created at the cutoff frequency.

MOD adjusts the amount that the LFO aka modulator is moving the the cutoff control.
ENV adjusts the amount that the filter envelope is affecting the cutoff.

Envelopes

Unlike an oscillator that creates a constant signal, an envelope only produces an output based on an incoming gate signal. This envelope signal is used to modulate other variables and does not produce sound on its own.
The most simple envelope is the on/off of the key or button making sound. When it’s down the envelope tells the amplifier to turn up. When the key is up, the amp turns off.

After the filter the sound passed through an amplifier that is controlled by the volume envelope.
The filter envelope just goes to the filter.
The two separate envelopes both start when you press a key and release when you let go.
Attack - time it takes to get to full volume (aka amplitude) after the envelope is triggered(in this case when the key is pressed).
Decay - amount of time it takes to drop to the sustain amplitude after the attack is finished.
Sustain - amplitude to stay at after the decay is done and while the note is still being pressed.
Release - amount of time it takes for the amplitude to drop to 0 after the note/trigger is released.

Master section

These are all “outside” of the synth. They are effects that the final output is run through and don’t interact with any of the synths modules.
Drive - One Moog signature is their drive which is a type of distortion. It adds more harmonics to the sound without increasing the overall volume too much.
Reverb - This adds space to the sound, making it less dry and sterile and computery.
Volume - The final volume coming out of your speakers.
MIDI in - MIDI is a way synths of all kinds can interact. Here you can select a midi device to use as a keyboard.
KBD_OCT - changes the octave of the onscreen keyboard and the computer’s keys

Control voltage

When it gets down to it any sytnestier, analog or digital, modular or keyboard based, is sending data between its different parts. Control voltage is this data.
In an analog synth it’s literally voltage. It can be any voltage between the boundaries that it can read. In a eurorack modular this is around -5 to +10 volts. This is why we cast VCA, VCO, VCF. Voltage controlled Filter, amplifier, and oscillator.

On a patchable modular synth all of these ins and outs are exposed. On a keyboard type synth there might be a couple ins and outs but for the most part it’s all hard wired with some switches or knobs or computer interface to control what is patched to what.

In our systems it’s numbers. We’ve got a ton of power but need to build the framework for it.