EarSketch helps you:
Learn coding through music
Use our sounds or your own
Learn Python or JavaScript code
Produce studio-quality music
This tutorial is a very brief introduction to using EarSketch to make music.
If you like it, and you want to engage your students in a larger project check out Your Voice is Power. Your Voice is Power is a national competition for middle and high school students designed to teach the fundamentals of computer science, entrepreneurship, and social justice. Using the EarSketch platform, students get creative to remix songs from Indigenous artists and use what they have learned from the provided course outline.
Go to the EarSketch website. (Use Chrome or Firefox.)
On the Homepage, select START CODING.
Select Skip, where it offers the Quick Tour. We'll do that later!
In the top right corner, select Create/Reset Account.
Select Register a New Account from the drop-down menu.
Choose a username and password.
You have the option to enter an email address. Email addresses are used to retrieve passwords. If you have a school email address, use it.
Select CREATE ACCOUNT.
Write down your username and password.
Note: If you need help, you can watch this short video (0:00 - 0:36) https://earsketch.gatech.edu/yvip/Video01-Account-Creation-Opening-Script.mp4
Quick Tour of the EarSketch DAW
Instructor Dialogue
"A laptop is a pretty powerful tool to produce music.
Let's look at the EarSketch DAW (Digital Audio Workstation) and see how you can apply your creativity to be the next great music producer.
STUDENT STEPS:
Select the Information icon in the top right of your screen (right next to the bell).
Select Start Quick Tour.
Instructor Cue
Students will click through a series of 8 pop-up windows to view the different areas of the EarSketch Workspace.
Give students 3–4 minutes to go through the Quick Tour.
Ask students if they have any questions about the EarSketch workspace.
If students want to know more about the workspace, you can direct them to the Curriculum tab on the right side of the EarSketch Workspace which has a longer video tour and additional descriptions, by selecting the down arrow and then “Unit 1”.
NOTE: Ensure that students are aware of these learning tools:
Select the API open book to view the EarSketch API.
In addition to the API folder, if you need any help coding in EarSketch, you can select the Curriculum tab on the right of the code editor.
The Curriculum tab will open the curriculum where you search by topic to watch videos and tutorials on EarSketch content.
Instructor Dialogue
While we are here with the script in the Quick Tour, let's do some playing with an important function called setTempo()
We will experiment with it first; then we'll briefly explain what functions are and how we will use them throughout Your Voice Is Power! In the next module, we'll dive more deeply into functions. Then, in a later module, you will write your own function! That's real coding!
What is tempo?
Tempo is the speed of a given piece of music or the number of beats per minute.
What is a beat?
A beat is the basic unit of musical time. Beats give your song rhythm and let you move and dance to the feel of the music! The faster the beat, the higher the tempo! Slower beats have a slower tempo. Beats and tempo determine the mood of a song!
STUDENT STEPS:
Watch the video: Set Your Own Tempo (0 - 1:20) on slide 17 as presented by your teacher.
Different music genres often have different tempo ranges.
2. In your Quick Tour script (quick_tour.py) you will see the function setTempo().
setTempo() is an example of a function with a parameter. You will see the number 120 in parentheses after the setTempo() function. This tells the computer the number of beats per minute.
Every EarSketch script opens with a baseline tempo of 120 beats per minute—a fast walk or marching speed, but you can set a tempo anywhere between 45-220 BPM.
Explore different tempos:
Starting tempo: Run and listen to the song at 120 BPM.
Lower your tempo: Click or tap inside the setTempo() parentheses and set your tempo in EarSketch to 45 BPM. Run then play.
How did slowing down the song change the mood?
Raise the tempo: Set the tempo to 220 BPM. Run then play.
How did speeding up the song change the mood?
Try a tempo number smaller than 45 or bigger than 220.
What happened?
Every EarSketch script must include a setTempo() function with a number in the parentheses. This tells the computer how fast to play the music.
"You may have heard the word script in your English Language Arts or Theatre class.
A script is a written text with instructions on what to say in a play/TV show/movie.
A script in coding is similar. It is a series of instructions carried out in a specific order by a computer.
Your script in EarSketch is your list of instructions for the computer to play your music, just like a script gives actors/actresses instructions on what to say when they perform."
STUDENT STEPS:
Let’s learn how to create a script in EarSketch!
TWO WAYS:
If, in the middle of the screen, there is blue text saying, Click here to create a new script, then select it to create a new script."
OR
If, you have a script open already, like the quick_tour.py, then select the + sign beside the quick_tour.py in the CODE EDITOR.
Name the script EarSketch First Script.
Select your desired coding language. (Python or Javascript).
Leave the default at Python.
Select the Create button.
The CODE EDITOR is in the center of your workspace window.
Note: The sample code and curriculum are in Python.
Instructor Dialogue
Let's go over some important sections in your script. (See 24.7 Creating a Basic Script in EarSketch curriculum.)
Comments Section: Notes about your code.
You can use comments anywhere in your code, and this block at the top is usually used to describe the whole project.
Setup Section: This code tells the DAW how to prepare to make music.
setTempo() allows you to choose a tempo for the project, which can be anywhere from 45 to 220 beats per minute.
from earsketch import * adds the EarSketch API to the project. Every project with music in it must have these parts in the setup section.
Music Section: The most important section. All details of your code and composition go here.
You will also add comments throughout to tell your story.
We will be diving into each of these sections throughout the Your Voice is Power remix competition.
This is just an opportunity to familiarize yourself with the parts of your script.
Instructor Dialogue
"EarSketch automatically saves all scripts in the scripts browser.
The scripts browser is in the left menu of the CONTENT MANAGER: </> SCRIPTS
Select the icon right now, and you will see the name of today’s script at the top of the list in the scripts browser.”
Instructor Dialogue
"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."
STUDENT STEPS:
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(DKBEAR_FREE_BEAT_FULL, 1, 1, 9)
fitMedia(JWOLF_COTG_VOX_LEAD_INTRO_1, 2, 1, 9)
fitMedia(SAMIAN_PEUP_THEME_STRINGS_2, 3, 1, 9)
Select Run in the upper right corner of the code editor.
Select the 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.
#music section
fitMedia(DKBEAR_FREE_BEAT_FULL, 1, 1, 9)
fitMedia(JWOLF_COTG_VOX_LEAD_INTRO_1, 2, 1, 9)
fitMedia(SAMIAN_PEUP_THEME_STRINGS_2, 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
The fitMedia() function plays a music clip in the DAW.
These are written in camelCase—where words are 'separated' with a capitalized letter.
The most important to know is that Python, like many coding languages, is case sensitive!!
Now you can browse the Content Manager to add other sound clips.
Click the Sounds Tab.
Filter by Artist and Instrument.
Preview sounds by clicking the Play icon.
On a new line in your Code Editor, type fitMedia and you will see the autocomplete for the fitMedia function.
Highlight the word sound, and click the Paste to Editor icon to paste the sound in the function.
Type a Track number and the Starting Measure and Ending Measure.
Click Run.
Click Play.