open-audiovisual
Search GitHub

oav-p5 reference · The OAVp5 object (advanced)

OAVp5.link#

objectoav-p5
OAVp5.link

What the link to other oav-p5 pages in the same room is doing: only OAVp5.link.info, and null unless a room is set.

A link joins oav-p5 pages that share a room: what one page's programs play into OAV Virtual MIDI (notes, controllers and the clock) is heard by every other page in the room, at the moment it sounds there. You switch it on with ?oav_link=my-room, and OAVp5.link.info is where you look at how it is going. There is nothing else to call: the link is made and closed by the option.

Notes

  • This is advanced. It needs a network connection to the relay (relay).

Examples

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

function draw() {
  background(20);
  fill(255);
  text(OAVp5.link.info ? 'linked' : 'not linked: add link: \'my-room\' to the options', 20, 30);
}
Says whether this page is linked. Without a link room it is not, and the sketch says so.

Related

  • 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.
  • 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.
  • linkdelay Extra milliseconds of buffer on the notes a linked page receives, to smooth out an uneven network: 0 to 2000.
  • relay The address of the relay that phones and link rooms talk through: a WebSocket URL.

p5/oav-p5.js, line 882

↑ Back to top · All names