Files
micromelon-website/content/resources/activity-making-music-beginner.mdx
Tim Hadwen 1f8c46597b Site audit: fix broken images, add activity metadata, clean up content
- Remove broken image references from 25 MDX files (deleted spacer/content images)
- Add codingSkills and roverConcepts frontmatter to 24 activity pages
- Fix "Activity Demonstration" headings in 15 activity files (plain text -> h3)
- Remove unused "All" category from 89 MDX files
- Decode HTML entities (> <  ) in 9 content files
- Escape bare < > characters in MDX to fix build errors
- Standardize contact email to contact@micromelon.com.au
- Add missing description to rover-repair-request metadata
- Include previous session work: about-us updates, difficulty filtering,
  LearningPathway component, expanded schools list, new product/resource images

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 21:49:15 +10:00

59 lines
3.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Activity: Making Music I"
date: "2024-12-31"
categories: ["Activities", "Simulator Activities"]
tags: ["Buzzer", "Beginner", "Variables"]
codingSkills: ["Variables"]
roverConcepts: ["Buzzer"]
excerpt: "Use the Rovers speaker to make it play songs. Learn to combine the world of music and robotics by going through sheet music and coding the Rover to play each note. Activity Demonstration Basics of Music:When it comes to reading sheet mu"
featuredImage: "/images/resources/activity-making-music-beginner.jpg"
---
Use the Rovers speaker to make it play songs. Learn to combine the world of music and robotics by going through sheet music and coding the Rover to play each note.
![](/images/content/40dff0-img_1856.jpg)
### Activity Demonstration
### Basics of Music:
When it comes to reading sheet music for this task, we will be using two pieces of information from each note. The tone of the note and how long the note is played.
As the image to the right shows, a note can sit on a line or a space. You may find many notes of the same letter (tone) but at a higher pitch (different octave)
![](/images/content/ba4440-notes.jpg)
Songs can be divided into a rhythm, the constant beat the music follows. Shown in the diagram to the right, we have the note durations. One whole note (semibreve) lasts for 4 beats. Next, minums last for 2, and crotchets last for 1. Well only use semibreves, minums, and crotchets for basic songs.
Below is an example of Mary Had a Little Lamb in sheet music. The letters have already been written below the notes. This is the example we will use for the guide, but feel free to find your own songs or even write your own music!
## Code:
**Constant -** A constant is a variable that never changes when the code is run. In python, we write this in all capitals with underscores between words.
#### 1) Setting the Constants:
![](/images/content/9667be-constants.png)
Now we need to start setting up the framework in our code to make music. Well begin by setting constants for each of the note lengths. A constant is a value used repeatedly throughout the code that never changes, which is perfect for what we need here. As all the notes are multiples of the Crotchet, we can use the diagram above and some simple multiplication to set all the constants. We also need to decide on an octave to use, so make a comment to remember this. For this example, well use octave 4.
#### 2) Making the Music:
![](/images/content/167706-note.png)
This part can take a little while, but we will use the Play Note and the Delay blocks to play each note individually. The Play Note block starts playing the note on the Rover, and the Delay block controls how long the note is played. We use the constants we made before to control how long we delay. Do this for each note in the song with the correct note lengths.
#### Complete Code:
We went through and completed part of the example song. Try to finish the rest of the song on your own:
![](/images/content/c9dfce-song.png)
### Up Next:
Ready to challenge yourself with faster ways to code music? Head on over to the intermediate or advanced Making Music guides!
[Activity: Making Music (Intermediate)](/resources/activity-making-music-intermediate)
[Activity: Making Music (Advanced)](/resources/activity-making-music-advanced)