OAVp5.chop.module#
variableoav-p5OAVp5.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/chopfor sketches and shows that do not go through oav-p5.
Examples
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);
}Related
OAVp5.chop.stateWhere the @openav/chop module is:'off','loading','on'or'error'.OAVp5.chopThe CHOP functions under one roof, plus the state of the module behind them:OAVp5.chop.lag(…),.state,.slots(),.reset().