open-audiovisual
Search GitHub

oav-p5 reference · The OAVp5 object (advanced)

OAVp5.hints#

variableoav-p5
OAVp5.hints

The list of cards oav-p5 has shown or would have shown so far (a blocked microphone, no Web MIDI, an error in your callback), each with what, why and what to press.

Each situation is said once per page. The list holds them all, including the ones the page did not show because hints=off is set, so it is the place to look when a sketch does something odd and nothing is on screen: console.log(OAVp5.hints).

Type
Array<Object>

Starts empty and only grows. Each item is { id, kind, what, why, next }: id names the situation ('micDenied', 'chopOut:lag'), kind is 'error', 'warn' or 'info', and what, why, next are the three lines of the card in the browser's language.

Notes

  • A card that went away because the situation ended (the microphone came on) stays in the list.

Examples

jsOpenProcessing ↗
function setup() {
  createCanvas(400, 300);
  lag(1);   // an unnamed lag() outside draw(): oav-p5 has something to say
}

function draw() {
  background(20);
  fill(255);
  text(OAVp5.hints.length + ' card(s) so far', 20, 30);
  text(OAVp5.hints.map((h) => h.kind + ': ' + h.what).join('\n'), 20, 60);
}
Lists what oav-p5 has said so far: here, that lag() was called outside draw(). The same sentence is in the console.

Related

  • hints Whether oav-p5 shows its explaining cards beside the 🎹 (blocked microphone, no Web MIDI, an error in your callback): on or off.
  • OAVp5.check() Runs the 🩺 check-up: the version, page, browser, microphone, MIDI, sound, drums, recording, wiring and hints, as a card to screenshot and as an object.
  • debug Prints [oav-p5 debug] lines in the console about clicks, the 🎹 button and loading, for finding out why the 🎹 does not respond.

p5/oav-p5.js, line 1221

↑ Back to top · All names