View Single Post
Old 07-08-2019, 04:28 PM   #16
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

Quote:
Im definitely gonna try some other formulas with this. Is there a JS with a simple anti-aliasing filter I can look at?
So there are a few ways to anti-alias, one is doing what I showed you above, partially linearizing a waveshaper. There are a few different techniques for anti-aliasing. One of those is oversampling (quite possibly one of my favorite topics ever), and another is using continuous time convolution, which I saw sai'ke talk about sometime recently. I am a newcomer to that, I'm all about the oversampling using a FIR (aka Nyquist, L-th band, or quarterband/halfband depending on the specific type).

The super quick explanation to oversampling is that more distortion creates more harmonics. Too many harmonics and they "fold over" the Nyquist limit and this is what causes aliasing. Higher samplerates mean more frequency space for those harmonics before they fold over. So, oversampling temporarily raises the samplerate while you're doing your nonlinear stuff so you can filter out the unwanted stuff when you return to your normal samplerate. It can mean double, quadruple, or even more CPU load, but it is a valid technique as long as your methods are good and your functions aren't too CPU-heavy.

If you want to go that direction we can, I don't want to overwhelm you when you're just getting the hang of things. If you look up Tale's plugin pack you can look at his oversampling code and that might help, I have plugins where I've used a similar methodology. The continuous time convolution stuff is super cool, but it's most effective when the two methods are used together.

Anyways, here's the link to Tale's pack, you can look at the source code. I've basically taken his approach and run with it... I actually included oversampling in the plugin I just wrote, the transient x lowpass plug, so that should be more than enough to go by, both a simple example and a "real world" example.

https://www.taletn.com/reaper/mono_synth/#os

https://stash.reaper.fm/v/36681/translow.txt (still in beta)

Quote:
One other thing Ive been looking at and youve touched on is treating positive and negative values differently. But for the purpose of making a mono-to-stereoizer. So essentially splitting the mono signal in +/- and processing them differently in the left channel. Then doing the exakt opposite of that for the right channel.
I don't think waveshapers alone are going to make very potent stereoizers because they don't really change anything about the underlying sound, they just have different harmonics added. Someone posted a technique recently that I was looking at that seemed really interesting, it was mono-compatible even... might have been sai'ke, I'd have to look to figure it out. Something about opposing allpass filters or some such. That's the direction I'd look if you're thinking about creating fake stereo.
SaulT is offline   Reply With Quote