How to make this program like a clap/snap fingers switch, and filter out all excess noise?

Please provide links to your clap sensor, and re-read your post… it doesn’t sound right
Clap on - Clap on.

Can you sketch out your circuit including power paths.

Thanks