noteReleased()#
eventoav-p5function noteReleased(note) {}
You define this function; oav-p5 calls it each time a key (or a pad) is let go.
The partner of notePressed(), like keyReleased() to keyPressed():
function noteReleased(note) {
// a key came up
}Parameters
| Name | Type | Description |
|---|---|---|
note | Number | The MIDI number of the key that was released. |
Examples
let held = {};
function setup() {
createCanvas(400, 300);
}
function notePressed(note) { held[note] = millis(); }
function noteReleased(note) { delete held[note]; }
function draw() {
background(20);
fill(255);
text(Object.keys(held).map((n) => noteName(+n)).join(' '), 20, 40); // the keys down now
}Related
notePressed()You define this function; oav-p5 calls it each time a key (or a pad) goes down.padReleased()You define this function; oav-p5 calls it each time a drum pad is let go.noteOff()You define this function; oav-p5 calls it for every MIDI note-off, with the key and the channel.noteIsDown()True while the keyn(a MIDI number or a name like'C4') is held down.