Re: Interpolation on WaveShaperNode?

On Wed, May 15, 2013 at 4:45 PM, Chris Rogers <crogers@google.com> wrote:

>
>
>
> On Mon, May 13, 2013 at 3:27 PM, Ehsan Akhgari <ehsan.akhgari@gmail.com>wrote:
>
>> On Mon, May 13, 2013 at 3:09 PM, Chris Rogers <crogers@google.com> wrote:
>>
>>>
>>>
>>>
>>> On Mon, May 13, 2013 at 11:32 AM, Ehsan Akhgari <ehsan.akhgari@gmail.com
>>> > wrote:
>>>
>>>> FWIW, in Gecko, I'm implementing linear interpolation by default.
>>>>
>>>
>>> Good, I think that's what we should do for the default, but we could
>>> consider an attribute "linear" or "nearest-neighbor" to select the
>>> interpolation method.  On the other hand, it's pretty easy to create the
>>> "bit-crushing" effects even with linear interpolation as long as the table
>>> size is suitably large, so maybe all we need is linear.
>>>
>>> WebKit/Blink are not doing the linear interpolation, so that'll have to
>>> change.
>>>
>>
>> Sounds good.  Can you please spec this as well?
>>
>>
>>> By the way, I've been looking in some detail about how to implement a
>>> "high-quality" mode for the shaper, which up-samples the signal to a higher
>>> sample-rate (2x, in the simple case), does the shaping, then down-samples
>>> back down to the node sample-rate.  This type of processing is important
>>> for guitar amp simulation and other simulation of analog gear to avoid the
>>> harsh aliasing.  I think the default mode of operation for the shaper
>>> should not do this up-sampling, but that it would be good to opt-in by
>>> having a .quality attribute.
>>>
>>
>> Are you planning to add the quality attribute right now, or wait for a
>> "post-v1" spec?
>>
>
>  I think it's important to get in as soon as possible, because developers
> are already trying to use the WaveShaperNode for more serious pro-level
> purposes and are bumping up against the quality issues:
> http://dashersw.github.io/pedalboard.js/demo/
>

Hmm, looks like this demo uses webkitAudioContext, so hard to say how it
sounds in Firefox which already does linear interpolation.


> I actually wrote a pretty good first pass at the up-down-sampling code
> yesterday, and was able to test it at a basic level.  This is low-level
> "blitter" code which I'm happy to share with Mozilla.
>

Cool.  At this stage I'm more interested to see the spec changes to be
honest -- hopefully it's clear enough that we can implement it without the
need to borrow code, but of course I don't mind looking at the code you
have too!  :-)

Cheers,
--
Ehsan
<http://ehsanakhgari.org/>

Received on Wednesday, 15 May 2013 22:37:34 UTC