4. Music Rhythms

4.1. Rhythm: Shave and a hair cut: two bits

The rhythm below is given by saying aloud: “Shave and a hair cut: two bits”.
Play this rhythm.
from microbit import *
import music

music.set_tempo(ticks=4, bpm=120)
rhythm = ["C4:4", "C4:2", "C4:2", "C4:4", "C4:4", "R:4", "C4:4", "C4:4", "R:4"]


while True:
    music.play(rhythm)

Tasks

../_images/shave_and_a_haircut.png
  1. Modify the notes to match the image notes in the key of G.

  2. Modify the notes to match the image notes, but in the key of C.

Modify the notes to match the image notes in the key of G.

from microbit import *
import music

music.set_tempo(ticks=4, bpm=120)
rhythm = ["G4:4", "D4:2", "D4:2", "E4:4", "D4:4", "R:4", "F#4:4", "G4:4", "R:4"]

while True:
    music.play(rhythm)

Modify the notes to match the image notes, but in the key of C.

from microbit import *
import music

music.set_tempo(ticks=4, bpm=120)
rhythm = ["C5:4", "G4:2", "G4:2", "A4:4", "G4:4", "R:4", "B4:4", "C5:4", "R:4"]

while True:
    music.play(rhythm)

4.2. Rhythm: Famous movie series 1

Play this rhythm.
Can you identify the movie theme?
from microbit import *
import music

music.set_tempo(ticks=4, bpm=90)
rhythm = ["C4:3", "C4:1", "R:2", "C4:2", "C4:2", "C4:2", "R:1", "C4:1", "R:2", "C4:2", "C4:2"]

while True:
    music.play(rhythm)
    sleep(1000) # Give it a 1-second dramatic pause before repeating

Tasks

  1. Replace the notes with: G, G, Bb, C5, G, G, F, F#.

Replace the notes with: G, G, Bb, C5, G, G, F, F#.

from microbit import *
import music

music.set_tempo(ticks=4, bpm=90)
rhythm = ["G4:3", "G4:1", "R:2", "Bb4:2", "C5:2", "G4:2", "R:1", "G4:1", "R:2", "F4:2", "F#4:2"]

while True:
    music.play(rhythm)
    sleep(1000) # Give it a 1-second dramatic pause before repeating

4.3. Rhythm: Famous movie series 2

Play this rhythm.
Can you identify the movie theme?
from microbit import *
import music

music.set_tempo(ticks=4, bpm=105)
rhythm = [
    "C4:4", "C4:4", "C4:4", "C4:3", "C4:1",  # Dun, dun, dun, da-da
    "C4:4", "C4:3", "C4:1", "C4:8",          # Dun, da-da, dunnn
    "C5:4", "C5:4", "C5:4", "C5:3", "C4:1",  # Dun, dun, dun, da-da
    "C4:4", "C4:3", "C4:1", "C4:8"          # Dun, da-da, dunnn
]

while True:
    music.play(rhythm)
    sleep(1000) # Give it a 1-second dramatic pause before repeating

Tasks

  1. Replace the notes with: G, G, G, Eb, Bb, G, Eb, Bb, G, D, D, D, Eb, Bb, F#, Eb, Bb, G.

Replace the notes with: G, G, G, Eb, Bb, G, Eb, Bb, G, D, D, D, Eb, Bb, F#, Eb, Bb, G.

from microbit import *
import music

# 105 BPM gives it that perfect, driving military march pace
music.set_tempo(ticks=4, bpm=105)

# The definitive main melody of The Imperial March
imperial_march = [
    "G4:4", "G4:4", "G4:4", "Eb4:3", "Bb4:1",  # Dun, dun, dun, da-da
    "G4:4", "Eb4:3", "Bb4:1", "G4:8",          # Dun, da-da, dunnn
    "D5:4", "D5:4", "D5:4", "Eb5:3", "Bb4:1",  # Dun, dun, dun, da-da
    "F#4:4", "Eb4:3", "Bb4:1", "G4:8"          # Dun, da-da, dunnn
]

while True:
    music.play(imperial_march)
    sleep(1000) # Give it a 1-second dramatic pause before repeating