How do I make music start after I make a loud noise?

Hey I’m new to Arduinos and my teacher is grading me for this so I can’t fail haha

So I programmed a song and when I f.e. clap my hands, the songs supposed to start and continue playing til the end. so I used the if, else programming method. However, the song only continues if I continue making the loud noise and stops when I stay silent. Does anybody know how I can make the song continue playing directly after I clap? Basically so that the clap is like a play button. Thank youuu xx :slight_smile:

(Btw Im using the Grove Beginner Kit)

GBK_GFS_Music.ino (2.65 KB)

Start by moving the detector code outside the for() loop.

Done. What now? x

arduino_user1222: Done. What now? x

Compile it, test it, and post it if you have problems (don't forget to explain what's wrong). Before you post, read the instructions at the top of the forum about how to post code.