Action: Activism, Equity, & First Sound Clips
Activity 2: Analyze Song “PEUPLE INVINCIBLE” by Samian or "Outcast" by Twin Flames (10 minutes)
Next, you are going to hear either a song from the Indigenous Canadian artist - Samian or the Indigenous Canadian band - Twin Flames. Samian is an Indigenous rapper who performs in both French and Anishinaabemowin. Twin Flames is a folk-rock husband and wife duo who write songs delivered through a mix of English, French and Inuktitut.
In your Student Written Activity Workbook, Follow along with the lyrics (provided in both French and English) and highlight examples of racism and injustice discussed in the song.
Play Samian’s song "Peuple Invincible"
Play Twin Flames song “Outcast”
Activity 3: Defining Activism and Equity (20 minutes)
We are now going to take a deeper dive into Samian's song to ensure that, as a class, we have a common understanding of two really important themes that are deeply embedded within this song’s lyrics.
Those two themes are activism and equity.
To start off, let’s first define activism and equity.
Activism: Launching vigorous campaigns to bring about political or social change.
Equity: All groups of people must experience the same quality of life. Taking any necessary actions to ensure that all groups of people get fair treatment and the right resources that enable them to thrive.
What is an Activist?
Activity 4: Music - Add Sound Clips to Your Script (15 minutes)
OK, HERE WE GO! Let's add some sound clips to our script!
Related Video tutorials:
- Open the EarSketch First Script you created in Module 2.
- Delete all the lines of code after setTempo(120) so you can start creating your own song.
- Add the following code into your script after your setTempo(120). You can copy and paste from this notebook
These three lines of code insert sound clips into your script on different tracks or layers.
#music section
fitMedia(RD_UK_HOUSE_MAINBEAT_8, 1, 1, 9)
fitMedia(RD_POP_SYNTHBASS_6, 2, 1, 9)
fitMedia(YG_FUNK_CONGAS_3, 3, 1, 9)
- Select Run In the upper right corner of the code editor to run your code and populate the DAW with your sound clips.
- Select Play (green arrow) to listen to your music
- If your code ran successfully, you will see the music clips displayed in the Digital Audio Workstation (DAW) above the code editor. Your audio clips are shown in colourful rectangles along a timeline in the DAW.
- If you have any errors in your code, the DAW will not update but you will see messages at the bottom of the screen. We will talk more about debugging errors later, for now, get help from classmates and your teacher to try and identify and fix the error.
- Try using the plus and minus signs in the bottom right of your DAW to 'compress' or expand the view of the timeline.
- Try using the other buttons at the top right of the DAW to control the play of your songs. Can you figure out what each button does?
A track is part of a song recorded separately as a musical clip and added to a piece of music. In a DAW, tracks are arranged in rows and labeled with numbers.
Explaining the code
#music section
fitMedia(RD_UK_HOUSE_MAINBEAT_8, 1, 1, 9)
fitMedia(RD_POP_SYNTHBASS_6, 2, 1, 9)
fitMedia(YG_FUNK_CONGAS_3, 3, 1, 9)
This block of code consists of:
- a #music section comment to help indicate and organize where the soundtracks will be placed
- three calls to the fitMedia() function
- the fitMedia() function plays a music clip in the DAW.
- The function names are written in camelCase—where words are 'separated' with a capitalized letter.
- Python, like many coding languages, is case sensitive!! Any time your code doesn't run, check to see if you have letters correctly in upper or lowercase.
We've met functions before! The first function we met was setTempo(). It took ONE parameter—BPM (beats per minute). Functions tell the computer what to do based on the information given, like setting the tempo or fitting media clips into a project. We will use both pre-written functions and functions that you will write yourself (in later modules) to make music.
How Does the fitMedia() function work?
The fitMedia() function takes in four input parameters:
- sound: The sound clip placed in the Digital Audio Workstation
- track: Track on which music is placed
- start: The measure number at which the sound clip will start
- end: The measure number at which the sound clip will end
We will examine this fitMedia() function in greater detail in the next module—Module 4.
Any Errors?
You have an error if you have red highlighting over a line of code and red text in the console below the CODE EDITOR.
Note: The error message in the console identifies the line of code with the error. An example of an error in the console looks like the image to the left. In this example, I had a capitalization error in fitMedia()
Note: However, you can be fooled! Where is the error in line 16? Aha! It's actually in line 15! I forgot the bracket in line 15, so line 16 returns an error!
Go Ahead!
Flashback: Try changing setTempo() again! We know you wanna! :-)
Activity 5: Debugging! (10 minutes)
Earlier, we briefly mentioned bugs (errors) and debugging. But, it is such an essential part of coding that we want to give it more attention. Mistakes will be made. Simple. It is natural, common, and frequent! When we are learning new things, bugs happen! Lots of different kinds of bugs and many of them are common to all coders. Expect, embrace, seek, and squash your bugs! :-)
Sometimes programmers make mistakes that cause code to work incorrectly or not run. In programming, coding faults are called errors, or bugs. The process of finding and fixing bugs is called debugging. You can use debugging strategies using the console.
What are the different types of errors?
- Syntax errors: Your program does not run because your code breaks the language’s syntax rules (ex: you forgot to close parenthesis, or you wrote fitMedia incorrectly).
- Runtime errors: Your program starts to run but halts due to an error.
- Logic errors: Your program runs, but it doesn’t do what is expected. You can fix these by looking at the DAW to check if the clips you meant to add were actually added in the right place.
Here are some common errors:
- Misspelling: Check the spelling when using a function like fitMedia() or sound constants.
- Case sensitivity: Most words used in programming are case-sensitive (the computer recognizes the difference between capitalized and uncapitalized letters). Pay attention to lowercase and uppercase letters. For example, fitMedia() is correct—not FitMedia() or fitmedia(). Most items in a script follow the rule called camelCase: the first word is lower case, and the first letter of subsequent words are capitalized, as in makeBeat() or setEffect().
- Parentheses: Forgetting an opening or closing parenthesis where needed will cause a syntax error.
- Script setup: EarSketch adds setup functions to a new script automatically, but you might accidentally delete from earsketch import *, init(), setTempo(), or finish(). Make sure these functions appear in every script.
- Punctuation: Missing commas or other punctuation errors will cause an error!
Time to practice! Find the 5 errors in the following code:
# python code
# script_name: Find the 5 Errors
# author: The EarSketch Team
# description: Find and fix the errors in this script
from earsketch import *
setTempo88)
fitMdia(HIPHOP_DUSTYGROOVEPART_001, 1, 1 9)
fitmedia(2, HIPHOP_DUSTYGROOVEPART_003, 1, 9)
Here is the answer
- The setTempo() function is missing a parenthesis
- The first fitMedia() is missing an 'e'
- The first fitMedia() is missing a comma between the third and fourth parameters
- The second fitMedia() is missing an uppercase 'M'
- In the second fitMedia(), the order of parameters is not correct: it should be sound clip name then track number
Take a look at Every Error Explained in Detail for a description of different error types and what you can do to prevent them.