Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 09-27-2015, 10:22 PM   #1
DJ Saint-Hubert
Human being with feelings
 
Join Date: Jan 2013
Posts: 257
Default soft distortion/saturation with theoretically infinite sidechaining

https://stash.reaper.fm/v/25241/mathshaper.txt

this version has 8 sidechains but from the sound of it you can probably repeat the process forever to the next power of 2 (so 16,32,64 sidechains), if you really wanted to

it ironically likes graphic waveshaping on the sidechain more than EQ, since it's comparing phase or something like that. Maybe somebody with some knowledge of trig functions could explain what's going on better

again for the insane who would actually try more sidechains, you could hack something together with two instances/freezing tracks if your comp isn't fast enough

Edit: again if anybody knows if there are other trig functions that can take 2 arguments like atan2 let me know, I'd love to mess with it

Edit: oops uploaded the wrong script

Edit: Still was the wrong script, deleted until I figure out why

Last edited by DJ Saint-Hubert; 09-28-2015 at 11:04 AM.
DJ Saint-Hubert is offline   Reply With Quote
Old 09-28-2015, 09:27 AM   #2
DJ Saint-Hubert
Human being with feelings
 
Join Date: Jan 2013
Posts: 257
Default

https://stash.reaper.fm/v/25252/tanh8.txt

another idea in the same vein
DJ Saint-Hubert is offline   Reply With Quote
Old 09-28-2015, 11:05 AM   #3
DJ Saint-Hubert
Human being with feelings
 
Join Date: Jan 2013
Posts: 257
Default

https://stash.reaper.fm/v/25254/tanh12.txt
DJ Saint-Hubert is offline   Reply With Quote
Old 09-28-2015, 01:44 PM   #4
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

What does "sidechain" mean in this context? I don't see any inputs being pulled from other channels, or any options to do so.

Have you graphed out any of the outputs to this code? Some of the functions look like they break pretty easily... cot(x) is infinite at 0 and multiples of pi, for instance.

I graphed out the input functions you're feeding into tanh.

tanh(drive*((2*y)*(sqrt(x^2+y^2)+1)));

https://www.desmos.com/calculator/rks7amsww4

As you can see, if y is outside of +/- 0.5 then it pegs the output to +/- 1, if y is 0 then the output is zero, and any non-zero y gives a ton of DC. So, I dunno.

Can you give a little more insight into this code?
SaulT is offline   Reply With Quote
Old 09-28-2015, 02:00 PM   #5
DJ Saint-Hubert
Human being with feelings
 
Join Date: Jan 2013
Posts: 257
Default

Quote:
Originally Posted by SaulT View Post
What does "sidechain" mean in this context? I don't see any inputs being pulled from other channels, or any options to do so.

Have you graphed out any of the outputs to this code? Some of the functions look like they break pretty easily... cot(x) is infinite at 0 and multiples of pi, for instance.

I graphed out the input functions you're feeding into tanh.

tanh(drive*((2*y)*(sqrt(x^2+y^2)+1)));

https://www.desmos.com/calculator/rks7amsww4

As you can see, if y is outside of +/- 0.5 then it pegs the output to +/- 1, if y is 0 then the output is zero, and any non-zero y gives a ton of DC. So, I dunno.

Can you give a little more insight into this code?

weird... it works fine for me, tanh12() at least. It even graphs out the exact code at the bottom. Then again I'm /under/driving the sidechains and the makeup code figures out how much to boost it

also you can see I commented out some sign() code because it retains the sign unlike the graph on the website

as for cot() etc., I just had those functions in case I needed them. All it uses is sqr sqrt and tanh. Again like I said the graph is exactly how the sound is being transformed

Maybe I'll adjust the default values to something like -60 db?

you could sidechain it by changing spl0 to spl2 spl4 etc., but I'm getting enough mileage out of it by just driving the original signal different amounts

edit: updated it so the default drive for all channels is -60, so there's virtually no possibility of it exceeding +/-0.5 unless you're doing something weird

edit: doh you have to DIVIDE by sqrt(blahblahblah)

http://www.wolframalpha.com/input/?i...9%2B1%29%29%29

there it was (substituting a constant for drive and (x*4) for a)

Last edited by DJ Saint-Hubert; 09-28-2015 at 02:23 PM.
DJ Saint-Hubert is offline   Reply With Quote
Old 09-29-2015, 08:50 AM   #6
DJ Saint-Hubert
Human being with feelings
 
Join Date: Jan 2013
Posts: 257
Default

argh. I fixed everything, it's now two arguments so you can change the inputs with an XY interface. Also it seems to work better anyway. There is also a lot of visual input to figure out if you're gaining headroom or not

https://stash.reaper.fm/v/25264/tanh12.txt
DJ Saint-Hubert is offline   Reply With Quote
Old 09-30-2015, 09:48 AM   #7
DJ Saint-Hubert
Human being with feelings
 
Join Date: Jan 2013
Posts: 257
Default

I made a FuncShaper preset that does more or less the same thing but faster, enough to oversample quite a few times. Also included is a 'diff' version which returns the difference/amount of expansion instead which you could sidechain in reaper etc. and use it for dynamic EQ. Yes oversampling it should be similar to oversampling a compressor/expander
Attached Files
File Type: zip atanh2().zip (804 Bytes, 129 views)
DJ Saint-Hubert is offline   Reply With Quote
Old 09-30-2015, 11:07 AM   #8
SaulT
Human being with feelings
 
Join Date: Oct 2013
Location: Seattle, WA
Posts: 876
Default

You zipped these in XML? Am I missing something, is this a feature in Reaper 5 that I didn't know about?
SaulT is offline   Reply With Quote
Old 09-30-2015, 12:22 PM   #9
DJ Saint-Hubert
Human being with feelings
 
Join Date: Jan 2013
Posts: 257
Default

Quote:
Originally Posted by SaulT View Post
You zipped these in XML? Am I missing something, is this a feature in Reaper 5 that I didn't know about?
http://www.rs-met.com/freebies.html

use the plugin 4th down and load it in there

sorry for a non-JS plug. You can oversample it 16 times though which is pretty sweet
DJ Saint-Hubert is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.