Hi,
Welcome to the forum!
Thanks for sharing this video I didn’t know Cassie!
In the video she’s computing the distance between two points of the mouse like so :
mouthDist = mouthTop.sub(mouthBottom).mag();
And this gives values between 3
and 17
when the mouse is open.
If you want to detect if the mouse is open, you need to check if the mouthDist
value is greater than some value :
if (mouthDist > 3) {
// Start playing the oscillator
}
So I would start the oscillator in the setup()
function and then in the loop check if the mouse is open and call osc.amp()
and the frequency according to that.
For the freezing issue it’s difficult to know why because it could be your computer, your browser (the number of tabs and processes running on your laptop), p5 web editor or the face tracking library initialization…