Skip to content

Neuroscript Engine (JavaScript) ​

Use the WASM engine to power interactive docs and playgrounds that compile and run Neuroscript directly in the browser.

  1. Build the WASM package with wasm-pack.
  2. Load the package with your bundler.
  3. Use WasmEngine for compile + run loops, or compile_only for validation-only flows.

For docs usage, copy the built package into docs/web/public/neuroscript-wasm so VitePress can serve it as a static asset.

Minimal playground loop ​

javascript
import init, { WasmEngine } from "neuroscript-wasm";

await init();

const engine = new WasmEngine(sourceEditor.value);

function run(event) {
  return engine.runEvent(event, { bpm: 120, beat: 4_000_000 }, Date.now() * 1_000_000);
}

Learn more ​

Built with ❤️ for musicians