mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-23 21:47:16 -04:00
add csaw
This commit is contained in:
@@ -0,0 +1 @@
|
||||
csaw
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <math.h>
|
||||
#include <emscripten.h>
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
double saw(double t, double f) {
|
||||
return fmod((f * t * 1.0), 1.0) - 0.5 * 2.0;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
@@ -5,7 +5,8 @@ document.getElementById('play').addEventListener('click', async () => {
|
||||
await ac.audioWorklet.addModule('./worklet.js');
|
||||
const node = new AudioWorkletNode(ac, 'saw-processor');
|
||||
|
||||
let res = await fetch('./zigsaw/zigsaw.wasm');
|
||||
//let res = await fetch('./zigsaw/zigsaw.wasm');
|
||||
let res = await fetch('./csaw/csaw.wasm');
|
||||
//let res = await fetch('./rustsaw/pkg/rustsaw_bg.wasm');
|
||||
const buffer = await res.arrayBuffer();
|
||||
node.port.onmessage = (e) => {
|
||||
|
||||
Reference in New Issue
Block a user