Skip to Content

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 a famous Indigenous Canadian artist  - Samian or an 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 Inuttitut.

Follow along with the lyrics (provided in both French and English). Listen for the 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!! We are going to add some sound clips now!

EarSketch is all about coding and composing, so let’s add a few lines of code that will insert sound files into your script. These lines of code will become tracks (layers!) in your DAW.

  • Open your EarSketch First Script
  • Type, or copy, the following code into your script on line 13. 
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. 
  • Select Play button (green arrow) to listen to your music
  • If your code ran successfully, you can view it in the Digital Audio Workstation (DAW) above the code editor. Your audio clips are shown in colourful rectangles along a timeline in the DAW.
  • Click on the minus sign in the bottom right of your DAW to 'compress' the view of the timeline. 
  • You can also use the other buttons at the top right of the DAW to control the play of your songs, such as reset, mute, volume, and loop. 
  • Take a few minutes to explore these buttons.

Notice that each track is a layer of music. Or, it may be that a number of similar tracks might be one layer. For example, you may have several tracks of strings that could be considered one layer.  So you may end up with a 'strings layer', 'horns layer', and a 'percussion layer' and so on. As we continue, we will be developing many layers of music.

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 fitMedia() functions
  1. the fitMedia() function plays a music clip in the DAW.
  2. These are written in camelCase—where words are 'separated' with a capitalized letter. 
  3. The most important to know is that Python, like many coding languages, is case sensitive!!

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.

So How Does the fitMedia() function work?

The fitMedia() function takes in four input parameters:

  • Sound clip name: The sound clip placed in the Digital Audio Workstation
  • trackNumber: Track on which music is placed
  • startMeasure: The measure at which the sound clip will start
  • endMeasure: The measure 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. 

If you have an error, check to ensure that you copied the code correctly. 

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() 

Image of an error in the code. The line of code with an error is highlighted in red, and a description of the error is displayed below in red writing.

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?

  1. 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).
  2. Runtime errors: Your program starts to run but halts due to an error.
  3. 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:

  1. Misspelling: Check the spelling when using a function like fitMedia() or sound constants.
  2. 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().
  3. Parentheses: Forgetting an opening or closing parenthesis where needed will cause a syntax error.
  4. 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.
  5. 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

  1. The setTempo() function is missing a parenthesis
  2. The first fitMedia() is missing an 'e'
  3. The first fitMedia() is missing a comma between the third and fourth parameters
  4. The second fitMedia() is missing an uppercase 'M'
  5. 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.