Skip to content

Waveshaper curve interpolation algorithm incorrect #2192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rtoy opened this issue Apr 17, 2020 · 0 comments
Closed

Waveshaper curve interpolation algorithm incorrect #2192

rtoy opened this issue Apr 17, 2020 · 0 comments
Assignees

Comments

@rtoy
Copy link
Member

rtoy commented Apr 17, 2020

Describe the issue

See https://webaudio.github.io/web-audio-api/#dom-waveshapernode-curve which says, in part:

y = (1-f)*c[k] + f*c[k]

If you expand this out you get 1.

I think the formula should be

y = (1-f)*c[k] + f*c[k+1]

When v is just slightly larger than k, f = v-k which is small, so we want most of the contribution to be from c[k], and very little from c[k+1].

@rtoy rtoy added Needs Discussion The issue needs more discussion before it can be fixed. Untriaged labels Apr 17, 2020
@padenot padenot added Needs Edits Decision has been made, the issue can be fixed. https://speced.github.io/spec-maintenance/about/ and removed Needs Discussion The issue needs more discussion before it can be fixed. Untriaged labels Apr 23, 2020
rtoy added a commit to rtoy/web-audio-api that referenced this issue Apr 24, 2020
Change `(1-f)*c[k] + f*c[k]` to `(1-f)*c[k] + f*c[k+1]`
@rtoy rtoy added In PR Review and removed Needs Edits Decision has been made, the issue can be fixed. https://speced.github.io/spec-maintenance/about/ labels Apr 28, 2020
@rtoy rtoy self-assigned this Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants