Getting Sketch To Reset using MIDI

what i’m trying to do is I have a midi keyboard with the C,E and G keys assigned as int 255 each, to make a coloured ellipse, what I’d like is that when the keys are released to then remove that color value so the RGB values can be changed and not just ultimately create a white ellipse…?

import themidibus.*;
MidiBus myBus;

int Ckey;
int Ekey;
int Gkey;
boolean noteOn ;
boolean noteOff ;
int pitch;

void noteOn(int channel, int pitch, int velocity) {
if (channel == 0 && pitch == 60) {
Ckey = 255;
}
if (channel == 0 && pitch == 64) {
Ekey = 255;
}
if (channel == 0 && pitch == 67) {
Gkey = 255;
}

println("C: " + channel + " P: " + pitch + " V: " + velocity);
}

void setup () {
size (400, 400);
background (255);

MidiBus.list();
myBus = new MidiBus(this, 0, 3);
}

void draw () {

fill (Ckey, Ekey, Gkey);

ellipse (200, 200, 200, 200);
}

Have you tried using either note off or keyReleased? I’m not quite clear on your goal from your description.