Happy New Year

Happy New Year everyone!

# Project: 'Auld Lang Syne' tune for the BBC micro:bit
#  Author: @KariLawler (Twitter)
# Created: 31/Dec/2017
# Version: 1.0
from microbit import *
import music

tempo = 120
auld_lang_syne = [
    'c4:4',
    'f4:6', 'e4:2', 'f4:4', 'a4:4',
    'g4:6', 'f4:2', 'g4:4', 'a4:4',
    'f4:6', 'f4:2', 'a4:4', 'c5:4',
    'd5:12', 'd5:4',
    'c5:6', 'a4:2', 'a4:4', 'f4:4',
    'g4:6', 'f4:2', 'g4:4', 'a4:2', 'g4:2',
    'f4:6', 'd4:2', 'd4:4', 'c4:4',
    'f4:12'
]

music.set_tempo(bpm=tempo)
while True:
    if button_a.is_pressed():
        for note in auld_lang_syne:
            music.play(note)

Leave a Reply