Csound Csound-dev Csound-tekno Search About

[Csnd] Pitch detection with Csound WASM

Date2026-10-09 17:03
FromIain Duncan
Subject[Csnd] Pitch detection with Csound WASM
Hi folks, I'm hoping to use Csound for some real-time pitch detection as that is what I already do in Max. In that context, I have csound output control values to a control channel, which I pipe into Scheme where I do all the actual note detection heuristics (e.g. "for how long on a pitch should we wait to consider stable", etc).

I'm wondering if anyone has done this with Csound WASM successfully and if so, what you settled on. Specifically I'm wondering if polling the csound object from JS works adequately, or whether this is the kind of thing where I should roll up my sleeves and be using the low level libcsound from my own WASM worker - I have done that level of wasm audio coding in C/C++ before, but it would be nice to avoid it if I don't need to. 

I suppose for best latency and performance the ultimate root is doing the heuristics in C in a custom audio worklet, but I would be fine with a "good enough" solution for now as I'm not sure yet how good I really need the performance and latency to be.

Pointers and links to examples most welcome!

thanks!

Iain Duncan
Interdisciplinary PhD Candidate, Computer Science & Music
University of Victoria, Canada


Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here