open-audiovisual
Search GitHub

oav-p5 reference · Loading options

hints#

optionoav-p5
?oav_hints=on | off

Whether oav-p5 shows its explaining cards beside the 🎹 (blocked microphone, no Web MIDI, an error in your callback): on or off.

When something goes wrong, a small card beside the 🎹 says what happened, why, and what to press, in the browser's language, once per page. hints: 'off' takes the cards off the page: the console still says the same thing and OAVp5.hints still lists what was said. Use it for a finished piece that goes on a wall or into a recording.

It also hides the corner oscilloscope of scope(), which is part of the same on-page help. scope=off hides only that.

Type
String
Values
on | off
default
on

Only off turns the cards off. Any other value, including the text false, leaves them on.

Notes

  • Set it before oav-p5 loads. window.OAV_P5 = { hints: … }; above the loader line wins, then ?oav_hints=… on the page address, then ?hints=… on the script's own URL. Values in window.OAV_P5 are turned into text, so write 'off', not false. On OpenProcessing the page address takes ?sketch_oav_hints=… (the project's README says OpenProcessing forwards it to the sketch).

Examples

jsOpenProcessing ↗
window.OAV_P5 = { hints: 'off' };

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

function draw() {
  background(20);
  fill(255);
  text('cards said: ' + OAVp5.hints.length + ' (none on the page)', 20, 30);
  text(OAVp5.hints.map((h) => h.what).join('\n'), 20, 60);
}
oav-p5 notices the lag() in setup() and would normally show a card. With hints off nothing appears on the page, but the console and the list in OAVp5.hints still have it.
jsOpenProcessing ↗
window.OAV_P5 = { hints: false };   // not 'off': the value is turned into the text "false"

function setup() {
  createCanvas(400, 300);
  lag(1);
}

function draw() {
  background(20);
  fill(255);
  text('the card is still beside the 🎹', 20, 30);
}
The gotcha: false is not 'off', so the card still appears.

Related

  • 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.
  • scope Whether scope() draws its oscilloscope in the corner of the page: on or off. hints=off turns it off too.
  • debug Prints [oav-p5 debug] lines in the console about clicks, the 🎹 button and loading, for finding out why the 🎹 does not respond.
  • 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.

p5/oav-p5.js, line 1104

↑ Back to top · All names