noteIsPressed#
variableoav-p5noteIsPressed
True while at least one key is held down.
To ask about one particular key, use noteIsDown(). midi.held lists every key held right now, lowest first.
- Type
Boolean
Like keyIsPressed, for MIDI keys. False when nothing is held.
Examples
function setup() {
createCanvas(400, 300);
}
function draw() {
background(noteIsPressed ? 90 : 20); // lighter while any key is down
}Related
noteIsDown()True while the keyn(a MIDI number or a name like'C4') is held down.noteThe MIDI number (0 to 127) of the last key pressed.notePressed()You define this function; oav-p5 calls it each time a key (or a pad) goes down.