OAVp5.chop#
objectoav-p5OAVp5.chop
The CHOP functions under one roof, plus the state of the module behind them: OAVp5.chop.lag(…), .state, .slots(), .reset().
Every function of this group is also here: OAVp5.chop.lag, .env, .trigger, .speed, .spring, .trail, .slope, .count, .scope and .drawTrail are the same functions as the plain names, for a sketch whose own speed or count keeps the plain name.
The rest is for looking inside: state says whether the module is loaded, module is the module itself, slots() lists every memory in use and reset() forgets them.
Notes
- This is advanced: a sketch that only calls
lag()and friends never needs it.
Examples
function setup() {
createCanvas(400, 300);
}
function draw() {
background(20);
const x = OAVp5.chop.lag(mouseX, 0.4); // the same as lag(mouseX, 0.4)
fill(255);
text('chop ' + OAVp5.chop.state + ', ' + OAVp5.chop.slots().length + ' memory in use', 20, 30);
circle(x, height / 2, 40);
}Related
lag()Followsvaluesmoothly instead of jumping: up inupseconds, down indownseconds (TouchDesigner's Lag CHOP).env()A 0..1 pulse that jumps up after each event (a kick, a beat, a key, a press) and then fades out: TouchDesigner's Trigger CHOP.OAVp5.chop.stateWhere the @openav/chop module is:'off','loading','on'or'error'.OAVp5.chop.slots()Lists every memory the CHOP functions are using right now: its kind, how it is found, and its latest value.OAVp5.chop.reset()Forgets the memory namedname(a lag, a speed total, a count …), or every memory when you give no name: the next call starts fresh.