Introduction to Coding Sound

People have been making artificial (non-vocal) sounds for a long time —watch the video to hear a replicated Neanderthal flute being played!

How does the Neanderthal flute produce these variations in sound? It has to do with how breath oscillates within a cylinder

In fact all sounds are based on oscillations and the physics of these can be complex

Chaos and Complexity, Resolved

Even though there are chaotic elements in sound production we can understand what's going on at a high degree of fineness when, for instance:

Overtones

In the example of the string being vibrated by an oscillator we found that particular setup had a "first mode of vibration" at 11 Hz (11 cycles per second) and that at multiples of this "fundamental" a series of "harmonics" could be discovered where the vibratory sections divided and divided, separated by nodes of (relative) stillness

NOTE: It's worth considering that 11 Hz is far to low for human hearing, which ranges somewhere between 20 Hz and 20,000 Hz (or 20 kHz) —with a lot of variation among individuals, especially high frequencies, by age
Be sure your volume is turned down by at least 1/4 when running this test!

Sounds produced by physical oscillations —as opposed to pure, electronic tones, are "dirty", containing much more sonic information than just their fundamental "tone" or "pitch"

It's this "noise" that gives sounds richness, texture and makes them so much more palatable than simple electronic signals

Some Terms

Sound occurs when oscillations travel as waves through a medium (like air)

NOTE: The air doesn't move, but waves propagate through the air

All sound can be described by more or less complex wave forms —the latter represent the summation of simpler ones

The Course

Specifically, we'll be coding sound for the web

The course makes use of Tone.js, a JavaScript library for addressing the Web Audio API, which can be addressed directly in vanilla JavaScript

What Tone.js offers is structure —specifically it offers common DAW (digital audio workstation) features like prebuilt synths, effects and other building blocks to create your audio projects

Your projects will become web pages, hosted through GitHub Pages —much like this textbook— and become a digital portfolio of sound design you can share with me or anyone!

> Heres a tutorial for [setting up VSCode to communicate with Github](https://albright.instructure.com/courses/8516/pages/setting-up-vscode-and-github)

Structure

The course is divided into three sections: We'll be creating playable instruments, generative soundscapes and interactive environments

Each new concept will come with its own example code, running on this site

Your task will be to examine the code, manipulate and change it in order to more fully understand it and follow the challenges and other directives embedded in the JavaScript comments in the code to further your skills and comprehension