Microbit
Beginner
60 mins
Teacher/Student led
75 points
What you need:
Chromebook/Laptop/PC
Microbit

Sound Recorder

Embark on an exciting journey to create your own music project. Begin by setting up a new project, then add the music code using the 'music.play' function. Finally, test your music by pressing the 'A' button. Enjoy the symphony of your creation!
Learning Goals Learning Outcomes Teacher Notes

Live Class Feed

This is a live feed of the latest activity by your students on this lesson. It will update in real-time as they work on the lesson.
Load previous activity

    1 - Create a New Project

    Start by creating a new project. Give it a name like 'Music Maker'.

    2 - Add the Music Code

    Now it's time to add some music! We'll use the 'music.play' function. This function plays a melody when you press a button. Here's the code:

    input.onButtonPressed(Button.A, function () {
        music.play(music.stringPlayable("- - - - - - - - ", 120), music.PlaybackMode.UntilDone)
    })

    You can replace the '- - - - - - - - ' with a melody from the gallery or design your own melody using the tool. The '120' is the tempo of the music, you can change it to make the music faster or slower.

    3 - Test Your Music

    Now you can test your music! Press the 'A' button on the simulator to hear your melody. If you have a physical Microbit, this step is optional, you can download the code onto your device and press the 'A' button to hear the music.

    Unlock the Full Learning Experience

    Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our Digital Skills Curriculum.

    Copyright Notice
    This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more