Computer Science Education

Code Beats

Using hip hop music to teach computer programming

With technology touching nearly every aspect of our society, it is essential that all students acquire skills and knowledge in computer science (CS). Unfortunately, engagement is still limited due to a low presence of CS in K-12 education requirements, particularly in schools with high concentrations of minority students. The CS for All movement aims to address this challenge by making CS more readily available and engaging for students of all ages and cultural backgrounds. As a part of this movement, we have developed a system which uses hip-hop music to teach basic computer programming skills.

The technology

Hip-hop music shares a certain set of characteristics which makes it well suited for teaching CS concepts. The beats of the songs are relatively simple and typically consist of a single repeating pattern with periodic variations. To take advantage of these characteristics, we have created lessons which allow the students to construct popular hip-hop songs using a sequence of commands and functions. Using the SonicPi coding environment, each lesson focuses on a new concept and how it can be used in developing a layer of the overall song. By the end of the lessons, students will be able to map out the structure of the songs and develop high quality sounding beats.

CodeBeats
Figure 1. SonicPi’s user interface being used to create a realistic hip hop beat