Bukit Mertajam, Penang

Play Music On Raspberry Pi


Have you ever thought to make an app that can play so many music notes? With Raspberry Pi now you can play any music notes for any music instrument using your keyboard! Yes, that’s true. This is one of the beginner project specially made for kids and newbie. Don’t worry, we will use Scratch 2 to program it and it’s so easy!

Hardware Preparation

This tutorial use :

  1. Raspberry Pi 3B+
  2. Speaker
  3. Monitor
  4. Keyboard


This project is using Scratch 2.0.

Figure 1 : Scratch 2.0

Sample Code

This is the sample code used for this tutorial. Try it!

Figure 2 : Sample Code for Piano

Thank you

Thank you for reading this tutorial and we hope it helps your project development. If you have any technical inquiry, please post at Cytron Technical Forum.

Leave a comment