nnirror/facet

Feature: user-set variables / system-level variables improvements

Closed this issue · 2 comments

  • When a user sets a variable via .set(), remove any previously-set variables with same name.
  • Separate into two separate files the "user-set" variables (which can potentially be expensive, containing multiple seconds of audio) from the system-level variables (which should be updated very frequently, e.g. every ~20ms): env.js and patterns.js.
  • patterns.js would update as part of the callback in pattern_generator:js:run(), when this condition is true: if ( fp.variables_to_set.length > 0 ) {
  • make sure all places that env.js is loaded now load both files

Also, before writing env.js, check if any variables have actually changed before writing to prevent useless CPU overhead

Added in: 9b21c3e