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

That’s an offer I can’t refuse. Thank you.

I was thinking of make the unfilled ellipses white without black edges, same as the background. So the ellipses will be only then seen when they get coloured.

fill(lerpColor(color(255, 0, 0), color(0, 0, 255), i / notes.length));

Do you mean from this spectre? I guess the colours should be defined then manually. Could that make sense? Some how giving each of the keys…

// The midi notes of a scale
var notes = [
  40,
  41,
  42,
  43,
  44,
  45,
  46,
  47,
  48,
  49,
  50,
  51,
  52,
  53,
  54,
  55,
  56,
  57,
  58,
  59,
  60,
  61,
  62,
  63,
  64,
  65,
  66,
  67,
  68,
  69,
  70,
  71,
  72,
  73,
  74,
  75,
  76,
  77,
  78,
  79,
  80,
  81,
  82,
  83,
  84,
  85,
  86,
  87,
  88,
  89,
  90,
  91,
  92,
  93,
  94,
  95,
  96,
  97,
  98,
  99,
];
var osc;

… specific 60 colours?