From 8d62af5c45411c596a7dc1e056297f5da8f9b253 Mon Sep 17 00:00:00 2001 From: Peter Salomonsen Date: Tue, 21 Mar 2023 22:17:50 +0100 Subject: [PATCH] play single voice directly --- templates/wasm/player.wat | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/templates/wasm/player.wat b/templates/wasm/player.wat index 9877d26..91ef6a0 100644 --- a/templates/wasm/player.wat +++ b/templates/wasm/player.wat @@ -968,6 +968,17 @@ ) {{- end}} +(func $update_single_voice (param $voice_no i32) (param $value i32) + (local $di i32) + (local.set $di ( + i32.add (i32.const {{index .Labels "su_voices"}}) + (i32.mul (i32.const 4096) (local.get $voice_no)) + )) + (memory.fill (local.get $di) (i32.const 0) (i32.const 4096)) + (i32.store (local.get $di) (local.get $value)) +) +(export "update_single_voice" (func $update_single_voice)) + {{template "patch.wat" .}} ;; All data is collected into a byte buffer and emitted at once