Grades 5–6: be the DJ and code your own beat
This Hour of Code, students use p5.js to build a DJ deck out of shapes, then program each pad to play a sound and remix it into their own beat. Everything happens in one studio that runs free in the browser, with nothing to install.
About 9 Dots. 9 Dots is a nonprofit that brings computer science to every elementary school student, starting in kindergarten. We deliver a fully supported, standards-aligned CS curriculum, and teachers don’t need any prior coding experience.
Leading this with a class? Get the facilitation guide
A lesson plan for running the DJ activity with your class: timing, discussion questions and tips for helping students who get stuck.
What you will build
First you’ll build a working DJ deck with two turntables and four drum pads. Then it’s your turn: remix it with new pads, new sounds, lights, spinning discs and beats. Most of the hour is yours to create.
Everything you need, in one studio
No tabs to flip between. The directions, your code and your deck all live on one screen, so students can read a step, type, press Play and hear the result.
What students practice
While they make music, students build real computer science habits. Each idea shows up in a short callout right when they use it.
Show a few remixed decks to spark ideas
Play this on the projector before students start remixing. All three decks are built from the same starter code.Questions to ask while it plays
- Which deck would you most want to play? Why?
- What is one thing each designer changed from the starter?
- Which change do you think took the most code?
- What would you change first on your own deck?
Want to learn more about 9 Dots?
Tell us a little about yourself and we will follow up with ways to bring computer science to your school or family.