software resources for science and technology education

Christmas Music Project from Mr Bit



Make your micro:bit play a Christmas tune.  


Mr Bit shows you how to take a tune from a music score and enter the notes into a program for the BBC micro:bit.

Whether loud or soft, fast or slow, sad or happy, a tune always has a series of notes, one after another.  A note can be high or low in pitch or short or long in duration.  To make music with your micro:bit all you have to do is to put notes in the right order and specify the pitch and duration of each note.





IMB resources

What you need:


The notes on a music score show all that you need to know about pitch and duration.


Pitch is shown by the height of the note on the 5-line stave; with 5 lines and 4 spaces the stave can indicate 9 different notes.  By adding floating notes above and below the stave you can increase this number.  Each pitch has a letter as shown here.








Duration is shown by the style of the note and its stalk.  


The most common note is the crotchet, a solid blob with a plain stalk.  When a tune has a regular beat, this is the note that shows the beat.  Most tunes have between 60 and 120 beats per minute making the duration of a crotchet typically between 1000 milliseconds and 500 milliseconds.






In our Christmas tune, as well as having crotchets, we have two other types of notes:


Quaver: this has half the duration of a crotchet, so 2 quavers last as long as one crotchet.


Minim: this has twice the duration of a crotchet, so 2 crotchets last as long as one minim.


The quaver looks like a crotchet with a tail.

The minim looks like a crotchet with a hole in the  blob.





Skip this bit if you are familiar with music notation.




Scientific notation of pitch

Since the letters for notes are used in a repeating cycle, at several different pitches, we need an additional code to give a unique indication of pitch.  Scientific notation does this by adding a number to indicate in which octave (sequence of 8 notes) the note occurs.  C4 is middle C on a piano; C5 is an octave above; C3 is an octave below.  The octave number increases by one every time you go from B to C.  Insight Mr Bit uses this notation for pitch.



Pitches of notes you can program with Mr Bit:





That’s enough explanation.  Let’s get started on our tune “We wish you a Merry Christmas”


Step 1 – Prepare the tune


To prepare for making your program, the first step is to write underneath the stave the letter name for each note:


You now have a choice of coding editor:

Mr Bit            JavaScript Blocks           MicroPython


Step 2 – Prepare the Python editor




Step 3 – Type the tune notation


For each note in the tune, we need to show its pitch and duration.


Like this:   D4:4


Pitch is shown by the letter and octave number. (D4)

Duration is shown by the number after the colon:

A crotchet (one beat) lasts for 4 units.

A quaver (half beat) lasts for 2 units.

A minim (2 beats) lasts for 8 units.


The tune notation will be stored in a variable named ‘merry_xmas’. Between the square brackets each note is shown in inverted commas and the notes are separated by commas.




Step 4 – Program button A to start the music




Step 5 – Download the program to the micro:bit




Step 6 – Prepare the micro:bit




Taking it further


You can extend the control system to show a “Merry Christmas” message on the LEDs when the tune has played:

display.scroll(“MERRY CHRISTMAS”)

Python rule for pitch:  

The next note will have the same octave number, unless a different octave number is shown.


Python rule for duration:  

The next note will have the same duration, unless the note value changes: crotchet (4), quaver (2), minim (8).



Christmas carols

Download these scores to create more Christmas tunes.

Away in a manger


Hark the herald angels sing

 

O come all ye faithful


Once in royal David’s city


Silent night    

© 2024 Insight Resources