open-audiovisual
Search GitHub

oav-p5 reference · Loading options

strudel#

optionoav-p5
?oav_strudel=auto | on | off

Whether oav-p5 treats the page as Strudel, the live-coding editor, and behaves politely beside it: auto, on or off.

Strudel is a live-coding editor, not a sketch, so a few things change when oav-p5 sees it: the names Strudel owns (note, velocity, beat) are left alone and one card says what to read instead, MIDI is asked for by Strudel's own midin() rather than at load (hardware becomes click), the 🎹 panel becomes the compact box, and the 🎹 sits above Strudel's side-panel buttons. oav-p5 only looks at the address and at the names on the page: nothing of Strudel is called.

on forces this behaviour on any page, off forces the plain one even on strudel.cc. Settings you give yourself (hardware, compact) still win over what Strudel mode would choose.

Type
String
Values
auto | on | off
default
auto

auto means on strudel.cc, or on a page where Strudel's own functions (note() and s() with stack() or samples()) are already there. Anything else means auto.

Notes

  • Set it before oav-p5 loads. window.OAV_P5 = { strudel: … }; above the loader line wins, then ?oav_strudel=… on the page address, then ?strudel=… 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_strudel=… (the project's README says OpenProcessing forwards it to the sketch).

Examples

jsOpenProcessing ↗
window.OAV_P5 = { strudel: 'on' };

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

function draw() {
  background(20);
  fill(255);
  text('hardware: ' + OAVp5.options.hardware, 20, 30);   // click: Strudel asks for MIDI itself
  text('compact panel: ' + OAVp5.options.compact, 20, 60);   // true
}
On an ordinary page, strudel on switches to Strudel's manners: Web MIDI is not asked for at load and the panel will be the compact box.

Related

  • hardware When oav-p5 asks the browser for Web MIDI, which a real controller needs: auto at load, click when the 🎹 panel opens, or off.
  • compact Shows the 🎹 panel as a small box in the corner, a third of the window high, instead of a full-width bar: on or off.
  • link Joins a room: oav-p5 pages with the same room hear what each other's programs play, over the relay. A room name, or empty for none.
  • clock Whether an external MIDI clock (from a DAW, Strudel or a drum machine) moves drumPhase, drumBpm and the drum machine: follow or off.
  • OAVp5.clock What oav-p5 hears of an external MIDI clock: its state, tempo and where it is in the bar. Nothing until another program or device starts sending one.

p5/oav-p5.js, line 148

↑ Back to top · All names