-
Notifications
You must be signed in to change notification settings - Fork 166
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
Add an way to request mathematically correct oscillators #244
Comments
You mean, an aliased version of the oscillators? Why would anyone want that for audio? |
This is the whole point. Nobody wants it for audio, but people want it for when an OscillatorNode is fed into an AudioParam. |
Well, you still don't want aliasing in the case the oscillator node is being fed into an audio param at audio rates. I think maybe a better way to word this same complaint is to say that low-frequency oscillators have to include high-frequency partials. This could manifest itself as implementors using naive oscillators below a certain frequency. I think needlessly complicating the API with an "aliasing" mode doesn't help much and may incorrectly encourage users to introduce aliasing to their designs. |
I'd like to disagree even with the claim that no one wants it for audio as it's essential for example for modeling old synthesizers, e.g. the JP-8000 and its legendary "supersaw" waveform. Aliased oscillators also yield in a way more interesting sounds when combined with low-pass filters than anti-aliased oscillators would, especially for high-Q synth sounds, as the high frequency partials will excite the filter. |
On Oct 1, 2013 2:26 AM, "Russell McClellan" notifications@github.com
|
On Oct 1, 2013 2:22 AM, "Paul ADENOT" notifications@github.com wrote:
|
On Sep 30, 2013 8:01 PM, "Paul ADENOT" notifications@github.com wrote:
|
Here is a proposal: padenot@ff13d62, or http://padenot.github.io/web-audio-api/#band-limiting. |
Just a couple of observations: The term "mathematically accurate" refers to, I assume, the enumeration First of all, it is not entirely clear how OscillatorType=="custom" is Secondly, I think that the original idea/implementation of the /Marcus 2014-02-17 14:20, Paul ADENOT skrev:
Marcus Geelnard |
On 17/02/2014 14:36, opera-mage wrote:
I think we can make it so that setting bandLimited to false when using a
Well, yes, but only if .bandLimited is false, which is not the default. Paul. |
Those predefined waveforms aren't actually implemented as infinite bandwidth signals, at least in the WebKit implementation. Instead they're implemented as PeriodicWaves, IIRC where
|
While I'm a little embarrassed at the harsh tone of my previous two comments upon rereading, I still don't like this feature. First, I think using the term "mathematically accurate" is a little confusing, since you are in fact adding artifacts to the mathematical ideal - perhaps "with aliasing artifacts left in" would be a bit more explicit and understandable. Second, I'd like to hear a rationale on why it would be better for applications when an oscillator is connected to an AudioParam. If there are any audible ripples, that is a sign that the implementation is buggy and does not contain enough high frequency partials. I think if you're worried about the LFO use case, you should just add language in the spec that says the oscillators have to be accurate even at low frequencies. This way, users wouldn't have to be concerned about setting an extra flag correctly and instead everything would just work. I do take Jussi's point that aliasing can be useful and wonderful as a special effect (in fact, I wrote an article on that topic in 2011), but I still think that this feature is fringe enough that those who want it can use a scriptprocessor or audio buffer with looping. |
Well, I just wanted to understand the suggested solution and what implications it might have. I see your point: we'd simply add a second mode of operation for the predefined wave forms, so that: bandLimited -> Use the corresponding PeriodicWave (this should probably be defined clearly in the spec somehow). IMO it would be nice if the predefined wave forms were defined in terms of a PeriodicWave when bandLimited == true (e.g. define the elements of the discrete real/imag arrays using mathematical formulas) - similar to what Jussi explained. Let's put that in the spec. |
On 17/02/2014 15:54, opera-mage wrote:
We can certainly do so, but we should talk about that in the appropriate |
My proposal is at padenot@7c83c01 |
I'm not clear on the need here. Even if samples are set to the corresponding points on the continuous Even if only used as sources for AudioParams, on a gain node for example, It sounds like what is wanted here is a "discrete" signal that is not an |
I'm not in support of this. This does not address the amplitude normalization (which is necessary to avoid clipping). |
This is a niche use case which can be covered by the Audio Worklet. Closing. |
When using an OscillatorNode as an LFO, it can be useful to get rid of the ripples inherent to high frequency limiting to get precise modulation.
This issue is about designing an API to request mathematically correct oscillator, and define them using a mathematical definition (in terms of phase, waveform shape and peak amplitude).
The text was updated successfully, but these errors were encountered: