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:
music.play("c4:4")
sleep(250)
import music
from microbit import *
while True:

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:
while True:
import music
sleep(500)
from microbit import *
music.play(tune)
tune = ["c4:4", "e4:4", "g4:4"]

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:
while True:
import music
music.play(chord)
from microbit import *
chord = ["c4:4", "e4:4", "g4:4"]
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:
music.play(music.RINGTONE)
speaker.off()
import music
while True:
from microbit import *

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:
from microbit import *
import music
music.play(chord)
elif button_b.is_pressed():
chord = ["c4:4", "e4:4", "g4:4"]
while True:
speaker.on()
speaker.off()
music.play(music.BADDY)
if button_a.is_pressed():

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:
speaker.off()
music.pitch(freq, duration=400)
Em_freqs = [659, 784, 988]
if button_a.is_pressed():
break
for freq in Em_freqs:
while True:
import music
from microbit import *