Files
Mario Faúndez Vidal 5c91e2a9cf Web editor: local firmware audio preview and inline sequence editing
Run the existing DSP and sequencer in WebAssembly for the mock editor.
Keep playback controls compact, with an expandable piano and editable
sequence, a visual note picker, and per-sound drum lanes.

Add native/WASM audio comparisons and protocol/playhead regressions,
optional site assets and caching, and local build/run documentation.
2026-10-11 21:11:25 -03:00

24 lines
1001 B
C

/* SPDX-License-Identifier: GPL-3.0-only */
/* Same browser adapter on the host, for sample-by-sample WASM comparisons. */
#include <stdio.h>
#define __attribute__(x)
#include "../firmware/host/preview.c"
int main(void)
{
int32_t config[4 + P_COUNT + G_COUNT];
if (fread(config, sizeof config, 1, stdin) != 1) return 1;
preview_init();
preview_render(); /* the adapter obtains its initial output buffer before syncing */
preview_track(0, config[0], config[1]);
for (uint32_t i = 0; i < P_COUNT; i++) preview_param(0, i, config[4 + i]);
for (uint32_t i = 0; i < G_COUNT; i++) preview_global(i, config[4 + P_COUNT + i]);
if (fread(transfer, FM6_PACKED, 1, stdin) != 1) return 1;
preview_fm6(0);
preview_note(0, config[2], 1);
for (uint32_t i = 0; i < (uint32_t)config[3]; i += CTL) {
if (i == (uint32_t)config[3] / 2u) preview_note(0, config[2], 0);
if (fwrite(preview_render(), sizeof output, 1, stdout) != 1) return 1;
}
return 0;
}