skode/transport/wasm

WebAssembly transport for communicating with the embedded Skred / Pulp audio engine in JavaScript.

Interacts directly with the WebAssembly C-API (_skred_start, skred_command, skred_log, _skred_stop) exposed by skred_api.js and skred_api.wasm.

Values

pub fn exec(command: String) -> Result(String, String)
pub fn exec_chunk(chunk: skode.Chunk) -> Result(String, String)

Execute a single AST Chunk, returning engine output.

pub fn exec_ops(ops: List(skode.Op)) -> Result(String, String)

Execute a list of AST Ops canonically formatted, returning engine output.

pub fn exec_program(
  program: List(skode.Chunk),
) -> Result(String, String)

Execute an entire AST program (List(Chunk)), returning engine output.

pub fn is_available() -> Bool
pub fn send_chunk(chunk: skode.Chunk) -> Result(Nil, String)

Send a single AST Chunk to the WASM engine.

pub fn send_ops(ops: List(skode.Op)) -> Result(Nil, String)

Send a list of AST Ops canonically formatted to the WASM engine.

pub fn send_program(
  program: List(skode.Chunk),
) -> Result(Nil, String)

Send an entire AST program (List(Chunk)) to the WASM engine.

pub fn send_text(command: String) -> Result(Nil, String)
pub fn start(frames: Int, voices: Int) -> Result(Nil, String)
pub fn start_default() -> Result(Nil, String)
pub fn stop() -> Nil
✨ Search Document