shorepine / amy

AMY - the Additive Music synthesizer librarY

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linux audio and WASM audio output frequencies are out-of-tune

octetta opened this issue · comments

Via my Fender phone tuning app:

  • amy-message with v0w0n69l1 on Linux + miniaudio shows 440.1 Hz
  • amy.wasm (via a web app I've yet to generate a PR for) with v0w0n69l1 on Linux + FireFox 110.1 shows 479.0 Hz

I'll hook up a scope to get a more accurate numbers, and can test on other browsers and platforms for metrics

If this is an unavoidable consequence of using amy.wasm might we introduce a global tuning parameter akin to the global volume setting?

Happy to keep helping, as I'm quite intrigued with AMY.

Amy’s timing depends on the audio sample rate. It sounds like the wasm is writing to a 48kHz DAC. Can you control that?

Oh my gosh, the ratio the two should have been my first clue on this... I'll look at this closer, but think you've found the root cause.

I bet in index.html in the example, you could set AudioContext up with a sample rate. You should force it to whatever AMY's SAMPLE_RATE is.

Thanks for the tips.

I'm hacking at index.html and trying to understand more about what's happening inside web audio.

Brian accepted the change.