AAP-3.A For procedure calls:
a. Write statements to call procedures.
b. Determine the result or effect of a procedure call.
AAP-3.B Explain how the use of procedural abstraction manages complexity in a program.
AAP-3.C Develop procedural abstractions to manage complexity in a program by writing procedures.
The objective for this lesson is to add melody to the song using custom defined procedures/functions. Activity 1 will introduce procedures by modularizing the melody of the song into separate functions. Activity 2 will explain how to find and use the results of a procedure to automate the calling of the separate melody functions.
Activity 7.8.1 (150 minutes)
Show the video of the song Happy by Pharrell and facilitate class discussion on the number of times the two basic rhythm sections occur in the first 30 seconds of the song (PowerPoint slide 2).
Have students paste and run the code on A-B-A form and facilitate discussion on the inefficiency of the lines of code that are repeated (PowerPoint slide 3, EarSketch Chapter 9.2 (A-B-A Form)).
Have students paste and run the “Custom Function” code and comment out line 26 to see that the code runs but does not make music since the function is not being called (PowerPoint slide 4, EarSketch Chapter 9.2 (A-B-A Form)).
Facilitate class discussion on the comparison of the A-B-A form without functions and with functions (PowerPoint slide 5, EarSketch Chapters 9.2 and 9.3 (Custom Functions)).
Assign students Most Repetitious Song MiniTask to complete in one class period (PowerPoint slide 7).
In another class period (assuming a 55-minute class), assign students Collaboration Game MiniTask (Parts 1 and 2) that uses the result of the Most Repetitious Song MiniTask (PowerPoint slides 8-9).
In a third-class period (assuming a 55-minute class), assign students Collaboration Game MiniTask (Parts 3 and 4) (PowerPoint slides 10-11
Present each multiple-choice question to class and allow time for thought. Then, discuss as a group (PowerPoint slides 12-15).