Sonic Pi Composition Lesson Plan #1: Getting comfortable

If you don’t make mistakes, you aren’t really trying.” –Coleman Hawkins 

Lesson Overview:

The aim of this lesson is to ‘get comfortable’ with music making using the Sonic Pi platform. By the end, students should be able to experiment with at least three different sounds in Sonic Pi and create simple loops. An introduction to programming and music composition will be discussed in the introduction [video introduction to Sonic Pi click here]. When it comes time to introduce Sonic Pi, it is important for the teacher to emphasise careful debugging by demonstrating common programming typos like missing spaces, capital letters, spelling mistakes [beginners debugging with Sonic Pi video tutorial here]. In activity 2, linking the programming concept of looping and the fundamental composition technique/feature of repetition should be discussed through music listening exercises.

Download a PDF version of this lesson

Contents:

Introduction: What is music composition? What is programming?

15 minutes

Activity 1: Explore Sonic Pi basic commands: play, sleep, run

15 minutes

Activity 2: Adjusting an algorithm to generate music

30 minutes

Activity 3: Group composition brief

20 minutes

Wrap-up Activity: Quiz and reflection

10 minutes

Learning Outcomes:

Key concepts

Sonic Pi syntax to be taught this lesson

Interdisciplinary Curriculum Links

Learning Outcomes

Computational Thinking

Programming

Music

(strands)

Music:

-pitch (high and low)

-timbre

-synthesiser

-repetition

Programming:

-sequence

-loop

-input/output

-debugging

Activity #1

play, sleep

Activity #2

use_synth

_times.do

loop do

live_loop :foo do →  end

Debugging, abstraction, experimenting

Iteration, loops, simple functions, sequence, input/output

PK, UC

Music:

-All students will explore and experiment with at least three different synthesised sounds using Sonic Pi

-All students will use repetition in a composition

Programming:

-All students will make a sequence of at-least four steps

-All students will make and debug a loop to abstract repetition in their composition

Introduction: What is music composition? What is programming? (15 minutes)

Activity Overview: Students will identify a few of the key characteristics of music composition and look at examples of what humans do to create music.

Student Activity: Group discussion in groups of three (5 minutes):

Get students to respond to the following prompts in a group discussion:

Prompt 1: What do we think is involved in music making (aka composition)?

Prompt 2: What do we think programming is (aka coding)?

  1. Ask students to share their answers after two minutes
  2. Write their responses on the board
  3. Use tick marks to count duplicate/similar responses
  4. Play video resources listed below

Suggested Teacher Instruction Sequence:

  1. Introduce music composition in film music (using resources below if necessary)
  2. Introduce programming in Sonic Pi (using resources below if necessary)
  3. Introduce debugging in Sonic Pi with typical typos (e.g. capital letters, spaces where they should and should not be) (using resources below if necessary)

Suggested resources to help the teacher for this activity:

1. [Video 2 minutes] Hans Zimmer on film composition https://www.youtube.com/watch?v=yCX1Ze3OcKo

  • Hans Zimmer Teaches Film Scoring | Official Trailer for Masterclass series



2. [Video 5 minutes] What is music composition with Sonic Pi? https://youtu.be/UsoigOuBgjk

  • A small video introducing music making with Sonic Pi

3. [Video 8 minutes] Basic debugging video https://youtu.be/j-gIAu-uOoc

  • Small description on typical bugs beginner programmers encounter (e.g. capital letters, spaces where they should and should not be)

Activity 1: Explore Sonic Pi basic commands: play and sleep (15 minutes)

Activity Overview: In this activity, students will explore the play and sleep commands in Sonic Pi in pairs.

New Sonic Pi syntax to introduce in this activity (click for example code):

play, sleep

Suggested Teacher Instruction Sequence:

  1. Demonstrate the play function with high notes, low notes and decimal numbers. Prompt students to think why we can’t hear very high numbers and very low numbers, link: What animals have a better hearing range than humans? [dogs, dolphins etc.]
  2. Demonstrate that Sonic Pi can also play the western note tempered system :C4
  3. Purposely write a simple bug (e.g. “pley 59”) and pretend to be confused. Read the resulting error message and try to get students to locate where the problem is. Then ask students why there is an error. Try this role playing with incorrect capital letters, invalid characters and incorrect spacing
  4. Introduce debugging in Sonic Pi with typical typos (e.g. capital letters, spaces where they should and shouldn’t be)
  5. Introduce simple strategies for finding a bug: commenting out code, reading the console for which line the error is on, looking carefully through each character → watching for spelling mistakes, missing/extra spaces, missing/extra characters [beginners debugging with Sonic Pi video tutorial here]
  6. Explain the process for everyone to follow for when they get stuck. Read through and discuss examples of applying strategies in this page: https://chrispetrie.github.io/teacherwhenstuck.html
  7. Finally, discuss for 1 minute the quote of the day for this lesson and what it means: “If you don’t make mistakes, you aren’t really trying.” –Coleman Hawkins ”.

Student Activity (10 minutes):

  1. Get students to pair off  record names in groups as these will likely be the groups students will be in for their group project. One group might have three students if there is an odd total number of students (in which case, one group will need a way for three students to listen at the same time to audio on a single computer. This can be achieved through connecting more than one headphone splitter)
  2. Instruct students to explore the Sonic Pi commands play and sleep to ensure they can hear audio on each respective computer for each headphone unit

Notes to the Teacher:

  • This is a good opportunity to address any initial technical issues with equipment that may be encountered in the beginning. It is important to ensure everyone can hear sound through their headphones

  • It is important when they encounter problems that they are not robbed of the opportunity to grow as problem solvers early on → this means the teacher should guide students through questioning as opposed to giving solutions to arising problems/bugs

  • Students can explore the rest of the Sonic Pi website created for this unit when they’ve spent enough time exploring the commands for this activity (https://chrispetrie.github.io/)

  • There is an inspirational music quote to briefly discuss which is embedded into each lesson to encourage students

Activity 2: Adjusting an algorithm to generate music (20 minutes)

Activity Overview: This activity gets students to explore iteration/loops/repetition in music and programming. Additionally, students will be introduced to the use_synth command to change sounds.

New Sonic Pi syntax to introduce in this activity (click for example code):

use_synth,

_times.do, loop do, live_loop :foo do  end 

Suggested Teacher Instruction Sequence:

1. Explore examples of film music with repetition. ‘Time’ by Hans Zimmer from the film Inception is a good example.

2. Discuss how often each instrument repeats in played examples.

3. Demonstrate repetition with a sequence in Sonic Pi through copying and pasting code. Pose the question: what if we want something to repeat a certain amount of times? or forever?

4. Demonstrate repetition with loops in Sonic Pi: _times.do, loop do, live_loop :foo do → all of these loops need to use the end command.

5. Demonstrate the error message that occurs when looping without a sleep command → ask students why the code is returning an error [because the computer needs to know when to play each iteration of the loop]

6. Demonstrate the use_synth command in order to use different sounds

Student Activity (5-10 minutes):

1. Implement several loops that run forever with different sounds

2. Try to get a-least one sound or sequence that your group is happy with before the end of this lesson

Notes to the Teacher:

  • Notice the dynamics of each group, some students may need to be shuffled so that they work more effectively

  • Note that in lesson #2 students will be asked to code the underlying harmonic structure of ‘Time’ from the film Inception 

Activity 3: Group composition brief (20 minutes)

Activity Overview: This activity gets students to start their group project.

Suggested Teacher Instruction Sequence:

1. Introduce Group composition brief 

2. View linked videos on topical issues facing the world today https://chrispetrie.github.io/teachervideos.html

3. Have a short class discussion on what might be appropriate sounds for these videos. Try to lead their awareness through questioning that there are many different types of sounds; including sounds not made by musical instruments which may be appropriate for their chosen video

4. Make students aware of the online resource to review samples available in Sonic Pi https://chrispetrie.github.io/teacherpreviewsamples.html

5. Briefly discuss the collaborative element of group projects. Look at the marking criteria for guidance on each individual’s contribution to the brief. Students are expected to collaborate, negotiate, and participate etc

Student Activity (10 minutes):

Instruct students to do the following:

1. Students in their groups are to first choose a video from https://chrispetrie.github.io/teachervideos.html

2. Students discuss and brainstorm appropriate sounds

3. Students to explore sounds in Sonic Pi using https://chrispetrie.github.io/teacherpreviewsamples.html

4. Start group project (10 minutes)

Notes to the teacher:

  • The teacher or student could use any video that they want to make music to. However, this unit has been designed for short 1-2 minute videos on climate change, pollution, and the refugee crisis so that they engage musically with meaningful contexts

  • Initial discussions and brainstorms on appropriate sounds for students’ chosen films are often only starting points →  the intention should be encourage experimentation and find solutions from unexpected sounds/sound manipulation

  • If students are struggling for ideas – ask them to just explore and survey the sounds available. If they get stuck after this, they could listen to film music they like for inspiration

Wrap-up activity: Quiz and reflection (10 minutes)

Activity Overview: All students to complete a quiz containing 10 questions on music and programming -  as well as a few reflective questions on this lesson (all students will complete this each lesson).

Student Activity (10 minutes):

  • Students individually complete the quiz and reflection on the key concepts in this lesson within 10 minutes linked here.

Administrative Details

Contact info

petriechris@gmail.com 

Credits

Developed by Chris Petrie.

Last updated on

27/06/2018

Copyright info

The content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License.