Make a beat box by making buttons the play pieces of songs. The button
command puts a button on the screen. The code indented after the ->
is run when the button is pressed.
The play
command normally sequences things so that the next song waits until this previous one is finished. To play sounds without forcing sequencing, you can either use the "wait" option: play {wait: false}, "CDE"
, or you can use the tone
function.