How to connect/trigger elements in specific mouse-pressed combinations in p5.js (piano)

you can still improve some things. For example you do use 2 buffers.

  • The piano buffer could be filled in setup() because it never changes

  • The ellipse buffer does only change when a note has been played. So it needs to be defined only then and not throughout

This reduces the computational load on the processor

1 Like