warming up your workspace

Python Foundations through Audio & DSP

Never written code before? Start here. You will learn the absolute basics of Python using sounds, samples, frequencies, and waveforms as your playground. By the end you are ready for Project 1.

First words

  1. Display your first message
  2. Print a sample rate and a frequency
  3. Explain your code with comments
  4. Label a waveform with strings
  5. Calculate an amplitude ratio

Remembering things

  1. Store a sample value under a name
  2. Update an amplitude using its current value
  3. Choose integer, float and string values
  4. Convert numeric text into numbers
  5. Give audio settings descriptive names

Making choices

  1. Compare an amplitude with a threshold
  2. Print a warning only when a limit is exceeded
  3. Choose between two messages with if and else
  4. Choose a frequency band with elif
  5. Combine Boolean checks with and, or and not

Doing it again

  1. Repeat a countdown with while
  2. Visit sample positions with for and range
  3. Build a running sum of sample values
  4. Stop searching at the first matching sample
  5. Visit channel and sample pairs with nested loops

Many values and reuse

  1. Read selected samples from a list
  2. Find the largest sample value
  3. Define and call an announcement function
  4. Pass values into a function and return a scaled sample
  5. Capstone: report a sample maximum and frequency band

Explore the full field