Last active
September 26, 2023 08:39
-
-
Save lwchkg/ed97353ed6e12501cb226f25e557377f to your computer and use it in GitHub Desktop.
Mario 2 overworld melody for Micro:bit MakeCode. I have confirmed that the pitches of all notes are correct. Some duration of long notes may need adjustment.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mario2Start: string[] = [ | |
"g5:4","f#:8","f:4","d:8","b4:4","a:8","g#:4","g:12","g5","g4:18","r:6", | |
] | |
const mario2Body: string[] = [ | |
"g5:8","c:4","e:8","g:12","c:4","e:8","g:4","b4","eb5","g","b:8","a:24","r:4", | |
"g5:8","bb4:4","d5:8","g:12","bb4:4","d5:8","g:4","c#","e","g","b:8","a:20","r:4", | |
"b:4","c6:8","b5:4","c6:8","a5:12","c6:4","b5:8","a:4","g:8","f#:4","g:8","e:12", | |
"c#:4","d:8","e:4","f:8","e:4","f:8","b4:12","e5:4","d:8","c:28","r:24", | |
"r:8","e5:16","g:12","a:8","c6:28","a5:8","g:4","e:8","c:4", | |
"d:8","e:4","d:8","e:4","d:8","a4:8","r:4","d5:16", | |
"a4:2","d5","a4","d5","a4","d5","a4","d5","a4","d5","a4","d5:4","r:10", | |
"d:12","e:4","d:8","e:4","d:8","e:4","r:8","a:12","g:4","a:8","g:4","e:8","d:4","c:8","e:16", | |
"g4:2","e5","g4","e5","g4","e5","g4","e5","g4","e5","g4","e5:4","r:10", | |
"r:8","g","d","b4","a","g", | |
"r:8","e5:16","g:12","a:8","c6:28","a5:8","g:4","e:8","c:4", | |
"d:8","e:4","d:8","e:4","d:8","a4:8","r:4","d5:16", | |
"a4:2","d5","a4","d5","a4","d5","a4","d5","a4","d5","a4","d5:4","r:10", | |
"d:12","e:4","d:8","e:4","d:8","e:4","r:8","a:12","g:4","a:8","g:4","a:8","g:4","e:8","c:16", | |
"r:8","f#4:4","g:8","g#:4","a:8","c5:12","r:12","c:16","r:12", | |
"e5:8","f:4","d#:8","e:4","f:8","d#:4","e:8","b:16","g#:12","f","e", | |
"d:3","e","d","c","b4:8","c5:4","d:8","c:4","b4:8","c5:16","r:8","c:4","b4:12","c5", | |
"r:8","d:16","c#:12","d:8","a:16","f#:12","g","a", | |
"b5:8","a#4:4","b:8","b5:4","a:8","g#4:4","a:8","a5:4","ab:8","g4:4","ab:8","ab5:4","g:8","d:4","b4:8","g:4" | |
] | |
music.setTempo(192 * 3) | |
music.startMelody(mario2Start, MelodyOptions.OnceInBackground) | |
music.onEvent(MusicEvent.BackgroundMelodyEnded, function () { | |
music.startMelody(mario2Body, MelodyOptions.OnceInBackground) | |
}) |
MicroPython version:
from microbit import *
import music
music.set_tempo(bpm = 192 * 3)
music.play(["g5:4","f#:8","f:4","d:8","b4:4","a:8","g#:4","g:12","g5","g4:18","r:6"])
mario = [
"g5:8","c:4","e:8","g:12","c:4","e:8","g:4","b4","eb5","g","b:8","a:24","r:4",
"g5:8","bb4:4","d5:8","g:12","bb4:4","d5:8","g:4","c#","e","g","b:8","a:20","r:4",
"b:4","c6:8","b5:4","c6:8","a5:12","c6:4","b5:8","a:4","g:8","f#:4","g:8","e:12",
"c#:4","d:8","e:4","f:8","e:4","f:8","b4:12","e5:4","d:8","c:28","r:24",
"r:8","e5:16","g:12","a:8","c6:28","a5:8","g:4","e:8","c:4",
"d:8","e:4","d:8","e:4","d:8","a4:8","r:4","d5:16",
"a4:2","d5","a4","d5","a4","d5","a4","d5","a4","d5","a4","d5:4","r:10",
"d:12","e:4","d:8","e:4","d:8","e:4","r:8","a:12","g:4","a:8","g:4","e:8","d:4","c:8","e:16",
"g4:2","e5","g4","e5","g4","e5","g4","e5","g4","e5","g4","e5:4","r:10",
"r:8","g","d","b4","a","g",
"r:8","e5:16","g:12","a:8","c6:28","a5:8","g:4","e:8","c:4",
"d:8","e:4","d:8","e:4","d:8","a4:8","r:4","d5:16",
"a4:2","d5","a4","d5","a4","d5","a4","d5","a4","d5","a4","d5:4","r:10",
"d:12","e:4","d:8","e:4","d:8","e:4","r:8","a:12","g:4","a:8","g:4","a:8","g:4","e:8","c:16",
"r:8","f#4:4","g:8","g#:4","a:8","c5:12","r:12","c:16","r:12",
"e5:8","f:4","d#:8","e:4","f:8","d#:4","e:8","b:16","g#:12","f","e",
"d:3","e","d","c","b4:8","c5:4","d:8","c:4","b4:8","c5:16","r:8","c:4","b4:12","c5",
"r:8","d:16","c#:12","d:8","a:16","f#:12","g","a",
"b5:8","a#4:4","b:8","b5:4","a:8","g#4:4","a:8","a5:4","ab:8","g4:4","ab:8","ab5:4","g:8","d:4","b4:8","g:4"
]
music.play(mario, wait = False, loop = True)
while True:
if button_a.was_pressed():
music.stop()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AWESOME!!!