Welcome Superstar

Educator notes

Educator Intro

Length of the chapter: 30 - 90min

Adjust the length of the chapter according to the time you have at hand. There are more detailed lesson plans below

Learning Objectives

The student…

  • … is familiar with the interface of Sonic pi
  • … can write a simple program with musical output
  • … has a basic understanding of notes, rhythm and tempo
  • … understands that computers cannot complete a sequence of instructions if they contain an error
  • … can iterate code a number of times
  • … knows how to save a program with Sonic Pi
  • … knows how to record the output of a program with Sonic Pi

Slides and Lesson Plans

You can use the slides below to introduce the first chapter to the students. There are speaker notes in the slides that explain them. To see the speaker notes, click Options > Open Speaker Notes in the bottom panel of the slides. There are similar slides in the Educator Intro of every chapter.

See also the lesson plans below the slides!


Plan 1 - Structured Lesson

Time to completeActivity
15 minStart this module with the slides above.
5 min

Add your students to your virtual classroom. See that everyone has an access to the material.

If you have students' email addresses, you can enroll them before the first lesson.

15 - 20 minStudents start the first chapter alone or in pairs and go through the topic Welcome Superstar. They can skip the first video as you already showed it in the slides. Ask students to raise their hand if they have any challenges!
5 minA little discussion in the class: any challenges so far?
15 - 20 minStudents continue with the material and go through the topic Play a Melody.Ask students to raise their hand if they have challenges!
10 minReflection discussion: What haveyou learned until now?
Introduction to exercise 1
- Show an example result
- Give a time-limit: 10 minutes!
20 minStudents develop their melody and submit the code to the box. The faster students can also do Exercise 2. You can end the lesson (or start the next lesson) by going through a couple of melodies the students have made, if they are willing to show them!

Plan 2 - Freely flowing lesson

Time to completeActivity
5 min

Add the students to your virtual classroom. See that everyone has an access to the material.

If you have students' email addresses, you can enroll them before the first lesson.

10 - 15 minShow the learning material with a projector. Set a goal for the first lesson: Complete the first chapter! Show Exercise 1 of the chapter to the students with the projector.

Ask the students to start from the topic Welcome Superstar! and then continue forward to the first chapter. Ask students to raise their hand if they have a any questions.
60 minWalk around in the classroom and help students with their challenges.
10 min

Summary and the end of the lesson.
- What did you learn?
- How did you like it?
- What felt most difficult?
- Does someone want to show their work?


Introduction


Fire up the software!

If you don’t have Sonic Pi installed:

  • Go to sonic-pi.net and download Sonic Pi for Windows, Mac OSX or Linux
  • Install!

Open Sonic Pi:

  • Windows 10: open the Start menu (bottom left corner) and select Sonic Pi from the list.
  • Mac OSX: open Finder, go to Applications and open Sonic Pi from there.
  • Linux or Raspberry Pi: go to the launch menu and select Sonic Pi. 

The Interface of Sonic Pi


Do this
Play a few examples by copy and pasting them from the Help panel to the Programming panel and pressing “Run”. Pick for example, [Sorcered] Driving Pulse and [Wizard] Blimp Zones.

Educator notes

When the students have had time to play around with the examples, you can direct their attention to certain elements of the code with some questions. This is a useful way to hint that the experiment phase is about to end and it’s soon time to move on to the next topic.

Example questions for students:

  • Can you find some samples ie. pre-recorded sounds in the code?
  • Are there any drum samples in the example code you looked at, and how are they named?
  • Can you identify any parts of the code that seem to repeat over and over again?
  • Which command creates a pause?
  • Which command plays a note?
  • Which part of the code looks like a description of the example?

Play a Note


Do this

Type

play 60

in the editor and press “Run” from the upper left corner.


Can you hear a beep?
What is the difference between play 60 and play 70

Educator notes

The video suggests that students should not use values much higher than 120 with the play command. So what happens if (and when!) they use higher values?

Sonic Pi will try to play these notes, but pretty soon after 127 they will be too high for us to hear. So it’s not an error: but it might be confusing since the students won’t hear anything if they write, for example, play 1000 into Sonic Pi.

What if students are having technical issues with Sonic Pi?

It’s a good idea to encourage the students to look for solutions on their own as soon as possible. They can check out the troubleshooting section, talk to other students in the classroom or look for answers on the internet. Developing debugging skills is an essential part of learning to code!


Oh Noes, a Mistake!

Transcript

You made your first beep, congratulations! I would like to point out one thing about the play command and the number following it. Play is the actual command and the number following it is called an argument in programming. The argument specifies the note to be played. Fun fact: in computer science the structure of a programming language is called syntax. It describes how the language is constructed. You've already tried play command with different values. What if we write for example play 61 or play 59 how does that change the sound? Both of them actually play a different note. 59 is lower in pitch than 60 and 61 is higher in pitch than 60. What we just did is actually the same as playing the neighboring keys of middle C with piano. Fun fact number two: in music terms the difference of two neighboring notes is called a semitone. Now let's try to write pley 60. Oh! What just happened?? Sonic Pi didn't understand the command pley and this is an example of an error in your code. No, no don't put on that scared face. This is nothing to be afraid of. It is actually a similar situation to the computer as it would be for you if somebody asked you to do something in a foreign language you don't understand. In later activities if you see this kind of pink error panel showing up below the editor, you will know that you have probably made a mistake that you need to fix in order to run your code. It could be for example that you have made a typo, forgot to add a space somewhere or enter a number for some command. The error panel tells you on which line the error happened, so it is easier for you to spot. Once you start writing longer programs this feature becomes really useful. Everyone makes mistakes every now and then and in coding it's very natural. Even professionals make mistakes and then they fix them. Sonic Pi is all about exploring, there are no mistakes, there only discoveries. Now next let's make some cool melodies but before that, try making an error with Sonic Pi and see what happens. See you soon!

Do this

Copy this piece of code to Sonic Pi and try to run it. Then answer the questions below!

play 50
sleep 0.5
play 60
slep 0.5
play 70
sleep 1

Look carefully at the pink error message. Which two things does Sonic Pi report in the beginning of the error message to help you locate the error?
What happens to the sound when there is an error?

Educator notes

Nice to know:

The numbers you used are MIDI note numbers. They are a useful and quick way to play notes without having knowledge of music theory. You can easily adjust the pitch by lowering their value (making your note lower) or increasing it (making your note higher). You can even perform arithmetic with the numbers! Sonic Pi is familiar with both MIDI note numbers (values between 0 and 127) and traditional musical notation (such as :C4, :E3 or :G5). You’ll learn more about using this notation later.