Skip to content

EarSketch: Lists

By now your script names a lot of sounds, one variable at a time. A list holds them all in one place — and once your sounds live in a list, a loop can place every one of them in the song with a few lines of code.


Overview

We will use Python lists in our songs: one list to organize every sound we use, a loop to add them with fitMedia(), and a list-powered makeBeat() that handles multiple sounds at once.

Before you start

Open your song script in EarSketch. This lab continues the song you've been building.

You've got it when…

  • All the sounds your song uses are stored in a list.
  • A loop adds the sounds from your list to the song with fitMedia().
  • makeBeat() is called with a list to handle multiple sounds at once.

Collaboration & AI

Work: On your own.

AI — AIAS Level 1, No AI: Lists and loops by hand, one more time. What the levels mean.


Organization With a List Data Structure

  1. Read the following EarSketch Curriculum sections and apply them to your song.

  2. Store all the sounds your song uses in a list. See examples in Section 9.1.

  3. Use a loop to access the sounds in your list and add them to your song with fitMedia(). See examples in Section 9.1.

  4. Use information from Section 9.2 to call makeBeat() with a list to handle multiple sounds at once (see the final example code in this section).


Turn It In

Download your script from EarSketch and submit it:

  1. Click the toggle switch to expand the Content Manager.

    The Content Manager toggle switch on the left edge of the EarSketch window.

  2. Select the SCRIPTS tab.

    The SCRIPTS tab at the top of the Content Manager.

  3. Find your song's script in the MY SCRIPTS panel and click its Download button the Download button.

    The Download button next to a script in the MY SCRIPTS panel.

  4. Click the download button the script download icon next to the Script option.

    The download dialog, with the Script option circled.

  5. Turn in the downloaded Python (.py) file the way your teacher has asked for it (Google Classroom, your project notebook, or wherever this class collects work).

  • Your song's script (.py file), turned in as instructed.

How It's Graded

This lab is worth up to 4 points. One score covers everything you turn in.

Score What it looks like
4 — Excellent Every sound the song uses lives in one list, a loop feeds them to fitMedia(), and makeBeat() takes a list to run multiple sounds at once — with no orphaned sound variables left behind from the old way.
3 — Above Average All three requirements met; a sound or two still lives outside the list.
2 — Average The list exists, but the loop or the list-powered makeBeat() doesn't use it.
1 — Below Average Sounds are still individual variables end to end.
0 — Failing Nothing turned in.