After completing this activity, students should feel relatively comfortable:
Identifying, declaring, and using variables
Calling playNote with a note parameter
Identifying which sounds map to which numbers in TunePad
Warm-Up Discussion (~5-10 min)
Talk about their day, transition to discussion ideas provided below
Main Content- playNote section (~10 min)
Have them read over the playNote section in their project of choice and discuss
Main content - variables section (~10 min)
Give students time to read about variables and prompt them to explain what they’ve learned
Drill (~5 min)
Instructs student to use what they’ve read to define variables and call playNote
Activity section (~15 min)
Introduce and start the activity. Have them change the variable values in the drum cells (e.g. kick = 1 to kick = 0)
Students can also try switching the cell instruments to a different drum kit
Participants will learn about the beats parameter in a subsequent lesson! The goal is to gradually peel back the layers
Share (~5-10 min)
Give them a quick recap and then share with them a link to this presentation, which contains a review of the material from the session along with a challenge activity at the end
N.B. there’s some flex/buffer time to allow for introducing activities, login, and/or potential slowdowns. Take these timings as recommendations and use your own judgement
Below are the sample projects that you’ll work with this week (these could be copy and pasted in the chat for students to easily access). These all have the exact same text, just slightly different coded beats:
Rap beat: https://tunepad.club/project/28935
West coast rap beat: https://tunepad.club/project/28936
Trap beat: https://tunepad.club/project/28955
Reggaeton: https://tunepad.club/project/28932
To keep things engaging and relatable, you might start off by introducing this activity through a brief discussion of beats that people have heard in their favorite songs. You could even play snippets of a few songs that kids like and base the discussion around those tracks. Some questions you might want to ask are listed below.
Strongly recommended: Greet them with enthusiasm, ask about their day, and then take one of the avenues below or whatever you feel is appropriate. Keep in mind that your energy rubs off on them
What kinds of sounds do you hear in the beat?
Have them list them out
What are your favorite parts about the beat?
Could even ask: “Do you have a favorite sound in the beat?”
Instruction 0: Login to TunePad (~5 min)
Make sure everyone gets logged into their accounts and troubleshoot as needed. If a student is having login issues, you might just wanna share your screen for the duration of the session and do the activity yourself for them to follow or choose to do it as one big group.
Instruction 1: Introduce the playNote & rest sections (~5 min)
First, share your screen and allow the students to listen to each of the drum patterns. Show them the text cells they will initially be reading through. You could go through this content as a group or as individuals. They will need to select and remix a project from the links you provide them (instructions for that in the projects already).
Instruction 2: Begin the playNote & rest sections (~10 min)
Once they’ve selected a project, encourage them to start reading over the playNote and rest sections of their project to get a sense of what it is and how it works. You could even show them playNote before having them read, ask what they think it does, and then have them read about it. After they’ve had a few minutes, check in and ask people to share out what they think playNote does to confirm that they’ve got the gist.
Prompts to check understanding before moving on:
“Okay, so someone tell me or type in the chat: what does playNote do?”
“What info does playNote use?”
“What does rest do?”
***HALFTIME: ~30 MIN MARK HERE***
Instruction 3: Introduce the variables section (~2 min)
Encourage students to move on and check out the variables section. This section is a bit longer so be sure to give them some time and check in a little more as needed. Tell them that this section is about another useful thing that programmers use when they write code.
Instruction 4: Begin the variables section (~10 min)
Give them time to read through the relevant text cell. After that, ask them to share what they think a variable is and why it might be useful.
Prompts to check understanding before moving on:
“Can someone tell me what a variable is? Feel free to look in your project to find the answer!”
“What does a variable do?”
“Why do we use variables?”
Instruction 5: Introduce Drill Activity (~1 min)
Quickly talk through activity. Students are asked to define variables for two instruments and call playNote for each of those instruments, just including the note parameter. Have them call out for help if they get stuck.
Instruction 6: Drill Activity (~5 min)
Optionally, you could have students quickly share what they came up with if you have time.
Instruction 7: Introduce activity section (~5 min)
If you feel your group has adequately discussed variables, give them an overview of the activity. Explain that they will have to find the variables in the ensuing code and change the numbers that those variables hold. Make sure they know that it’s totally fine if they run into an error ("RED BOX OF DOOM") and that they should call out for help if that happens or if they have any other questions. Also quickly mention that there are comments (text after “#” on any line) to help them.
Instruction 8: Begin activity section (~10 min)
Let the students start working on the activity and check in to make sure things are going well. Once they’ve had some time to work, ask for students to share out if they were able to change the sound made by the cell by changing a variable’s value. If they are not very responsive, go through the process by sharing your screen and changing a variable and thus the sound used for a drum pattern.
Instruction 9: Wrap up & challenge activity (~5 min)
At this point, students should have worked through both parts of the week’s activity and begun to develop an understanding of playNote and variables. Give them a quick recap and then share with them a link to this presentation, which contains a review of the material from the session along with a challenge activity at the end. The activity at the end is to create their own project in TunePad and to use the code from the projects linked in the slides to make their own beat.
Issue: “name ___ is not defined on line ___”
Check: Check that the spelling of the arguments to playNote is correct
Check: Check that any definitions or variables that are used in that line are spelled correctly and defined as needed in the code cell that should be at the top of the file
Issue: “Unable to import ___”
Check: That they renamed their code cell at the top to “beats” and used from beats import * at the beginning of their drum cells
Issue: “Error on line ___”
Check: They have copied the code exactly and they aren’t leaving any spaces/tabs between or before words in a function, misspelling words, writing in lowercase where they should be writing uppercase or vice versa. Check that code is on its own line (e.g. playNote is used once per line), nothing like “playNote(0) playNote(0)” in one line
Issue: Clicking play on the cell but no sound
Check: Make sure the number entered inside “playNote” is a valid number (i.e. it corresponds to one of the TunePad drum sounds)
Solution: Refresh the page and try again.
Issue: Logging into TunePad account problems
Check: Have them share screen and confirm that they are typing in the correct username and password
Workaround: If enough people can’t log in, have a coach share their screen and do the activity as a group on that person’s computer. Use the chat to vote on what genre and which patterns to use
Issue: Beat sounds out of sync (e.g. drums and melody play at different speeds)
Check: If they did not use the +/- to set their project’s BPM and refreshed the page afterwards, the project automatically BPM got reset to 120 (just a TunePad bug) and if their loops are not at 120, things will sound off