Skip to Content

Action: Indigenous And Musical Knowledge

Activity 2: Learning about Traditional Indigenous Knowledges (10 minutes)

Before we start coding, let us learn a bit about Indigenous Traditional Knowledges and their importance. 

We say knowledges with an s because there are many types of knowledge that we will be talking about. 

Learning about Indigenous Traditional Knowledges is important for racial equity. 

We are going to go through the Indigenous Traditional Knowledge Slides. Write information you learn in your Indigenous Traditional Knowledges Graphic Organizer.

Note: There is more background information in the Resources section.

Indigenous artwork

Optional Extension F for a Sharing Circle.

Traditional Institution and Values (TIV) (Social Sustainability) 

  • Traditional Institution and Values (TIV)  is also referred to as Institutional Indigenous Value. TIV is the presentation of tradition, which is a living expression of history in the present with the ability to form identity, sense of belonging, and shared values. 
  • TIV places importance on relationality. Relationality is the relationships and connections we share with one another through communication and spirituality. The TIV knowledge system varies across Turtle Island, depending on the specific Indigenous group. 
  • In the TIV knowledge system, traditions are also referred to as generational teachings. The collective set of facts, concepts, experiences, and knowledge passed down from generation to generation. Everything is passed down through tradition. The TIV knowledge system has been impacted by years of culture and knowledge loss caused by Residential Schools and the 60s scoop.

Traditional Technical Knowledge (TEK) (Economic Sustainability) 

  • Traditional Technical Knowledge (TEK) refers to the distinct, traditional, local knowledge that exists within and has evolved in response to the specific conditions in which you live. Storytelling, song,  dance, cultural values, beliefs, ceremonies, community laws, language, agricultural practice, traditional equipment, materials, worldviews, plant species, and animal breeds are all examples of TEK. 
  • TEK can be passed down orally, through storytelling, and through land-based learning.

Traditional Ecological Knowledge (TTK) (Ecosystem Sustainability)

  • Traditional Ecological knowledge is the combined body of knowledge, practise, and belief about the relationship of living beings with one another. 
  • The four domains of living things include Humans, Animals, Plants, and Mother Earth. The connection between all living things is called interconnectedness. 
  • Throughout Turtle Island, Indigenous groups have various Traditional Ecological Knowledges dependent on the area of where they live. Indigenous peoples in British Columbia may have different stories about fish and water life compared to Indigenous peoples in Manitoba. As well, Indigenous groups have different beliefs of what may be alive or what may not be. In traditional Anishinaabe culture, parts of Mother Earth such as water and rocks, are seen as so spiritual and important – they have a sense of being animate or being alive. In other words, it is a process for indigenous communities to observe, classify, analyze, interpret and make decisions for daily life along with the development of world views.

Circle of Courage Philosophy

  • The Circle of Courage is a model of positive youth development first described in the book Reclaiming Youth at Risk, co-authored by Larry Brendtro, Martin Brokenleg, and Steve Van Bockern. The model integrates Native American philosophies of child-rearing, the heritage of early pioneers in education and youth work, and contemporary resilience research. The Circle of Courage is based on four universal growth needs of all children: belonging, mastery, independence, and generosity.

Which Indigenous Traditional Knowledge System resonates with you the most and why? 

Extension C provides an Indigenous Role Model Gallery Walk.

Activity 3: Record and Add a Sound to EarSketch (10 minutes + homework)

You may wish to add your own sound (either lyrics you say or sing) or something you've recorded or get from another copyright-free source.

In this activity, you will record and add lyrics. You might add a lyric from Jayli's song (and credit her with a #comment in your script) OR you may record an original lyric that you were inspired to write by her song.

1. Open your Your Voice is Power [Your Initials] script.

2. Select the Add Sound button in the Sound browser.

3. This action will open a pop up window, with the "Upload Sound" tab open.

4. Select the QUICK RECORD tab.

5. Select the REC icon to start recording. It will countdown, then start recording.

6. Select the REC icon again to stop recording.

7. Type a name for your recording where it says Constant Name (required).

Select the UPLOAD button.

8. FILTER your SOUNDS by Artists. You will see your login name there as an artist!

NOTE: Make sure you CLEAR your Instruments first!

9. Select Your Name. You will see your sound clip.

10. You can now add your sound clip to the #SOUNDBANK

- Assign it a variable

- Replace one of the tracks you have in your #intro with your new sound

- Change the variable name in one of the fitMedia() functions

11. Select Run and Play

Activity 4: Learn about Measures (10 minutes)

This activity is drawn from 26.6: Defining Measures in the EarSketch Curriculum

Often we talk about building the song in blocks of 4 and 8. Why? In music, beats are grouped into groups of 4. Each group of 4 beats is called a measure (or note). Each beat is a quarter note in a piece of music. One measure has 4 quarter notes or 4 beats.

Change the Tempo! 

  1. Look at your Digital Audio Workstation. You will see that the top row measures time in seconds and the bottom row shows the measure markers. 
    How many seconds are in each measure on your DAW? The answer will depend on your tempo. If you set your tempo to 120 bpm, you should see 2 seconds for each measure.
  2. Try changing your tempo using the setTempo() function and see how the number of seconds changes for each measure. 
    A measure (in EarSketch) will always have 4 beats, but the time it takes to play those four beats will change depending on tempo.
  3. OK! Change it back to setTempo(120)!

In EarSketch, every measure contains 4 steady beats. After you run a script in EarSketch, you can switch the metronome on or off to listen to the steady pulse of your song as it plays!

To learn more about Measures see Extension D!

Activity 5: Introduction to Custom Functions (20 minutes) 

In an earlier module, we looked at SONG STRUCTURE with patterns such as ABAB. It’s time to transform your code into a song. How do you do this without writing lines and lines of code? Imagine you want to code a 2-minute song — you might end up with 150 lines of code! Woah, that is exhausting to think about!

We will use custom functions to define our song sections. This is a series of steps that are summarized in one command or function. Chorus or Verse will have a series of sound clips that it plays for an assigned time.

Watch this video on Song Structure to get a visual overview of the process.

Look at these two examples of code or in this EarSketch Tutorial in the Curriculum: 27.6: Writing Custom Functions Both sets of code are correct, they have an ABAB form and will play the same song.

Example 1 (Without Custom Functions) 


#Create a 4 measure verse section between measures 1 and 5 ←A

fitMedia(drum,1, 1, 5)

fitMedia(bass, 2, 1,5)

#Create a 4 measure chorus section between measures 5 and 9 ←B



#Back to a 4 measure verse section between measures 9 and 13←A

fitMedia(drum,1, 9, 13)

fitMedia(bass, 2, 9,13)

#Back to a 4 measure chorus section between measures 13 and 17←B




Example 2 (With Custom Functions)


def verse (start,end):

fitMedia(drum, 1, start, end)

fitMedia(bass, 2, start, end)


def chorus (start,end):

fitMedia(vox, 4, start, end)

fitMedia(clap1, 5, start, end)

#Function Calls (setting up an ABAB musical form through function calls)

verse(1,5) A

chorus(5,9) B

verse(9,13) A

chorus(13,17) ←B


Which code is easier to read and follow? 

Which code will be easier to edit if you want to make a change?

If you picked Example #2, you are correct! Code Example #1 (without custom functions) is much longer and more complex. (In fairness, the advantages are more obvious if the music is more complex! See a more complex example in 27.5: Introduction to Custom Functions)

Part of learning to be a programmer is learning how to write efficient and logical code.

What is a Custom Function?

Custom Function definition: Written by the programmer to accomplish a specific task, often a task that must be done more than once. Functions take many smaller, repetitive tasks and assign them to a custom name.

Let's Run and Play that Code! 

  1. Open the 27.6: Writing Custom Functions EarSketch Tutorial 
  2. Scroll down until you see the sample code.
  3. Select the blue clipboard and then select the IMPORT TO EDIT button that appears on your CODE EDITOR.
  4. You will see a new script appear, and the code that two song sections are defined: verse and chorus.

    Alternately, create a new script for this activity! 
  5. Select the + sign at the top of your CODE EDITOR!
  6. Name it something like 'Custom Function Practice'. Copy and paste the following sample code into your code editor. 

    NOTE: It is best to do this from the EarSketch Tutorial because copying and pasting may not indent the fitMedia() functions properly!
  7. Select  RUN and PLAY
  8. You will hear that the verse section is playing from measure 1 to 5 and again from measure 9 to 13. 
  9. You should also hear that the chorus is played from measure 5 to 9 and measure 13 to 17. 
  10. If you look at the section in your code, #Function Calls, you will see that verse and chorus were called to play on these measures.

Note: In this example code, the chorus is the same each time it plays. We expect this. But, in a real song, the verse will likely not be the same. We might have verse1 and verse2

#python code
# script_name: Functions in YVIP
#author: EarSketch Team

from earsketch import *


def verse (start,end):
  fitMedia(drum,1, start, end)
  fitMedia(bass, 2, start,end)

def chorus (start,end):

#Function Calls


What's with the START and END Variables?

Functions in EarSketch need inputs or parameters (arguments). We use start and end to 'hold the place' for the measure to be used when we 'call' our function. That makes it so easy to change the timings as your creativity unfolds!

This custom function defines verse. It tells the computer to play a drum and a bass sound clip for a certain number of measures.

You already used functions in EarSketch, such as fitMedia()—but now you will actually create your own functions. THAT is real programming! 

Custom functions are written by the programmer to accomplish a specific repeatable task with a single 'command' that executes multiple lines of code. 

Functions are named by the programmer, can have numerous inputs (parameters/arguments), and can be called anywhere in a script—assuming you have defined that function before you try to call it!

Functions not only make your code shorter, but it also allows you to create complex code that can be easily repeated without error.

Functions are an example of an abstraction because they bundle many small commands or actions to create a single task. An example of abstraction is combining smaller ideas or tasks to create a single, less complex concept.

Seymour Papert, the creator of the first programming language for students called these abstractions — mind-sized bites

Think about the simple concept of "brushing your teeth". Brushing your teeth is actually a series of actions such as putting toothpaste on the brush, wetting the toothbrush etc. However, when you tell someone to brush their teeth, you don’t include all those steps. The steps are understood as part of the "Brush your Teeth" command. This is an example of an abstraction — a mind-sized bite!

 Inside the definition of verse() are instructions, or the body of the function. These instructions are indented. In this example, we have selected sound clips and tracks and used fitMedia(), but will use our inputs start and end to note the timing of the sound clips. fitMedia() was used in the function body. (However, you can also include makeBeat(), loops, setEffect() and other functions/variables in the API. You can research that later!)

The function definition does not automatically execute the instructions in the function body. In order to use the function, we will “call” it. 

Calling a function tells the computer when to run it. Writing your custom function only tells the computer what clips to play on specific tracks, but not when to play to them. Calling your function tells the computer when to play the audio clips and for how long. You can also call that function anytime without rewriting all the code embedded in it.

For more on Coding Custom Functions with Staggered START and END measures, see Extension E.

It's okay if you are a little confused! Custom functions are the most complicated coding concept you've seen! You might want to start by just creating hard-coded functions for just your verse or just your chorus, and then if you get that working, challenge yourself to add the start and end, but know that the hard-coded option is acceptable for the competition. 

Activity 6: Coding Custom Functions in EarSketch (30 minutes + homework)

Now YOU are going to code your own custom functions like verse and chorus! For the competition submission, you will need to have at least one custom function in your code to define a section in your song.

This activity is similar to 27.7 Coding Custom Functions in EarSketch in the EarSketch curriculum.

Song Structure?

Ok. First of all, let's think about song structure!

Let's pretend it's the same as the example. Except, you may have an #intro from before. So we'll put that in! You will come back to that later.

Of course, you may 'kick it up a notch' later with bridges, transitions, outro, and so on. But, we'll start simply. 

So, this basically means that we can define functions for each of those song parts. Then all we need to type in our CODE EDITOR (along with start and end numbers—if not 'hard-coded) is:

#Function Calls






Mind-sized bites those are!! :-) It's certainly easier to read than ALL the lines of code for each part! And, if we want to change something inside any one of those song parts, we can do that, but it won't change the function calls! That can remain the same.

Coding Custom Functions for your CHORUS

  1. Open Your Voice is Power [Your Initials] script (or select the open tab for that script).
  2. Decide on your message for the chorus of your song
    - It is important to have a clear and powerful message in the chorus. You may think about this more deeply later and just see this activity as a learning exercise.
  3. Gather together all your sound clips including your lyrics. For now, you might just quickly add existing clips for practice.
    - Add them to your #SOUNDBANK
    - Assign variables (nicknames) to them.
  4. Type #chorus in your code editor.
  5. Press Enter to make an empty line.
  6. Type def chorus(start,end): to define the function chorus with the inputs start and end. Be sure to include the colon :
  7. Press Enter. Your next line should indent. If not, press the tab key.
  8. Add your soundclips using fitMedia() functions on the lines below def chorus(start,end):
  9. Add in your fitMedia() measure parameters. 
    - Use start, end for the last two parameters. Example: fitMedia(drum,1, start, end)
    - Pay attention to your track numbers!
  10. Repeat this process with all of your tracks in your chorus. 
    - Make sure to indent all of your fitMedia() tracks.

    Note: (If there are fitMedia()functions that you don't want in the chorus either delete them or put a hashtag # in front of them so they won't play.)
  11. Press Enter to create a new line and delete the indent.
  12. Call your function as follows:
    - Type #Function Calls
    - Type chorus(5,9) and press enter, 
    - Type chorus(9,13) 

    We recommend calling each function and separating the start and end numbers with multiples of 4. This is assuming that you still have your #intro in measures 1 - 5! If not, adjust accordingly!
  13. Run your script. 
    - Did your "chorus" play twice? 
    - Does it sound the way you intended to code it? 
    - Does your code look similar to the example below?


def chorus(start,end):





#Function Calls



Now Define the Verse 

Repeat the instructions above (Coding Custom Functions for a CHORUS) to write a new custom function for VERSE

  1. Gather together all your soundclips. 
  2. Add them to your #SOUNDBANK
  3. Assign variables (nicknames) to them.
  4. Type #verse in your code editor
  5. Press Enter to make an empty line.
  6. Type def verse(start,end): to define the function verse with the inputs start and end. Be sure to include the colon :
  7. Press Enter. Your next line should indent. If not, press the tab key.
  8. Add your soundclips using fitMedia() functions on the lines below def verse(start,end):
  9. Add in your fitMedia() measure parameters. 
    - Use start, end for the last two parameters. Example: fitMedia(sfx,11, start, end)
    - Pay attention to your track numbers!
  10. Repeat this process with all of your tracks in your verse. 
    - Make sure to indent all of your fitMedia() tracks.

    Note: (If there are fitMedia()functions that you don't want in the verse either delete them or put a hashtag # in front of them so they won't play.)
  11. Press enter to create a new line and delete the indent.
  12. Important: Edit the chorus function call start and end times!
    - Change from chorus(5,9) to chorus(9,13)
    - Change from chorus(9,13) to chorus(17,21)
  13. Call your verse function. 
    - Type verse(5,9) and press enter, 
    - Type verse(13,17)
  14. You should have something like the following structure:
  15. Run your script. 
  16. Select Play!

This would result in Function Calls like the following:






Important Note: if you had the fitMedia() functions staggered, you will have to modify the parameters! See Module 7!

Continue to add custom functions to lengthen your songs and add more variety. You can add a intro, outro, more verses, or a bridge to your song. Think about adding some transitions to your song between the verse and chorus. Transitions can be a one-measure sound clip using a fitMedia() function. It does not need to be included in a custom function. Check out the EarSketch Chapter on transitions. 6.3 Transition Strategies

Once you have defined your custom function, you should start to see the structure of a song emerge. When you listen to your code, you should recognize the sections of your song. Think about how the structure of your song also reflects the message or purpose of your song. See below for an example of how you can call your custom functions to organize your song structure.










Outro (32,36)

Congratulations, you have transformed your beats into a song. Your remix is almost complete.