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
hintstoo:hints=offhides 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 inwindow.OAV_P5are turned into text, so write'off', notfalse. On OpenProcessing the page address takes?sketch_oav_scope=…(the project's README says OpenProcessing forwards it to the sketch).
Examples
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
}Related
scope()Showsvaluein 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 throughvalueson the canvas, so it is in the work and in a recording: the oldest atx,loat the bottom of the box,hiat the top.hintsWhether oav-p5 shows its explaining cards beside the 🎹 (blocked microphone, no Web MIDI, an error in your callback):onoroff.