Any idea how to make this in processing p5.js?

Oops! That’s right – I missed that it was p5.js.

https://p5js.org/reference/#/p5/sin