|
|
|
11-19-2021, 07:08 PM
|
#1
|
Human being with feelings
Join Date: Apr 2021
Posts: 26
|
Code to add to JS plug to reverse polarity
Is there some code I could add to a JS plugin to have the ability to reverse the polarity of the signal leaving the plugin? I would like it to be a feature I can toggle on & off somehow. Specifically I am looking to add this to a compressor plugin so the polarity can be reversed within the compressor as opposed to doing so with another plugin. I am not a coder, but I have done minor tweaking in JS plugins, so please respond with that in mind. Thanks!
|
|
|
11-19-2021, 07:41 PM
|
#2
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
Hi. It's very easy.
Add a slider (change the slider# as needed):
Code:
slider1:0<0,1,1{Normal,Inverted}>Polarity
In the @slider section make a variable called polarity, dependent on the slider you just added:
Code:
polarity = 1-2*slider1;
At the end of the @sample section, add this:
Code:
spl0 *= polarity;
spl1 *= polarity;
And that's it.
The signal leaving the JS plugin will be multiplied by 1 in Normal mode and -1 in Inverted mode.
|
|
|
11-19-2021, 10:06 PM
|
#3
|
Human being with feelings
Join Date: Apr 2021
Posts: 26
|
Wow! That does seem easy. Thanks!
|
|
|
11-20-2021, 02:16 AM
|
#4
|
Human being with feelings
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,031
|
Cool, waiting for your compressor now.
No matter, if you will share your end result here or not, have fun with Reaper and the music lovers here, my friend.
|
|
|
11-20-2021, 01:06 PM
|
#5
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
Quote:
Originally Posted by AxeMan2U
Wow! That does seem easy. Thanks!
|
NP. If it pops/clicks when changing polarity we can add a few lines to smoothly transition between states.
|
|
|
11-20-2021, 10:26 PM
|
#6
|
Human being with feelings
Join Date: Apr 2021
Posts: 26
|
Quote:
Originally Posted by ErBird
NP. If it pops/clicks when changing polarity we can add a few lines to smoothly transition between states.
|
No pops/clicks at this point. Now I've got two more questions:
Is there a way to change polarity on just the wet signal, leaving the dry signal as is?
Is there a complete list of JS parameters, etc. available somewhere?
Thanks!
|
|
|
11-21-2021, 08:52 AM
|
#7
|
Human being with feelings
Join Date: Dec 2012
Posts: 7,271
|
At some point in the code you must have the wet signal stored in some variable(s) separate from the dry. Multiply the wet one(s) by -1. At that point, though, you’ve duplicated the functionality of the new Delta Solo function that all plugins now get for free.
Does this help?
https://www.reaper.fm/sdk/js/js.php
|
|
|
11-24-2021, 10:26 PM
|
#8
|
Human being with feelings
Join Date: Apr 2021
Posts: 26
|
Quote:
Originally Posted by ashcat_lt
At some point in the code you must have the wet signal stored in some variable(s) separate from the dry. Multiply the wet one(s) by -1. At that point, though, you’ve duplicated the functionality of the new Delta Solo function that all plugins now get for free.
Does this help?
https://www.reaper.fm/sdk/js/js.php
|
I can't figure out how to get this to work. There's something about the way splitting & mixing the wet & dry signals that I am missing. Can someone add this functionality to any existing JS Compressor (if that's allowed) and share the code here so I can see how it should be done and maybe learn something? The Delta Solo does do the same thing, but I would still like to know how to duplicate that functionality within a plugin. Thanks.
Oh, and yes, that resource is helpful!
|
|
|
11-25-2021, 09:39 AM
|
#9
|
Human being with feelings
Join Date: Dec 2012
Posts: 7,271
|
My LT_Comp does it
https://stash.reaper.fm/v/29185/lt_comp
Edit - not that my code is any great example of anything, but it does have switchable delta mode.
|
|
|
11-25-2021, 06:46 PM
|
#10
|
Human being with feelings
Join Date: Apr 2021
Posts: 26
|
Quote:
Originally Posted by ashcat_lt
|
Thanks! I downloaded your plugin and managed to figure out how to do what I wanted based on it. I'm learning little by little from this great community!
|
|
|
11-25-2021, 06:49 PM
|
#11
|
Human being with feelings
Join Date: Apr 2021
Posts: 26
|
Quote:
Originally Posted by TonE
Cool, waiting for your compressor now.
No matter, if you will share your end result here or not, have fun with Reaper and the music lovers here, my friend.
|
After receiving lots of help from the community, I managed to cobble my plugin together. Here's the link to it: https://stash.reaper.fm/v/43352/Bleed%20Kill-pressor
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 04:41 AM.
|