opc#
optionoav-p5?oav_opc=on | off
Whether oav-p5 wires the controller to the variables of OP Configurator (OpenProcessing's sliders and buttons): on or off.
On OpenProcessing, OPC.slider('radius', 10) declares a variable with a slider. With opc on, oav-p5 then wires the controller to the OPC variables in order: knob 1 to the first slider, knob 2 to the second, the faders after the knobs, pad 1 to the first toggle or button. OPC's own panel moves with the knob. OAVp5.wiring() lists who drives what.
off leaves OPC's variables to their own sliders. A control the sketch reads itself (knob1 in draw()) is the sketch's anyway: the slider at that place stops following it.
- Type
String- Values
on | off- default
on
Only off turns it off.
Notes
- Set it before oav-p5 loads.
window.OAV_P5 = { opc: … };above the loader line wins, then?oav_opc=…on the page address, then?opc=…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_opc=…(the project's README says OpenProcessing forwards it to the sketch).
Examples
window.OAV_P5 = { opc: 'off' };
function setup() {
createCanvas(400, 300);
}
function draw() {
background(20);
fill(255);
text('opc option: ' + OAVp5.options.opc, 20, 30);
text('controls wired to OPC variables: ' + OAVp5.wiring().length, 20, 60); // 0
}opc: 'off' and the number of sliders and buttons without it.To be confirmed
Not tried with OpenProcessing's real OPC library. The wiring was checked against a stand-in object with the same options shape, and the example here runs where no OPC exists, so it only shows the option arriving.
Related
OAVp5.wiring()Lists which controller knob, fader or pad drives which OpenProcessing OPC variable right now:[{ control: 'knob1', name: 'radius' }, …].knob1The position of a controller knob, from 0 to 1:knob1is the first knob,knob2the second, up toknob8.knob()Returns the position of knob numbern, from 0 to 1: the same asknob1toknob8, for anyn.pad1How hard a drum pad is pressed, from 0 to 1:pad1is the first pad, up topad16; 0 when it is let go.