There are lots of tutorials showing how to hook up a microphone to an Arduino then process the stream of numbers from analogRead. A simple peak detector is probably sufficient to distinguish between soft clap and loud clap. A good search term is "arduino sound reactive".
Once this works, tackle the second phase to get the clap detect information to p5.js via the serial port. Tutorials can be easily found using google. The familiar name Tom Igoe is associated with p5.js to Arduino tutorials.