midi keyboard / noteOn & noteOff: shape fade out
in
Programming Questions
•
3 years ago
i draw with the midi keyboard shapes like this:
- void noteOn(Note note, int device, int channel){
- int vel = note.getVelocity();
- int pit = note.getPitch();
- println(pit);
- fill(255, _alpha);
- rect((pit-48)*40, 0, 40, 150);
- }
now i would like to do a alpha-fade for out by the noteOff-Event
- void noteOff(Note note, int device, int channel){
- int pit = note.getPitch();
- fill(255, 0);
- }
logically this script does not work

how i have to work out this? (maybe with OOP?)
1