4. Buzzer Music Code Ordering

4.1. Question 1

Put the code snippets in order to play a single, clean quarter note on the microbit built-in speaker.
Drag and drop lines into the correct order and click to adjust indentation:
while True:
sleep(250)
music.play("c4:4")
from microbit import *
import music

4.2. Question 2

Arrange these lines sequentially to play a custom melody on the microbit built- in speaker.
Drag and drop lines into the correct order and click to adjust indentation:
tune = ["c4:4", "e4:4", "g4:4"]
from microbit import *
while True:
import music
sleep(500)
music.play(tune)

4.3. Question 3

Order the snippets below to create an interactive button-activated chord loop.
Drag and drop lines into the correct order and click to adjust indentation:
import music
from microbit import *
chord = ["c4:4", "e4:4", "g4:4"]
while True:
music.play(chord)
if button_a.is_pressed():

4.4. Question 4

Put the code snippets in order to safely set up a breadboard buzzer task.
Remember the warning theory: you must turn off the internal built-in speaker first so it does not conflict with your external breadboard hardware component before playing a built-in melody.
Drag and drop lines into the correct order and click to adjust indentation:
speaker.off()
import music
music.play(music.RINGTONE)
from microbit import *
while True:

4.5. Question 5

Arrange the blocks below to assemble an interactive musical instrument.
The instrument should play a custom melody on the buzzer when Button A is pressed.
The instrument should play a built-in melody on the microbit speaker when Button B is pressed.
Drag and drop lines into the correct order and click to adjust indentation:
import music
speaker.on()
music.play(chord)
speaker.off()
chord = ["c4:4", "e4:4", "g4:4"]
while True:
if button_a.is_pressed():
elif button_b.is_pressed():
music.play(music.BADDY)
from microbit import *

4.6. Question 6

Order the lines below to build an E Minor emergency manual exit sounds system.
The system must sequentially iterate through the custom frequencies array but must break out of the playback loop if the user strikes Button A.
Drag and drop lines into the correct order and click to adjust indentation:
Em_freqs = [659, 784, 988]
import music
if button_a.is_pressed():
from microbit import *
for freq in Em_freqs:
while True:
speaker.off()
music.pitch(freq, duration=400)
break