4.9 Activity Guide
4.9 Activity Guide
4. Find “Song4.py” and double-click it to open the script in your code editor.
2 Student Activity Guide
Let’s think:
● How do you like the start of your bridge?
● What are some things you’d like to try in your bridge?
Before diving into our code, let’s review what a bridge is and how we plan to add a bridge to our
song!
Our bridge can be anything we like– but we can keep these tips in mind if they help inspire us!
Now that you have a plan for what you want to add to your script, let’s dig into the code:
First, review your starting comments. Make sure you’ve added your starting comments at the top
of your script and updated the text in the brackets to match your song. Remember: Comments
start with # and will not affect our program.
Next, review your Setup section. Make sure you’ve added your Setup section, included your
import statement, and set a tempo using the setTempo() function. Reminder: You will need to
set a unique tempo for your music once you start adding your sounds.
Next, let’s review our Soundbank. Make sure you added comments to set up the structure for your
Soundbank and help you organize your sounds. Note: You can add any additional comments you
want to help you organize your sounds using the # symbol.
After you have found several sounds, your program may start looking like this:
Once you find sounds and add them to your soundbank, remember to assign your sounds to
variable names!
After you’ve completed this, your program may start looking like this:
Review your music section. You already added sounds to your intro, verse (Section A), chorus
(Section B), and outro using the fitMedia() function and variables (instead of whole sound
names).
Today, you already added one sound to your bridge section (Section C)
Let’s review how to use variables to add sounds to your music section!
1. Use the fitMedia() function to add at least 2 sounds to your new section.
● Type: fitMedia(sound, track, start, end)
● This time, instead of adding the full sound name in the sound parameter, type the
variable name you assigned for the sound you want to use.
Now that we’ve reviewed our plan, let’s adjust our bridge and outro track parameters:
2. Before running and playing your code, be sure to review and update your track
parameters:
● For each sound in your bridge (Section C)
○ Set your track parameter to start at “11” (or higher, depending on how
many sounds you’ve already used in your intro, verse and chorus)
● For each sound in your outro:
○ Set your track parameter to start at “13” (or higher, depending on how
many sounds you plan to use in your bridge)
3. Before running and playing your code, be sure to review and update your start and end
measures:
● For each sound in your bridge (Section C):
○ Set your start parameter to measure “21”
○ Set your end parameter to measure “25”
● For each sound in your outro:
○ Set your start parameter to measure “25”
○ Set your end parameter to measure “29”
1. Finally, set a unique tempo for your song using the setTempo() function.
a. Try setting a slower or faster tempo.
b. Run and play your song.
Reminder: EarSketch lets you choose any tempo between 45 to 220 beats per minute.
● Standard: 120 BPM
● Slow: 45 BPM
● Fast: 220 BPM
When you’re finished, your code might look something like this:
# STARTING COMMENTS
# title: [a title]
# author: [your name]
# description: [a descriptive note]
# SETUP
from earsketch import *
setTempo(110)
# MY SOUNDBANK
# This is where I will keep my variable ‘nicknames’ for my sounds
# beats:
beat1 = HIPHOP_STOMP_BEAT_001
beat2 = EIGHT_BIT_VIDEO_SPEAKNSPELL_BEAT_014
beat3 = JWOLF_COTG_VOX_MISC_HEEYAA
# bass:
bass1 = CIARA_SET_THEME_MAIN_2
bass2 = DUBSTEP_SUBBASS_002
# melody
mel1 = JWOLF_COTG_VOX_LEAD_INTRO_1
mel2 = CIARA_SET_THEME_MAIN_1
mel3 = JWOLF_COTG_VOX_MISC_MALE_MELODY
mel4 = Y40_BRASS_1
mel5 = JWOLF_COTG_THEME_SYNTH
# harmony
harm1 = YG_TRAP_SYNTH_3
harm2 = YG_TRAP_SYNTH_CHOIR_2
# effects
sfx1 = JWOLF_COTG_VOX_MISC_CHAOS_2
sfx2 = JWOLF_COTG_THEME_DS_WOBBLE
# MUSIC
# This is a song where I use variables
# song4-intro:
fitMedia(mel3, 1, 1, 5)
fitMedia(beat3, 2, 1, 5)
# song4-section-A:
fitMedia(beat1, 3, 5, 13)
fitMedia(bass1, 4, 5, 13)
fitMedia(bass2, 5, 5, 13)
fitMedia(mel1, 6, 5, 13)
# song4-section-B:
fitMedia(mel2, 7, 13, 21)
fitMedia(beat2, 8, 13, 21)
fitMedia(sfx1, 9, 13, 21)
fitMedia(harm1, 10, 13, 21)
# song4-section-C:
fitMedia(mel4, 11, 21, 25)
fitMedia(sfx2, 12, 21, 25)
# song4-outro:
fitMedia(mel5, 13, 25, 29)
fitMedia(harm2, 14, 25, 29)
# END
Appendix: VOCABULARY
Find this lesson's vocabulary below.
Bridge (n):
A section of a song that helps transition from one part to another by providing contrast and
building toward the next section.
My cse3 journal
Extra space for notes, thoughts, and other things!
Notes