Section 6.1
Intro to EarSketch & fitMedia
Learning Goals
CRD-2.B.4: The behavior of a program is how a program functions during the execution and is often described by how a user interacts with it.
CRD-2.B.5: A program can be described broadly by what it does or in more detail by both what the program does and how the program statements accomplish this function.
CRD-2.C.1: Program inputs are data sent to a computer for processing by a program. Input can come in a variety of forms, such as tactile, audio, visual, or text.
CRD-2.C.4: Inputs usually affect the output produced by the program.
CRD-2.I.2: A syntax error is a mistake in the program where the rules of the programming language are not followed.
CRD-2.I.3: A run-time error is a mistake in the program that occurs during the execution of a program. Programming languages define their own run-time errors.
CRD-2.I.4: An overflow error is an error that occurs when a computer attempts to handle a number that is outside of the defined range of values.
CRD-2.G: Describe the purpose of a code segment or program by writing documentation.
CRD-2.J.2: Defined inputs used to test a program should demonstrate the different expected outcomes that are at or just beyond the extremes (minimum and maximum) of input data.
DAT-1.A.1: Data values can be stored in variables, lists of items, or standalone constants and can be passed as input to (or output from) procedures.
Objectives and Description
The objective of this section is to introduce the students to programming using EarSketch. Students will receive an introduction to two of the celebrity artists in the EarSketch sound browser then demonstrate their understanding of fitMedia() by creating a script that utilizes fitMedia() and debugging their scripts.
Students will further demonstrate their understanding of fitMedia() by intentionally creating fitMedia() syntax errors for their classmates to debug. Last, students will demonstrate their understanding of syntax by debugging three errors in a provided script.
You will need to navigate to AP Central to assign the 1.4 Daily Video 1 and 2 called, "Identifying and Correcting Errors" video to the students for Step 11.
Activities
Activity 6.1.1 (45 minutes)
Without showing the video on your screen: timestamp - 55 seconds to 1 minute 10 seconds - play the Underdog video by Alicia Keys and see if students can guess the artist.
Without showing the video on your screen: timestamp – begin at 12 seconds - play the Happy by Pharrell video and see if students can guess the artist.
Play a couple of the sound samples of Alicia Keys and/or Pharrell to show that their music is in the EarSketch sound browser.
Explain the “What is EarSketch” slide (Slide 8). Inform students that EarSketch is a free, browser-based tool that will teach them to code in Python or JavaScript through music remixing.
Explain the different panels of the EarSketch interface and how to create an account (creating an account is optional when trying out EarSketch. However, accounts are required to save scripts).
Demonstrate how to create a script and use fitMedia().
Identify the code editor and select the “Click here to create a new script!” button.
Give your script a name.
Select Javascript as your programming language.
Set a desired tempo or utilize the content manager to audition sounds. Hover the mouse over sounds you like to learn more information, and select your preferred tempo based on the tempo of your favorite stems.
Underneath the setTempo function, utilize the fitMedia() function to play a sound.
Explain debugging and model debugging by making a 2 or 3 track script while intentionally making syntax errors so that students can help fix the errors. Try misspelling fitMedia, adding too many or too few commas, leaving out a parenthesis, etc.
Provide the link of the AB form change the tempo fitMedia() script to the students. Instruct students to change the tempo and make two intentional errors for their classmates to debug.
Provide the link of the EarSketch debug script to the students. Instruct students to debug the script. Offer help and suggestions as needed.
Confirm that students were able to debug the script. Provide time for students to discuss how they approached or identified each error.
Students will encounter other types of errors. Have students navigate to AP Classroom and watch 1.4 Daily Video 1 and 2 called, "Identifying and Correcting Errors." Use the Errors, Definitions, and Correcting Errors handout to guide students to the assignment and have them match vocabulary terms with their definitions.
Activity 6.1.2 (25 minutes)
Now that students have debugged some code and created a short script with a fitMedia function, let's define some programming terms using the EarSketch Quick Tour program.
Have students click on the i (information icon) in the top right corner of the EarSketch window and select Start Quick Tour. After the tour is finished, the program code will be in the code editor. Students should be able to define the following terms while reviewing the quick_tour program. Use this teacher resource for definitions.
program
code segment
input
behavior
Have students run the quick-tour program. They should be able to explain how the program functions and be able to describe what it does.
Resources
6.1.1: EarSketch AB form change the tempo script (student resource)
6.1.1: College Board's 1.4: Daily Video 1 and 2 titled, " Identifying and Correcting Errors" available through AP Central and AP Classroom (Teacher Resource)
6.1.1: Errors, Definitions, and Correcting Errors (Student Resource)