Skip to content
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

Implementing oversampling in plug-ins. #3605

Open
husamalhomsi opened this issue Jun 3, 2017 · 9 comments
Open

Implementing oversampling in plug-ins. #3605

husamalhomsi opened this issue Jun 3, 2017 · 9 comments

Comments

@husamalhomsi
Copy link
Member

husamalhomsi commented Jun 3, 2017

• Synthesizers:
When playing high notes on a synthesizer using a harmonically rich wave like a saw wave, there are probably some frequencies that will go above the nyquist frequency, so aliasing occurs.

Just play the note C8 on TripleOscillator using a saw wave to hear the aliasing noise.

My idea of the UI implementation is radio buttons in the plugin tab of each synthesizer offering oversampling factors in powers of 2.

• Effect plug-ins:
There are 2 types of plug-ins that would benefit from using oversampling (as far as I know).

(1) Waveshapers, distorters, overdrivers, bitcrushers and Lo-fi effects (or anything that generates a lot of overtones).
When using any of the effects above on a sound, extra overtones are being added to it, and if these overtones go above the nyquist frequency, aliasing occurs.

Spectrum of a heavily waveshaped sine wave.
distorted sine wave
Spectrum of the same sound but with 16x oversampling.
distorted sine wave with 16x oversampling

My idea of the UI implementation is a slider in each of these plug-ins mentioned earlier offering oversampling factors in powers of 2.

(2) Equalizers.
When a band (of any type) in the equalizer gets close to the nyquist frequency, its shape distorts.

A normal low-pass filter at 1000 Hz looks like this:
lpf 1000 hz
The same filter but at 16000 Hz looks like this:
lpf 16000 hz

Using oversampling will prevent this distortion and improve audio quality, particularly at high frequencies.
My idea of the UI implementation is an off/on "Oversampling" button on each equalizer plug-in effect that uses a specific oversampling factor that is just enough to prevent the distortion without introducing excess CPU load.

@PaulBatchelor
Copy link
Contributor

Have you looked at the oversampling options in the export menu?

@husamalhomsi
Copy link
Member Author

husamalhomsi commented Jun 16, 2017

Have you looked at the oversampling options in the export menu?

Yes, but they don't even work at the moment, and even if they do work, they're on export only.

@grejppi
Copy link
Contributor

grejppi commented Jun 16, 2017

IIRC the Oscillator class has band-limited waveforms available, which are available in LB302 and Monstro, but they are not enabled for TripleOscillator.

@husamalhomsi
Copy link
Member Author

husamalhomsi commented Jun 16, 2017

IIRC the Oscillator class has band-limited waveforms available, which are available in LB302 and Monstro, but they are not enabled for TripleOscillator.

Band-limited waveforms are a good idea, but modulation of said waveforms could still cause aliasing.

@PaulBatchelor
Copy link
Contributor

This feature would require a lot of internal refactoring of the plugin and classes, as well as introduce new UI. It's a very tall order, but the code is there if you'd like to take a stab at it and make a PR. I'm not also entirely convinced that this would be an effective new feature. Oversampling is very much a brute-force approach to alias reduction. I'd be more keen on approaching more specific solutions to alias reduction for particular plugins and effects, rather than try cram a "one shoe fits all" feature. Or better yet, just build new instruments and effects that sound better.

@Rossmaxx
Copy link
Contributor

Oversampling is gone entirely since #7228

@Rossmaxx
Copy link
Contributor

@sakertooth close?

@zonkmachine
Copy link
Member

Oversampling is gone entirely since #7228

The description of that PR says should really be an option on a per-plugin basis, which this issue is all about. If someone want's to implement oversampling in a plugin or two, why not?

@Rossmaxx
Copy link
Contributor

Oops, another misread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants