Feature: user-set variables / system-level variables improvements
Closed this issue · 2 comments
nnirror commented
- 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
andpatterns.js
. patterns.js
would update as part of the callback inpattern_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
nnirror commented
Also, before writing env.js, check if any variables have actually changed before writing to prevent useless CPU overhead