Skip to main content

Introduction

A computer produces sound and music by causing a speaker cone to vibrate, making waves in the air. An electromagnetic coil moves the speaker cone inwards and outwards: If the electrical voltage is positive, then the cone flexes outwards. If it is negative, it pulls inwards. If the voltage is zero, then the cone returns to its resting position.

These voltages are produced by a digital to analog converter (DAC) circuit, which converts 16-bit integers (the Hybrix PAIR type) into speaker voltages. The integers are called digital samples. A sample value of 32,767 ($7fff) pushes the speaker cone all the way out, whereas a value of -32,767 ($8001) pulls it all the way in. For math discussions, sometimes we will use the range -1.0 to 1.0 instead of -32,767 to 32,767. (How many volts is that? It depends on the kind of device. For example, earphones generally use smaller voltages than big speakers.)

Terminology: Musicians sometimes use the term "audio sample" to mean a sound recording. But for digital signal processing, "sample" always means a single number.

To support stereo sound, the Hybrix computer features two DACs: one for the left speaker, and one for the right. Each DAC processes 22,050 samples per second. The Jamdac synthesizer's job is to generate these two streams of samples. These streams are called signals. If the sound is recorded, then that signal would be an array of samples. However for interactive music and sound effects, it can be thought of as one sample at a time, or small batches of samples that get processed every few milliseconds.

Procedural synthesis

Modern musical synthesizers rely on large collections of prerecorded sound clips (a single snare drum hit, a string being plucked) along with complex computer algorithms and even physical simulations of air waves. By contrast, Jamdac is a procedural synthesizer, which means that it generates samples from scratch using relatively simple algorithms and arithmetic. As an example, we might start by generating a "square" wave that flips between -1.0 and 1.0 every few milliseconds, then slowly alter the length of the lines to waver its tone, or gradually scale the numbers to make the sound "fade out."

This approach is most similar to classic FM synths or chiptunes. However, Jamdac's sound is a bit more modern. Classic systems worked within strict limitations to minimize electronics cost, whereas Jamdac's focus is to teach intuitive recipes for making music, enabling you to understand how each sample is calculated. A couple DACs and a bit of signal processing all you need to "jam"!