open-audiovisual
Search GitHub

oav-p5 reference · Values over time (CHOP)

OAVp5.chop.module#

variableoav-p5
OAVp5.chop.module

The @openav/chop module itself once it has loaded, otherwise null: the classes and functions the CHOP functions are built on.

For reaching below the p5-style calls: OAVp5.chop.module.DEFAULTS lists the defaults the functions use, and new OAVp5.chop.module.Lag({ up: 0.1 }) makes a lag you keep yourself. Check it is not null first.

Type
Object | null

null until the first CHOP function has been called and the module has arrived, then the module (Lag, Spring, Trail, envelope(), DEFAULTS and the rest).

Notes

  • This is advanced. The module is also published as @openav/chop for sketches and shows that do not go through oav-p5.

Examples

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

function draw() {
  background(20);
  lag(mouseX, 0.3, 0.3, 'warm-up');   // the first call loads the module
  const m = OAVp5.chop.module;
  fill(255);
  text(m ? 'spring defaults: ' + JSON.stringify(m.DEFAULTS.spring) : 'not loaded yet', 20, 30);
}
Prints the spring defaults from the module as soon as it has loaded.

Related

  • OAVp5.chop.state Where the @openav/chop module is: 'off', 'loading', 'on' or 'error'.
  • OAVp5.chop The CHOP functions under one roof, plus the state of the module behind them: OAVp5.chop.lag(…), .state, .slots(), .reset().

p5/oav-p5.js, line 2871

↑ Back to top · All names