REF / Music API / WSLoader

Ascene . Agraph . Aengine . Anode
Songbook . Song
WSLoader . Sound Loaders
Random . Rhythm . TimeKeeper
MIDI . OSC . HID . Piano
Plot . Envelope . Util
Music Theory with Tonal

right-click to navigate to page sections


The WSLoader API is a JavaScript API for asynchronously loading and saving files in your workspace. These three functions reside in the global namespace.

Loader API

Accessing Data

Function Description
async FetchWSFile(filenm, filetype="text") [1] Returns a promise that resolves to a data converted to the requested datatype. Use "binary" for binary files.
async SaveWSFile(filenm, verify=true) [1] Returns a promise that resolves to a fully-qualifed path under the current defintion of workspace.

Programming

Function Description
async Require(filenm) [1][2] Loads filenm into the JS sandbox, performs it and returns module contents.

[1] filenm is workspace-relative, eg: "_plugins/anode.yaml"
[2] require-compatible module must assign its contents to the global object exports