open-audiovisual
Search GitHub

oav-p5 reference · Loading options

scope#

optionoav-p5
?oav_scope=on | off

Whether scope() draws its oscilloscope in the corner of the page: on or off. hints=off turns it off too.

With off, scope() draws nothing in the corner and only returns its value, so a sketch can leave its scope() calls in and hide the plot for a show. drawTrail(), which draws on the canvas, is not affected.

Type
String
Values
on | off
default
on

Only off turns it off.

Notes

  • If the plot does not show up, check hints too: hints=off hides it as well.
  • Set it before oav-p5 loads. window.OAV_P5 = { scope: … }; above the loader line wins, then ?oav_scope=… on the page address, then ?scope=… 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_scope=… (the project's README says OpenProcessing forwards it to the sketch).

Examples

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

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

function draw() {
  background(20);
  const wave = 0.5 + 0.5 * sin(frameCount * 0.05);
  circle(width / 2, height / 2, 40 + scope(wave, 'wave') * 200);   // returns wave, draws nothing
}
The circle still breathes, but there is no plot in the corner of the page. Delete the first line and it comes back.

Related

  • scope() Shows value in a small oscilloscope in the corner of the page and gives it back, so you can wrap any expression to watch it.
  • drawTrail() Draws a line through values on the canvas, so it is in the work and in a recording: the oldest at x, lo at the bottom of the box, hi at the top.
  • hints Whether oav-p5 shows its explaining cards beside the 🎹 (blocked microphone, no Web MIDI, an error in your callback): on or off.

p5/oav-p5.js, line 3098

↑ Back to top · All names