Microphone input to display p5js

Hi,
I want to create a project using Arduino microphone. The microphone should be able to map 2 level of sounds: low and high and than display 2 different images, per sound level, on my desktop using p5js.
I've tried to look online for some tutorials but I couldn't find anything similar/close enough to use and I'm kind of lost :confused: I'm a total beginner and need it for my school project. Can you please direct me to tutorials or suggest the path I should go in while trying to make something work?
Thanks a lot :slight_smile:

I'm a total beginner and need it for my school project.

Why pick such an advanced project if you know nothing.

Can you please direct me to tutorials

If their were tutorials then their would be little point in the project, you would not be doing anything creative but just copying a set of instructions.

The microphone should be able to map 2 level of sounds: low and high

You need a microphone, amplifier and envelope follower or detector:- Envelope detector - Wikipedia

Then it is trivial to read the output of this with an analogRead function.

Then all you need to do is to see what commands you have to send to p5js to display an image. I suspect this is sent by serial write or serial print.

display 2 different images, per sound level, on my desktop using p5js

It probably makes more sense to plug a mic into your soundcard... That way you' won't have to build any special/custom hardware. And, you'd only have to program one device (the computer).

Or with a laptop, you could use the built-in mic.

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.