Sound Synthesis Lab
Sections
1. Introduction
2. Common wave types - plotting
3. Common wave types - sound characteristics
4. Frequency
5. Amplitude
1. Introduction
Sound synthesis is the act of creating sounds without recording a real-world source (like a guitar). A simple generated sound could be made from a single sine wave, while more complex sounds can be built by adding or multiplying waves together - or by taking an already complex wave (like white-noise) and subtracting parts out.
When we say that a single sine wave can represent a sound, what does that mean? Well, digital sounds that you hear are the result of a speaker vibrating air, which then causes your ear drums to vibrate. These vibrations are pressure waves - as they move through the air they cause it to bunch up and then spread out. This makes areas of high and low pressure. If you plot out these areas of high and low pressure over time, it looks like a sine wave, where the crests of the sine wave correspond to the areas of high pressure, while the troughs correspond to low pressure!
 
It's important to note that this doesn't mean the individual particles of the medium (the air) are moving all the way from the speaker to your ear. If they were, you'd feel a breeze! The wave is what's traveling. The air bunches up and spreads out, so it moves a bit - but back and forth in cycles. We'll talk more about this later.

2. Common wave types - plotting
The blocks below have some inputs and outputs that are shown as blue circles. If a circle is on the left side of a block, it's an input. If it's on the right side of the block, it's an output. Don't confuse this with the block named Output. That block is the connection to your speakers or headphones.

To connect two blocks, click on the output of one block and drag a line to the input of another block, and let go. The line will change to dark blue and the blocks will stay connected even if you move them. To disconnect two blocks, just click on the dark blue connection between them.
Sine Wave Generatorfrequency:
(1 to 4186.0)
Triangle Wave Generatorfrequency:
(1 to 4186.0)
Square Wave Generatorfrequency:
(1 to 4186.0)
Output
Why do you think the Square and Triangle waves have those names?


 
3. Common wave types - sound characteristics
Sine Wave Generatorfrequency:
(1 to 4186.0)
Triangle Wave Generatorfrequency:
(1 to 4186.0)
Square Wave Generatorfrequency:
(1 to 4186.0)
Output
Which wave sounded the smoothest?


Which wave sounded the roughest?


 
So, the shape of the wave can change how it sounds. Well, there are other properties that can change how it sounds as well.

The first is called Frequency. Frequency is a measurement of how often the particles of the medium the wave is moving through complete a cycle of movement. So for a sound wave moving through the medium of air, frequency is how many times per second the pressure waves move air particles together and apart.

This has an interesting effect on the sound we hear! Show the plot and adjust the frequency of the generator. Then, look and listen for the changes.
Sine Wave Generatorfrequency:
(1 to 4186.0)
Output
A higher frequency makes the audio sound:



A higher frequency makes the wave have less peaks and troughs in the same amount of time.

 
Another basic property of a wave is its Amplitude. Amplitude is a measurement of how much energy is in the wave. The more energy we put into it, the higher its peaks will be. Conversly, if we give it 0.5 times (or half) its regular energy then the peaks will be lower.

First, make sure your volume isn't up all the way. Connect the generator to the top input of the multipler, and connect the output of the multiplier to the Output block. Then plot the generator and the multiplier and adjust the value in its box. Notice what happens to the sound and the graph of the wave. Try values like 1, 0.5, and 0.2.
Sine Wave Generatorfrequency:
(1 to 4186.0)
Output
Multiplieraudio:
Connect Here
value:
(-9999 to 9999)
If you happened to put in a value above 1 did you notice a drastic change in the sound? It sounded closer to the Square generator! That's because of a side-effect called "clipping". Clipping occurs when we try to amplify a signal outside the bounds that the system can reproduce. The part outside gets cut off (which flattens out the peaks and troughs of a Sine wave to make it look more like a Square wave). Be careful, as this can damage speakers over time!
If we want to prevent clipping then we have to make sure the peaks of the audio wave don't go outside the bounds. This can be accomplished with more advanced audio techniques like limiting.
 
A lower amplitude (given by a multiplier like 0.5) makes the audio sound:



A lower amplitude makes the wave have shorter peaks and troughs.

 
6. Lesson Done