Section 7.1

Introduction to the Challenge and String Datatype

Learning Goals

AAP-1.A.1: A variable is an abstraction inside a program that can hold a value. Each variable has associated data storage that represents one value at a time, but that value can be a list or other collection that in turn contains multiple values. 

AAP-1.A.2: Using meaningful variable names helps with the readability of program code and understanding of what values are represented by the variables. 

AAP-1.A.3: Some programming languages provide types to represent data, which are referenced using variables. These types include numbers, Booleans, lists, and strings. 

AAP-1.A.4: Some values are better suited to representation using one type of datum rather than another. 

AAP-1.B.1: The assignment operator allows a program to change the value represented by a variable. 

AAP-1.B.2: The exam reference sheet provides the “←” operator to use for assignment. For example, a ← expression evaluates expression and then assigns the result to the variable a. 

AAP-1.B.3: The value stored in a variable will be the most recent value assigned. For example: 

a ← 1

b ← a 

a ← 2 

display(b) 

still displays 1. 

AAP-1.C.4: A string is an ordered sequence of characters .

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

First, the teacher will introduce students to the challenge for this unit by playing the following video and having a discussion about alternative approaches to making music.

The objective of this lesson is to introduce students to the idea of using strings through the use of makeBeat() in Earsketch. By breaking down how makeBeat() interprets strings, students will gain understanding of how the string data type is structured – a sequence of characters being represented as a single data type. Additionally, students will form simple rhythms in Earsketch as a first step in giving them more powerful tools that increase the control over the songs they create in Earsketch.

Activities

Activity 7.1.0 (40 minutes)

Activity 7.1.1 (10 minutes)


Activity 7.1.2 (55 minutes)

Use the provided String Data Type slides and Ableton Step Sequencer website with the described explanation below. The example EarSketch code in the slides is provided as well.