open-audiovisual
Search GitHub

oav-p5 reference · Loading options

linkdelay#

optionoav-p5
?oav_linkdelay=0 to 2000 (milliseconds)

Extra milliseconds of buffer on the notes a linked page receives, to smooth out an uneven network: 0 to 2000.

Only matters together with link: without a room nothing is received. Each note arriving from another page is played at the moment it sounded there, which already allows for the trip. linkdelay adds this much on top, so a note that took longer than usual is still on time. The price is that everything from the other page arrives that much later.

Type
Number
Values
0 to 2000 (milliseconds)
default
0

Held between 0 and 2000. Anything that is not a number is 0.

Notes

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

Examples

jsOpenProcessing ↗
window.OAV_P5 = { linkdelay: 80 };

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

function draw() {
  background(20);
  fill(255);
  text('linkdelay: ' + OAVp5.options.linkdelay + ' ms', 20, 30);
  text('link: ' + (OAVp5.link.info ? 'room ' + OAVp5.link.info.room : 'no room, so nothing to delay'), 20, 60);   // add link: 'my-room' to use it
}
Without a link room the number is only stored: the sketch says there is nothing to delay. Add link: 'my-room' to the options and it applies to every note that arrives.

Related

  • 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.
  • OAVp5.link.info The state of the link: its room, state (connecting, open, closed), how many other pages are there, and the trip time. null when no room is set.
  • relay The address of the relay that phones and link rooms talk through: a WebSocket URL.

p5/oav-p5.js, line 157

↑ Back to top · All names