SkillsBuild STEM Labs Part 1

pi-topCEED Sonic pi



Sonic Pi is a live coding music synth that comes pre-loaded on the pi-topCEED and is designed for teaching music creation through coding.

Course/SkillsBuild for Student Module: SkillsBuild Lab Sonic Pi Lesson Plan


Topics: Coding


Length of class: Activities vary in time allotment, but most can easily accommodate a 40 minute class period.


Outcomes: What learners will be able to know, do, or value by the end of the lesson.

  • Students will be able to identify the Python coding elements for creating music.
  • Students will execute the appropriate programming code to create music.
  • Students will be able to identify and explore music careers that utilize programming and the skills involved in software development.


Workplace learning skills:


  • Collaboration
  • Analytical thinking

Required Learning Materials/Resources:

  • Raspberry pi-topCEED (kit)
  • Keyboard and mouse
  • Raspberry Pi 3B+ (circuit board)
  • pi-topSpeaker
  • Headphones (recommended – not provided)

Learning Environment Needs:

The unit takes up the typical desktop space as would a normal keyboard, mouse and screen. 


Like any piece of electronic equipment, pi-top hardware must be used in the correct way and safety precautions followed. Go over the following safety precautions with students before starting with the Raspberry Pi.


If students drop anything into the modular area of the pi-top, or if an item slides underneath the main Raspberry Pi computer unit students should follow these instructions.


  • Stop working immediately.
  • Shutdown the computer completely and remove the power supply cord. 
  • Ground yourself correctly to discharge any static electricity (more information here).
  • Place the unit on a flat hard surface
  • Try and retrieve the object safely, do NOT use items like metal tweezers.
  • if the object has slid underneath any of the printed circuit boards do not shake the unit in an attempt to dislodge it. Instead, gently remove the circuit board using a screwdriver and retrieve the object. 
  • Do not jam, scrape or prod any internal part of pi-top with a tool, doing so may damage the unit.


Because heat can build up, students should not touch any part of the Raspberry Pi or Hub while using the pi-top. During normal usage pi-top’s built-in heatsink thermal pad and Cooling Bridge will dissipate any excess heat generated by the Raspberry Pi 3B or 3B+. In certain circumstances (sustained intensive heavy processor usage) students should be aware that the Raspberry Pi CPU might become hot. If this happens, stop what processes you are running and let the unit cool down. Furthermore, all Raspberry Pi computers have built-in thermal throttling, which restricts the processing power of the main CPU chip if it’s becoming too hot.


Part 1: Intro to Sonic Pi (15 mins)

Check for any prior knowledge of Sonic Pi and coding  with the KWHLAQ worksheet. Ask questions like “How can music be created with a Sonic Pi?” and “What does Sonic Pi do?”


Have students watch the pi-topSpeaker video.  Afterwards students will install the speaker on the pi-topCEED.


Next have students watch Part 1 and Part 2 in the Introduction to Sonic Pi video series.

Part 2: Sonic Pi Activity (time varies)

Students will access the Sonic Pi program through the pi-topCEED dashboard and begin to create their music code.



Students will get started with the Sonic Pi interface. It has three main windows. The largest one is for writing the code and is called the Programming Panel. There is also an output panel that displays information about the program as it runs. When students click on the help button at the top of the window, the third panel appears along the bottom displaying help documentation. This contains information about different code they can try and use, as well as different synth sounds, samples, and much more.


Have students follow the below steps:


  • Launch Sonic Pi from the desktop or applications menu.
  • SelectBuffer 1 and type



  • Click on the play icon at the top of the screen. What happens?
  • What happens if you typepley 60 and click on the play icon?

This is an example of a bug in their code. In later activities, if the error panel displays text they will know that they have a bug that they need to fix. It could be that they have misspelled a word like play.

Now type:



  • Click on the play icon at the top of the screen. What happens?
  • The computer is playing each note in sequence (one after the other), but it is happening so fast that to us they sound like they are playing at the same time.

We need to tell the computer to pause between each note. We can do this by typing the following after each play:



  • The value entered after the word sleep represents time in seconds. Using the value 1 represents one second. What would you type for half a second?
  • Now write a sequence of play and sleep to make a cool-sounding tune!

Now that students have mastered the basics of Sonic Pi, they can code a tune! They can follow the next steps on how to loop a tune.

Students can also watch additional videos (Parts 3-10 available) in the Introduction to Sonic Pi video series (see Additional Resources) to learn more advanced coding options.




Students who wish to advance in their music coding knowledge can follow the activities detailed in Code Music with Sonic Pi.

Part 3: Career Focus (30 mins)

Check for prior knowledge. Ask students questions like “What kinds of careers could use Raspberry Pi?”, “What kind of industry could benefit from using Python coding?”


In this day of technological advancement, the usage of computers has been incorporated into just about every field, including music. Therefore, many careers that deal with music, from its creation to implementation in the media, will involve computerization. If you are interested in how you can intertwine the two fields into a productive career, some options are listed below.


Use career graphic organizer as students go through these articles:


Additional Resources/ Deeper Learning

Assessment/ Evaluation

Based on application, how I will I know learners have met intended outcome?

— KWHLAQ worksheet

— Teacher may wish to create a rubric for the activity

— Career Research Graphic Organizer

Summary/ conclusion

How will I bring lesson to an effective closing?


  • Check for understanding and answer any subsequent questions
  • Emphasize key information
  • Ask the question “What information did you learn that you think you will find important 3 years from now?”
  • Remind students that there are more relevant courses on SkillsBuild for Students to continue their learning


We want to hear from you! After completing this lab, please take a moment to fill out this short form. The information collected will provide helpful insights on how the Labs kits and activities are being utilized.


SkillsBuild STEM Labs Use