Skip to main content

Module wasm_api

Module wasm_api 

Source
Expand description

SubstrateEngine — Monomorphized API for WASM consumption.

This module pins all generic substrate operations to concrete types so the wasm-bindgen boundary only sees f32/u32/String. The engine owns its atom buffer and exposes a tick-witness-extract loop:

JS: create → set embeddings → tick(audio) → read witness → extract sematon

No wasm-bindgen dependency here — that lives in terminals-wasm.

Structs§

SubstrateEngine
The substrate engine: N atoms, a layout, and physics parameters. Single-owner — WASM is single-threaded so this is safe as a JS-side object.