Module 1: Audio

Here we look at code as a performative interface. Looking beyond code as a fixed object, we find artistic value in the process of code evolution. We explore experience of writing code in front of an audience and accepting imperfection. In a more practical sense, this is particularly good training for coding interviews.

Project 1: Live coding with Rattle

Your goal is to experience first-hand the practice of live coding. You will be using Sonic Pi and will record a video with audio of you live coding.

During your performance, you must:

Some language features you *must** use include:

The recording should last roughly 10 minutes (10 points). Note that in order to achieve this length, you will need to improvise a bit with your code in real-time. Do not plan out all 10 minutes exactly ahead of time, but instead have “goalposts” as discussed in class (10 points). Demonstrate familiarity with a core subset of the language (10 points). Make sure to have a focus on building a “soundscape” as a opposed to replicating your favorite sound (5 points).

Key tips

What to hand in?

How am I graded?

Rubric


Lecture 1-1: Technicals of Audio

https://docs.google.com/presentation/d/1x-KvHXgALg_QjKiBMyzYV6LRfhywaWjB7rKLcB3P13Q/edit?usp=sharing

What is digital audio? How is sound represented in a computer? What new challenges arise in programming audio as opposed to non-time domain programming?

Lecture 1-2: Live coding How to

Lab: Rattle

The goal of this lab is for you to practice live coding in Rattle, learn the basic interface, and make a short recording.

Start from this code. The outer loop picks a root note for each phrase, and the inner loop picks pitches and rhythms within the phrase.

@live_loop("melody")
def melody():
    use_synth("pluck")
    use_random_seed(42)                        # position A
    for phrase in range(4):
        # position B
        root = choose(["e3", "g3", "a3"])      # outer-loop choice
        for n in range(3):
            # position C
            play(choose(scale(root, "minor_pentatonic")))   # inner-loop choices
            sleep(choose([0.25, 0.5]))

Move use_random_seed(42) to each position below. Before you run it, predict what you’ll hear. Then listen, and write one sentence on what repeats and what changes.

  1. Position A (top of the live_loop)
  2. Position B (top of the outer loop)
  3. Position C (top of the inner loop)
  4. No seed at all

Then try using two seeds at once. Can you make the root notes change every phrase, but the rhythm within each phrase stay the same?

To turn in:

Once you have completed the above tutorial sections you will have a good foundation to start live coding yourself. Record a video of you live coding. It doesn’t have to be fancy or long (less than 30 seconds is fine) - though a loop that plays a single note is enough. This is to confirm that you have the tool installed, understand the basic usage, can record your audio and code at the same time, and can post a video online. Post your video recording publicly, and save the link. For the lab, simply submit the link in a .txt file!

A note on recording

Please be sure you are recording the sound directly from your computer, and not record the output of your laptop speakers. If you are using zoom, you will want to share computer audio. Be sure to also go to “More” > “Select sound sharing mode” > “Stereo (high-fidelity)”. Be sure to mute your microphone. Follow analogous instructions for other screen recorders (e.g. quicktime). Once you have made your recording, be sure to listen to it once to make sure the audio has recorded properly and has not picked up your roommates’ conversations.


Lecture 1-3: Generative Processes and Random Seeds

Lecture 4-1: TBA