- From: André Michelle <andre.michelle@audiotool.com>
- Date: Mon, 6 Mar 2017 21:30:25 +0100
- To: public-audio-dev@w3.org
- Message-Id: <4CED55CB-FD22-46D8-BC34-8266A4537CC7@audiotool.com>
Hi all, I am developing a bandlimited oscillator for our synthesiser in www.audiotool.com and could not get it quite right. I tested the web-audio-api as a reference and voila: There is alias as well. http://jsbin.com/xebozar/edit?js,output <http://jsbin.com/xebozar/edit?js,output> I downloaded the sources from here to reimplement it in Java to find the problem. https://github.com/WebKit/webkit/blob/master/Source/WebCore/Modules/webaudio/OscillatorNode.cpp <https://github.com/WebKit/webkit/blob/master/Source/WebCore/Modules/webaudio/OscillatorNode.cpp> https://github.com/WebKit/webkit/blob/master/Source/WebCore/Modules/webaudio/PeriodicWave.cpp <https://github.com/WebKit/webkit/blob/master/Source/WebCore/Modules/webaudio/PeriodicWave.cpp> My port produces the exact same amount of alias at the same frequencies. The code in "PeriodicWave::waveDataForFundamentalFrequency" obviously chooses a table with too much harmonics but I could not find a fix and an obvious error. I could however replace the look-up code for a test, that it always returns the tables with just a single harmonic (sine-wave) and the alias is gone. That means that the wavetable size is big enough and the linear interpolation is working well. Any thoughts on this? ~ André Michelle http://www.audiotool.com
Received on Monday, 6 March 2017 20:30:54 UTC