Metaprogramming Strategies for AudioWorklets
summary
Ports Genish.js and Gibberish.js from ScriptProcessor to AudioWorklets and demonstrates a working approach that mirrors state across threads using ES6 Proxy objects, with sequencing and scheduling moved into the audio thread so modulation can run at audio rate. Property changes and the last computed values are batched per block and sends block updates back to the main thread for visualization. Function passing fails for closures—function serialization loses closures—so dynamic live‑coding patterns remain unresolved. SharedArrayBuffer may simplify some work.
AI-written summary · about
chapters (9)
- 0:00Introduction to audio worklets
- 1:25Script processor node limitations
- 2:29Porting libraries to audio worklets
- 3:33Simple porting with Genish
- 4:59State synchronization challenges
- 7:51Closure serialization issues
- 10:02Live coding in Gibber
- 12:53Performance and latency notes
- 13:15Conclusion and future work
related talks
25mAn AudioWorklet-based Signal Engine
08mBuild WebAudio And JavaScript Web Application Using JSPatcher: A Web-Based Visual Programming Editor
47mGibbering at Algoraves - JS in Live Audiovisual Performances
23mAudio and Video Manipulation
40mScalable JavaScript architecture
28mThe App-Changing Magic (and Joy) of Web APIs
36mMulti-thread demystified
50mMetaprogramming in JavaScript
