|
|
|
07-01-2019, 11:00 PM
|
#1
|
Human being with feelings
Join Date: Jul 2009
Posts: 429
|
How to float a script inserted FX window
I am using:
from reaper_python import *
tracks = [RPR_GetSelectedTrack(0, track) for track in range(RPR_CountSelectedTracks(0))]
for track in tracks:
success = RPR_TrackFX_AddByName(track, 'FabFilter Pro-Q 3', False, -1)
Any ideas on how to have the inserted FX float to adjust its parameters inmediately and not have to go inside the plugin chain? The prefereces option is no good. I hope it can be done popping the plugin chain with focus on the last plugin.
Thanks!
|
|
|
07-01-2019, 11:30 PM
|
#2
|
Human being with feelings
Join Date: Sep 2013
Posts: 657
|
You need to use the following function -
RPR_TrackFX_Show(MediaTrack track, Int index, Int showFlag)
- with showFlag either =3 to float the FX or =1 to show the FX chain window.
|
|
|
07-02-2019, 07:37 PM
|
#3
|
Human being with feelings
Join Date: Jul 2009
Posts: 429
|
Quote:
Originally Posted by Neutronic
You need to use the following function -
RPR_TrackFX_Show(MediaTrack track, Int index, Int showFlag)
- with showFlag either =3 to float the FX or =1 to show the FX chain window.
|
Result:
from reaper_python import *
tracks = [RPR_GetSelectedTrack(0, track) for track in range(RPR_CountSelectedTracks(0))]
for track in tracks:
success = RPR_TrackFX_AddByName(track, 'Blackhole', False, -1)
success = RPR_TrackFX_Show(track, -1, 1)
I doubt it is completely correct but it works.
Thanks, sir. you're awesome.
|
|
|
07-03-2019, 04:02 PM
|
#4
|
Human being with feelings
Join Date: Sep 2013
Posts: 657
|
Glad I could help!
Though if you would still prefer the script to open FX chains with last FX focused, you need to specify FX index in the RPR_TakeFX_Show() function. Otherwise, the script will not work as expected when you have more than 1 FX in a chain.
So the final script should look something like this:
Code:
from reaper_python import *
tracks = [RPR_GetSelectedTrack(0, track) for track in range(RPR_CountSelectedTracks(0))]
for track in tracks:
fxIDX = RPR_TrackFX_AddByName(track, 'Fabfilter pro-q 3', False, -1)
RPR_TrackFX_Show(track, fxIDX, 1)
Notice that for the sake of clarity I changed the success variable name to fxIDX, since that is what the function returns.
On the other hand, RPR_TrackFX_Show() does not return anything, so you don't need to assign its result to a variable.
|
|
|
07-03-2019, 04:48 PM
|
#5
|
Human being with feelings
Join Date: Jul 2009
Posts: 429
|
Quote:
Originally Posted by Neutronic
Glad I could help!
Though if you would still prefer the script to open FX chains with last FX focused, you need to specify FX index in the RPR_TakeFX_Show() function. Otherwise, the script will not work as expected when you have more than 1 FX in a chain.
So the final script should look something like this:
Code:
from reaper_python import *
tracks = [RPR_GetSelectedTrack(0, track) for track in range(RPR_CountSelectedTracks(0))]
for track in tracks:
fxIDX = RPR_TrackFX_AddByName(track, 'Fabfilter pro-q 3', False, -1)
RPR_TrackFX_Show(track, fxIDX, 1)
Notice that for the sake of clarity I changed the success variable name to fxIDX, since that is what the function returns.
On the other hand, RPR_TrackFX_Show() does not return anything, so you don't need to assign its result to a variable.
|
Thanks. I modified all my scripts with what you suggested. I just added fxname variable to make it easy to change in the future. There is one that is failing.
Code:
from reaper_python import *
fxname = 'Volume Adjustment'
tracks = [RPR_GetSelectedTrack(0, track) for track in range(RPR_CountSelectedTracks(0))]
for track in tracks:
fxIDX = RPR_TrackFX_AddByName(track, fxname, False, -1)
RPR_TrackFX_Show(track, fxIDX, 1)
Any ideas on why this may be happening?
|
|
|
07-03-2019, 05:08 PM
|
#6
|
Human being with feelings
Join Date: Sep 2013
Posts: 657
|
Try changing fxname = 'Volume Adjustment' to fxname = 'JS:Volume'. This should work.
The fail has something to do with the way the function matches JS names. (The actual plugin file is named "volume" not "volume adjustment".)
|
|
|
07-03-2019, 06:32 PM
|
#7
|
Human being with feelings
Join Date: Jul 2009
Posts: 429
|
Quote:
Originally Posted by Neutronic
Try changing fxname = 'Volume Adjustment' to fxname = 'JS:Volume'. This should work.
The fail has something to do with the way the function matches JS names. (The actual plugin file is named "volume" not "volume adjustment".)
|
Works. What is the reason this happens? I am not able to use let's say Volume/Pan Smoother v5. Anything I should learn to be able to use them?
Edit. Found the reason with the help you provided above. It is the filename what it looks for.
Thanks again.
Last edited by barbaroja; 07-03-2019 at 07:08 PM.
|
|
|
07-03-2019, 07:42 PM
|
#8
|
Human being with feelings
Join Date: Sep 2013
Posts: 657
|
Quote:
Originally Posted by barbaroja
Found the reason with the help you provided above. It is the filename what it looks for.
|
Yes, this is it.
One more thing I forgot to mention - if you want the name of a JS plugin to be displayed correctly in a chain then you need to feed the RPR_TrackFX_AddByName() function the full relative path of the said JS.
For example, you need to use fxname = 'Utility/volume_pan_sample_accurate_auto' for the plugin to be named Volume/Pan Smoother v5 after it's added. Otherwise, it'll be named volume_pan_sample_accurate_auto.
|
|
|
07-03-2019, 07:49 PM
|
#9
|
Human being with feelings
Join Date: Jul 2009
Posts: 429
|
Quote:
Originally Posted by Neutronic
Yes, this is it.
One more thing I forgot to mention - if you want the name of a JS plugin to be displayed correctly in a chain then you need to feed the RPR_TrackFX_AddByName() function the full relative path of the said JS.
For example, you need to use fxname = 'Utility/volume_pan_sample_accurate_auto' for the plugin to be named Volume/Pan Smoother v5 after it's added. Otherwise, it'll be named volume_pan_sample_accurate_auto.
|
Thanks. Noted
|
|
|
07-09-2019, 11:12 PM
|
#10
|
Human being with feelings
Join Date: Jul 2009
Posts: 429
|
Quote:
Originally Posted by Neutronic
Yes, this is it.
One more thing I forgot to mention - if you want the name of a JS plugin to be displayed correctly in a chain then you need to feed the RPR_TrackFX_AddByName() function the full relative path of the said JS.
For example, you need to use fxname = 'Utility/volume_pan_sample_accurate_auto' for the plugin to be named Volume/Pan Smoother v5 after it's added. Otherwise, it'll be named volume_pan_sample_accurate_auto.
|
Nother question. I am trying to recall a specific plugin preset. I tried:
Code:
from reaper_python import *
fxname = 'VST3:NLS Buss Stereo (Waves)'
fxpreset = 'List: Mike Master'
tracks = [RPR_GetSelectedTrack(0, track) for track in range(RPR_CountSelectedTracks(0))]
for track in tracks:
fxIDX = RPR_TrackFX_AddByName(track, fxname, False, -1)
RPR_TrackFX_SetPreset(track, -1, fxpreset)
But it does not work. Does not recall the preset.
|
|
|
07-09-2019, 11:28 PM
|
#11
|
Human being with feelings
Join Date: Sep 2013
Posts: 657
|
I'm not currently at the computer to test it out, but if fxpreset is correct RPR_TrackFX_SetPreset(track, fxIDX, fxpreset) should work.
Setting the right FX index is important for it to work.
Also, don't forget about indenting the function just like you did it with RPR_TrackFX_AddByName().
|
|
|
07-09-2019, 11:39 PM
|
#12
|
Human being with feelings
Join Date: Jul 2009
Posts: 429
|
Quote:
Originally Posted by Neutronic
I'm not currently at the computer to test it out, but if fxpreset is correct RPR_TrackFX_SetPreset(track, fxIDX, fxpreset) should work.
Setting the right FX index is important for it to work.
Also, don't forget about indenting the function just like you did it with RPR_TrackFX_AddByName().
|
Code:
from reaper_python import *
fxname = 'VST3:NLS Buss Stereo (Waves)'
fxpreset = 'List: Mike Master'
tracks = [RPR_GetSelectedTrack(0, track) for track in range(RPR_CountSelectedTracks(0))]
for track in tracks:
fxIDX = RPR_TrackFX_AddByName(track, fxIDX, False, -1)
RPR_TrackFX_SetPreset(track, -1, fxpreset)
Returns Script execution error
Traceback (most recent call last):
File "Insert_FX_Waves NLS Channel.py", line 9, in <module>
fxIDX = RPR_TrackFX_AddByName(track, fxIDX, False, -1)
NameError: name 'fxIDX' is not defined
If I change to
Code:
from reaper_python import *
fxname = 'VST3:NLS Buss Stereo (Waves)'
fxpreset = 'List: Mike Master'
tracks = [RPR_GetSelectedTrack(0, track) for track in range(RPR_CountSelectedTracks(0))]
for track in tracks:
fxIDX = RPR_TrackFX_AddByName(track, fxname, False, -1)
RPR_TrackFX_SetPreset(track, -1, fxpreset)
Works but does not set the right preset
|
|
|
07-10-2019, 12:58 AM
|
#13
|
Human being with feelings
Join Date: Sep 2013
Posts: 657
|
It gives the error because you used fxIDX in the wrong function.
Here is the full code to try:
Code:
from reaper_python import *
fxname = 'VST3:NLS Buss Stereo (Waves)'
fxpreset = 'List: Mike Master'
tracks = [RPR_GetSelectedTrack(0, track) for track in range(RPR_CountSelectedTracks(0))]
for track in tracks:
fxIDX = RPR_TrackFX_AddByName(track, fxname, False, -1)
RPR_TrackFX_SetPreset(track, fxIDX, fxpreset)
|
|
|
07-15-2019, 02:15 AM
|
#14
|
Human being with feelings
Join Date: Jul 2009
Posts: 429
|
Quote:
Originally Posted by Neutronic
It gives the error because you used fxIDX in the wrong function.
Here is the full code to try:
Code:
from reaper_python import *
fxname = 'VST3:NLS Buss Stereo (Waves)'
fxpreset = 'List: Mike Master'
tracks = [RPR_GetSelectedTrack(0, track) for track in range(RPR_CountSelectedTracks(0))]
for track in tracks:
fxIDX = RPR_TrackFX_AddByName(track, fxname, False, -1)
RPR_TrackFX_SetPreset(track, fxIDX, fxpreset)
|
Thanks. Awesome!
|
|
|
07-21-2019, 06:39 PM
|
#15
|
Human being with feelings
Join Date: Sep 2016
Location: Toronto
Posts: 749
|
Any ideas on how to move the newly added FX to a defined X,Y coordinate? So the script adds the FX and then moves it to the location?
I've tried combining this with mpl's Move focused Track FX to screen center but that seems to affect already open track FX and not the one just added.
|
|
|
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 05:11 AM.
|