After completing this activity, students should feel relatively comfortable:
Review and reinforce the knowledge gained over the last couple of weeks (i.e. playNote, beat values, bars, variables, using different instruments in TunePad)
Give students the confidence to create their own playNote statements using the content learned in the past 2 weeks
Acquaint students with debugging code by helping them do so as they try to make their own playNote statements
Warm-Up Discussion + Review playNote - Street Code Jam Session (~10-15 min)
Activity - Street Code Jam Session (~30-35 min)
The coach should first demo the activity for the students (~5 min)
Talk through each step (very clearly and verbosely) with your students while sharing your screen
It’s advised that you check-in with students after every step:
Choose a cell and add your name to the title (~2 min)
Declare one or two variables to represent different instruments (~5 min)
Write a playNote statement corresponding to these instruments (~10 min)
Add beats values to these existing playNote statements (~5 min)
*Optional* Fill 2 bars with playNote statements (~10 min)
Sharing (~5-10 min)
Listen to everyone’s cells in the Jam Session
Have students reflect on their contributions
Each student could talk through their code if you have time and engaged students
Introduce creative challenge: there’s no new link for this challenge, but instructions are at the bottom of this week’s activity
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
NOTE: The review content and activity for this lesson is found in the Street Code Jam Session TunePad project. This project is View-Only. Before your session, you should remix this and:
Make sure that there are enough drum cells for your participants
Each drum cell should have “from beats import * # ignore this line” as the first line
Make your remixed project collaborative and send the new link to your participants (see Jam Session Guide)
Since this activity is more like a workshop, we recommend you use most of the warm-up time to build rapport and then transition into a review of playNote and material from the past couple of weeks. This will jog students’ memory about what we’ve been doing and will help ease the transition into the coding portion.
Instruction 0: Login to TunePad + Send Jam Session Link (~5 min)
Make sure everyone gets logged into their accounts and troubleshoot as needed. If people are having login issues, make a note to inform someone from the dev team after the session. Make sure to share your screen so students who are unable to login can at least follow along with what is happening. Also be sure to send the jam session link to the students.
Instruction 1: Coach Demo (~5 min)
Take a few minutes to share your screen and show the students what they will be doing in the activity. Talk them through each step as you demonstrate it. First, choose an instrument or two and create variables to hold the instrument id. Then choose two different beats values (e.g. a quarter note and an eighth note). Finally, put those two pieces together to create at least two playNote statements. A simple example of this is provided on the following page. If you feel comfortable and feel the students will not get confused, you might walk through making a basic drum pattern like the one shown below the simple example. Whichever demo style you choose, be sure to play the cell for everyone to hear!
N.B. You can also use beats=1.0 (QUARTER_NOTE) and beats=0.5 (EIGHTH_NOTE) in the following examples to remind students of the connection between the variable names and beat values.
Instruction 2: Add Names To Cells (~2 min)
Prompt the students who are logged into TunePad and have the jam session open to choose a cell and add their names to the title of the cell.
Instruction 3: Add Variables (~5 min)
Once everyone who can access TunePad has their name on a cell, prompt them to choose an instrument/sound and create a variable to hold a reference to it. If you feel they need a refresher, you can show them what you mean by this on your screen.
Instruction 4: Choose 2 Different Beats Values (~2 min)
After students have declared variables in their cells, it’s time to choose beats values. Once again, a demo and/or quick reminder of the options and what they mean at a high level might help here (e.g. “remember, a SIXETEENTH_NOTE is very short!”).
Instruction 5: Creating playNote Statements (~10 min)
Now it’s time to put the last two instructions together. Have the students type in one playNote statement using one of their variables and one of their chosen beats values. Take a second to examine each student’s cell and work through any issues. After you feel they are comfortable moving on, have them create their second playNote statement using their second variable and second beat value. Again, be sure to go slowly and walk them through things if there are issues.
Instruction 6: Fill 2 bars with playNote (~10 min)
Once everyone has some trivial playNote statements, take a second to pause and demo the next part of the activity, which will be to encourage students to use various beat values to create playNote statements that fill 2 bars. You might want to review beats and bars here and show them the simple pattern from Instruction 1. After giving the demo and reviewing, encourage students to ask any clarifying questions and then to start coding up their 2 bar patterns. Scroll through the jam session to track their progress.
*Optional Instruction*: Fill 4 bars with playNote (~5 min)
If your group completes Instruction 6 rather quickly and you feel they are ready for a challenge, you can prompt them to now make playNote statements that fill 4 bars (16 beats) instead of 2 bars (8 beats). They can create a brand new pattern or extend their 2 bar pattern to cover 4 bars.
Instruction 7: Share & Reflect (~5-10 min)
If there is time remaining and everyone has been able to make a simple 2 bar pattern using playNote statements, have people share and talk through their code if they are comfortable doing so.
Troubleshooting
Issue: “name ___ is not defined on line ___”
Check: Check that the spelling of the argument 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: “bad input on line __”
Check: if line is last line of cell, playNote is likely missing closing parenthesis
Check: otherwise, arguments to playNote could be missing comma in between
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