Hour of CodeSuggested for grades 5–6

Intermediate: 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.

For teachers

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.

Open the teacher guide

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.

5 minGet set up in the studio
8 minStep 1: build the board with a rectangle
10 minStep 2: add the turntables and drum pads
12 minStep 3: meet your sound kit and code the drums
22 minStep 4: remix your deck
3 minStep 5: share and reflect
ASDF++++
Your deck after Step 3. The empty row is room for your remix.

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.