|
|
|
06-12-2014, 02:29 PM
|
#1
|
Human being with feelings
Join Date: Oct 2010
Posts: 272
|
A script to float a specific plug-in GUI from a selected track?
Hi guys,
I'm wondering if it would be hard for someone to put together a new script that would allow a single shortcut key to float a pre-defined plug-in GUI once a track is selected. I want to use this to float my main EQ instantly on any track without having to right click and wait for the FX dropdown, which can be slow.
Someone did a short script that allows you to write a plug-in name into the script and you execute this action to load it into the chain of a selected track.
I can post that script (but I wasn't sure if it was kosher since I didn't write it and I don't remember who did) if it would be helpful (i.e. if it might be adaptable to this GUI floating idea).
I'm aware that there is an SWS action to float a GUI based on order but I would rather have one based on name so the action will work regardless of what order the plug-in appears on the track.
Thanks much in advance to anyone willing to help out.
Dave
|
|
|
06-12-2014, 03:06 PM
|
#2
|
Human being with feelings
Join Date: Sep 2012
Location: Indonesia
Posts: 91
|
For my workflow—instead of opening each plugin to tweak, EQing is easier and also faster by showing EQ parameters on MCP. It's more similar to twisting knobs on analog mixing console.
To make it even faster to set-up, the EQ plugin can be saved as FX chains, and pasted to the particular track using SWS action assigned to keyboard shortcut.
Anyway YMMV though, and your requested script might come handy on certain mixing situation.
Someone might help you with the appropriate script. Good luck
|
|
|
06-12-2014, 03:48 PM
|
#3
|
Human being with feelings
Join Date: Oct 2010
Posts: 272
|
I appreciate the suggestions. I already have a single action to put the EQ on the track based on the script I mentioned in the first post.
I use a very versatile EQ called DMG EQuick which cannot be used effectively without the GUI. Putting some knobs on the TCP would be much, much slower than opening and using the GUI directly, since EQuick is designed very carefully to be very efficient with its interface, and there are far too many parameters to narrow down to a few panel knobs. I also always have the analyzer showing on the GUI, which I often use.
|
|
|
11-03-2014, 04:25 PM
|
#4
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
so is there no way to float specific plugins by name?
if not then i think that's a good case for implementing fixed plugin slots.
that way we can continue to select plugins by position like now, except they also won't move around when adding/removing fx.
|
|
|
11-03-2014, 04:29 PM
|
#5
|
Human being with feelings
Join Date: Mar 2008
Location: Netherlands
Posts: 2,629
|
I could use this. I'm using ReaEQ on each channel with it's controls hidden, controlling it from the channel-strip mode on my Tascam US-2400. I use the plugin-window for the analyser function when doing surgical EQ.
If you can get met the example code you mentioned, I might have a stab at it
|
|
|
11-04-2014, 04:02 AM
|
#6
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
Code:
from reaper_python import *
def ShowNamedPlugin(sPluginName, pTrack, create) :
'''
If named plugin not found and create is True, add it to track FX chain
If track FX chain is hidden, float the plugin.
If track FX chain is open, switch focus to the plugin if it isn't selected
'''
iPlugin = RPR_TrackFX_GetByName(pTrack, sPluginName, create)
if iPlugin > -1 :
iSel = RPR_TrackFX_GetChainVisible(pTrack)
if iSel == -1 : # FX chain hidden
if RPR_TrackFX_GetOpen(pTrack, iPlugin) :
RPR_TrackFX_Show(pTrack, iPlugin, 2) # 0 == hidechain, 1 == showchain, 2 == hide floating window, 3 == show floating window
else :
RPR_TrackFX_Show(pTrack, iPlugin, 3) # 0 == hidechain, 1 == showchain, 2 == hide floating window, 3 == show floating window
elif iSel == -2 : # FX chain visible but no effect selected
RPR_TrackFX_Show(pTrack, iPlugin, 1) # 0 == hidechain, 1 == showchain, 2 == hide floating window, 3 == show floating window
else : # FX chain is visible
if iSel != iPlugin :
# Plugin is not selected, switch to and enable
RPR_TrackFX_Show(pTrack, iPlugin, 1) # 0 == hidechain, 1 == showchain, 2 == hide floating window, 3 == show floating window
sPluginName = "ReaEQ"
pProject = 0
# Show named plugin if it exists on any selected track
for i in range(RPR_CountSelectedTracks(pProject)) :
pTrack = RPR_GetSelectedTrack(pProject, i)
ShowNamedPlugin(sPluginName, pTrack, False)
Last edited by IXix; 11-04-2014 at 04:08 AM.
|
|
|
11-04-2014, 08:35 AM
|
#7
|
Human being with feelings
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
|
eel-ized
Code:
//by IXix (translated by Elan Hickler, edited by spk77)
function ShowNamedPlugin(sPluginName, pTrack, create) local(iSel iPlugin) (
/*
If named plugin not found and create is True, add it to track FX chain
If track FX chain is hidden, float the plugin.
If track FX chain is open, switch focus to the plugin if it isn't selected
*/
iPlugin = TrackFX_GetByName(pTrack, sPluginName, create);
iPlugin > -1 ? (
iSel = TrackFX_GetChainVisible(pTrack);
iSel == -1 ? (
TrackFX_GetOpen(pTrack, iPlugin) ?
TrackFX_Show(pTrack, iPlugin, 2):
TrackFX_Show(pTrack, iPlugin, 3);
):
iSel == -2 ? TrackFX_Show(pTrack, iPlugin, 1):
iSel != iPlugin ? TrackFX_Show(pTrack, iPlugin, 1);
);
);
sPluginName = "SPAN";
pProject = 0;
i = 0;
loop(CountSelectedTracks(pProject),
pTrack = GetSelectedTrack(pProject, i);
ShowNamedPlugin(sPluginName, pTrack, 1);
i+=1;
);
IsTrackSelected(GetMasterTrack()) ? ShowNamedPlugin(sPluginName, GetMasterTrack(), 1);
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Last edited by Argitoth; 11-08-2014 at 04:50 PM.
|
|
|
11-04-2014, 12:38 PM
|
#8
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
wow fun. never tried running a script before but that should be quite helpful if i can get it working.
btw guys, ya'll know there is a built in action to insert/view ReaQ right? but this looks like we can plug in any plugin name and it should work similarly.
EDIT: ok so that was pretty painless. didnt know running scripts was such a snap. but what if your plugin is on the master track? it doesnt work then. also says it will add the fx if its not there already, which it didnt, but it floats the gui if present.
Last edited by foxAsteria; 11-04-2014 at 01:00 PM.
|
|
|
11-04-2014, 01:38 PM
|
#9
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
Quote:
Originally Posted by PooFox
but what if your plugin is on the master track? it doesnt work then.
|
Yeah, the master track is different. You can still get a pointer to it though and it will behave the same. You just have to use RPR_GetMasterTrack. I made a helper so I can just remember one function.
Code:
def GetTrack(pProject, iIndex) :
if iIndex < 0 :
return RPR_GetMasterTrack(pProject)
else :
return RPR_GetTrack(pProject, iIndex)
I'm not sure how you would tell if the master track was in the selected tracks though.
Quote:
Originally Posted by PooFox
also says it will add the fx if its not there already, which it didnt, but it floats the gui if present.
|
If you want to create the plugin when it's not present, you do this instead...
Code:
ShowNamedPlugin(sPluginName, pTrack, True)
|
|
|
11-08-2014, 08:20 AM
|
#10
|
Human being with feelings
Join Date: Jun 2014
Posts: 22
|
This is exactly what I need - thanks!
I want to assign buttons on my BCR2000 to specific FX, so hitting the button brings up the right FX.
This will do it (I think!)
Thanks,
Eric
|
|
|
11-08-2014, 01:34 PM
|
#11
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
yea thanks alot IXix. still havent had time to get into the nitty gritty of the code language, but it's a very helpful script. although i cant seem to get the plugin to generate when not present and not sure where to add that master track section.
Code:
//by IXix (translated by Elan Hickler)
function ShowNamedPlugin(sPluginName, pTrack, create) local(iSel iPlugin) (
/*
If named plugin not found and create is True, add it to track FX chain
If track FX chain is hidden, float the plugin.
If track FX chain is open, switch focus to the plugin if it isn't selected
*/
iPlugin = TrackFX_GetByName(pTrack, sPluginName, create);
iPlugin > -1 ? (
iSel = TrackFX_GetChainVisible(pTrack);
iSel == -1 ? (
TrackFX_GetOpen(pTrack, iPlugin) ?
TrackFX_Show(pTrack, iPlugin, 2):
TrackFX_Show(pTrack, iPlugin, 3);
):
iSel == -2 ? TrackFX_Show(pTrack, iPlugin, 1):
iSel != iPlugin ? TrackFX_Show(pTrack, iPlugin, 1);
);
);
sPluginName = "SPAN";
pProject = 0;
loop(CountSelectedTracks(pProject),
pTrack = GetSelectedTrack(pProject, i);
ShowNamedPlugin(sPluginName, pTrack, True);
);
thats what i have now but changing that last line to true didnt seem to change any behavior. plugin alias "SPAN" is also identical to the dll name if that's any concern. anyways, thanks for your help, soon ill start writing my own!
|
|
|
11-08-2014, 01:49 PM
|
#12
|
Human being with feelings
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
|
check the python version. my eel version is untested,
OHHH oops... that's because "True" is always 0. I'll change the code.
Edit: Oh wait, no, my original code is correct. I don't use True or False, I use 1 and 0.
Edit: You could add this to the top of the code
Code:
True = 1;
//False is automatically 0 because False was never assigned to a value.
btw eel is not case sensitive last time I checked
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
|
|
|
11-08-2014, 02:26 PM
|
#13
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
Quote:
Originally Posted by Argitoth
Edit: You could add this to the top of the code
[code]
True = 1;
|
thanks dude, that did the trick! just cant get it to work with the master track yet.
|
|
|
11-08-2014, 02:36 PM
|
#14
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
Ah, didn't realise you were using the EEL version. As Argitoth has noted there are no 'True' and 'False' constants in EEL so you need to use 1 or 0 for those in converted scripts. If you just want to open/create an instance of SPAN on the master you'd do this...
Code:
ShowNamedPlugin("SPAN", GetMasterTrack(0), 1);
|
|
|
11-08-2014, 03:00 PM
|
#15
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
Quote:
Originally Posted by IXix
Ah, didn't realise you were using the EEL version
|
sorry for my confusion. eel seemed a bit more straightforward. i just wanted to get the above script compatible when the master track happens to be selected. almost there.
|
|
|
11-08-2014, 03:19 PM
|
#16
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Quote:
Originally Posted by PooFox
sorry for my confusion. eel seemed a bit more straightforward. i just wanted to get the above script compatible when the master track happens to be selected. almost there.
|
This should work for master track also:
Code:
//by IXix (translated by Elan Hickler)
function ShowNamedPlugin(sPluginName, pTrack, create) local(iSel iPlugin) (
/*
If named plugin not found and create is True, add it to track FX chain
If track FX chain is hidden, float the plugin.
If track FX chain is open, switch focus to the plugin if it isn't selected
*/
iPlugin = TrackFX_GetByName(pTrack, sPluginName, create);
iPlugin > -1 ? (
iSel = TrackFX_GetChainVisible(pTrack);
iSel == -1 ? (
TrackFX_GetOpen(pTrack, iPlugin) ?
TrackFX_Show(pTrack, iPlugin, 2):
TrackFX_Show(pTrack, iPlugin, 3);
):
iSel == -2 ? TrackFX_Show(pTrack, iPlugin, 1):
iSel != iPlugin ? TrackFX_Show(pTrack, iPlugin, 1);
);
);
sPluginName = "SPAN";
pProject = 0;
i = 0;
loop(CountSelectedTracks(pProject),
pTrack = GetSelectedTrack(pProject, i);
ShowNamedPlugin(sPluginName, pTrack, 1);
i+=1;
);
IsTrackSelected(GetMasterTrack()) ? ShowNamedPlugin(sPluginName, GetMasterTrack(), 1);
Last edited by spk77; 11-08-2014 at 03:33 PM.
|
|
|
11-08-2014, 03:21 PM
|
#17
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
Quote:
Originally Posted by PooFox
sorry for my confusion. eel seemed a bit more straightforward. i just wanted to get the above script compatible when the master track happens to be selected. almost there.
|
I can't think how you would detect whether the master is selected. If you figure it out then let me know. I just have a button to open/create span on the master, no selection involved.
edit: spk77 nailed it while I was typing
|
|
|
11-08-2014, 04:46 PM
|
#18
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
just beautiful guys! works perfectly.
someone should pop that code into the OP since now all bases are covered you can just pop in your vst name and create individual scripts per plug.
awesome. cant wait to start writing my own scripts (after i get a handle on the syntax of course)!
Last edited by foxAsteria; 11-08-2014 at 04:52 PM.
|
|
|
04-09-2015, 05:13 AM
|
#19
|
Human being with feelings
Join Date: Mar 2015
Location: Moscow, Russia
Posts: 206
|
Great stuff you have here! Two weeks with Reaper and i'm blown by what it can do... combined with it's community, of course.
One thing - is there a way to float fx GUI from the Monitoring FXchain?
|
|
|
04-09-2015, 05:27 AM
|
#20
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
@stereolost
If I remember well, we can't access monitor FX with script =/
|
|
|
04-09-2015, 11:46 AM
|
#21
|
Human being with feelings
Join Date: Jul 2013
Location: Edmonton, Alberta, Canada
Posts: 258
|
Just wanted to say Thanks..this script works great
__________________
Ron L, i7 laptop x64, Win7pro/x64(dual boot), 7200rpm hd, 2 ext. hd, Scarlett 2i4, Event 20/20 audio monitors, 1 ext. video monitor, Novation Launch Control XL, REAPER x64, Sonar Platinum
|
|
|
04-09-2015, 01:04 PM
|
#22
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
Quote:
Originally Posted by X-Raym
|
No, not possible. I've mentioned it a few times in various pre-release cycles when API stuff was on the table but never got a response. Not sure if there's a tracker item for it or not.
|
|
|
08-06-2015, 06:13 AM
|
#23
|
Human being with feelings
Join Date: Jun 2012
Posts: 277
|
Would someone be willing to make an alternate version of this script (small tweak I'm thinking) that works project wide? I typically have one instance of Maschine 2 in my project and would love to hit a button to float it from anywhere, regardless of whether or not the track is selected.
I have tried this with window sets and cycle actions but it messes up project to project. This script is smooth like butter.
|
|
|
08-06-2015, 09:41 AM
|
#24
|
Human being with feelings
Join Date: Aug 2012
Location: Finland
Posts: 2,668
|
Quote:
Originally Posted by buddhajuke
Would someone be willing to make an alternate version of this script (small tweak I'm thinking) that works project wide? I typically have one instance of Maschine 2 in my project and would love to hit a button to float it from anywhere, regardless of whether or not the track is selected.
I have tried this with window sets and cycle actions but it messes up project to project. This script is smooth like butter.
|
Code:
// by IXix (translated by Elan Hickler)
function ShowNamedPlugin(sPluginName) local(iSel pTrack iPlugin fx_found i iTrackCount) (
/*
If track FX chain is hidden, float the plugin.
If track FX chain is open, switch focus to the plugin if it isn't selected
*/
fx_found = 0;
// Check master track first
pTrack = GetMasterTrack();
iPlugin = TrackFX_GetByName(pTrack, sPluginName, 0);
iPlugin > -1 ? fx_found = 1;
// FX not on master track -> check other tracks
iTrackCount = CountTracks(0);
i = 0;
while(!fx_found && i < iTrackCount - 1) (
pTrack = GetTrack(0, i);
iPlugin = TrackFX_GetByName(pTrack, sPluginName, 0);
iPlugin > -1 ? fx_found = 1;
i = i+1;
);
// FX found
fx_found ? (
iSel = TrackFX_GetChainVisible(pTrack);
iSel == -1 ? (
TrackFX_GetOpen(pTrack, iPlugin) ?
TrackFX_Show(pTrack, iPlugin, 2):
TrackFX_Show(pTrack, iPlugin, 3);
):
iSel == -2 ? TrackFX_Show(pTrack, iPlugin, 0):
iSel != iPlugin ? TrackFX_Show(pTrack, iPlugin, 1);
);
);
sPluginName = "Maschine 2"; // Edit this if it doesn't work
ShowNamedPlugin(sPluginName);
Last edited by spk77; 08-06-2015 at 09:50 AM.
Reason: better variable names
|
|
|
08-06-2015, 09:46 AM
|
#25
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
Quote:
Originally Posted by buddhajuke
Would someone be willing to make an alternate version of this script (small tweak I'm thinking) that works project wide? I typically have one instance of Maschine 2 in my project and would love to hit a button to float it from anywhere, regardless of whether or not the track is selected.
I have tried this with window sets and cycle actions but it messes up project to project. This script is smooth like butter.
|
This should do it, two scripts to open next/prev instance of named plugin in the project.
Just change this bit at the top of the two "Focus" scripts...
Code:
targetName = "VST: ReaEQ (Cockos)";
The name has to be exactly as shown in the fx chain, so if you rename your Maschine instance to "FluffyWuffy" you'd have to do this...
Code:
targetName = "FluffyWuffy";
If the plugin isn't found it pops up a message.
edit: How does spk77 know to post a solution while I'm typing?
Last edited by IXix; 08-06-2015 at 01:35 PM.
|
|
|
08-06-2015, 06:04 PM
|
#26
|
Human being with feelings
Join Date: Jun 2012
Posts: 277
|
Thank you
|
|
|
01-13-2020, 06:34 AM
|
#27
|
Human being with feelings
Join Date: Aug 2019
Posts: 853
|
I know this is an old thread, but I'm hoping someone can help... I've been using this script to float plugins by name and it works brilliantly, but I don't know how to make it ADD the plugin if it doesn't already exist on the track. I can see from the text at the top of the script that if 'create is true' it will do that... but I have know idea how to make that happen.
I see there are a few different versions here, so here is the specific code I'm using -
Code:
function ShowNamedPlugin(sPluginName, pTrack, create) local(iSel iPlugin) (
/*
If named plugin not found and create is True, add it to track FX chain
If track FX chain is hidden, float the plugin.
If track FX chain is open, switch focus to the plugin if it isn't selected
*/
iPlugin = TrackFX_GetByName(pTrack, sPluginName, create);
iPlugin > -1 ? (
iSel = TrackFX_GetChainVisible(pTrack);
iSel == -1 ? (
TrackFX_GetOpen(pTrack, iPlugin) ?
TrackFX_Show(pTrack, iPlugin, 2):
TrackFX_Show(pTrack, iPlugin, 3);
):
iSel == -2 ? TrackFX_Show(pTrack, iPlugin, 1):
iSel != iPlugin ? TrackFX_Show(pTrack, iPlugin, 1);
);
);
sPluginName = "Main EQ";
pProject = 0;
i = 0;
loop(CountSelectedTracks(pProject),
pTrack = GetSelectedTrack(pProject, i);
ShowNamedPlugin(sPluginName, pTrack, 1);
i+=1;
);
IsTrackSelected(GetMasterTrack()) ? ShowNamedPlugin(sPluginName, GetMasterTrack(), 1);
I'd appreciate it if someone could point me in the right direction.
Thanks.
|
|
|
01-13-2020, 10:03 AM
|
#28
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
I make little scripts for each plugin I want to handle. This is the one for the SPAN on my monitor FX (see newer version below)...
Code:
@import Include/ShowNamedPlugin.func.eel
Undo_BeginBlock2(0);
ShowNamedPlugin("SPAN", GetMasterTrack(0), 1, 1, 1);
Undo_EndBlock2(0, "Toggle SPAN visible", 2);
ShowNamedPlugin is in its own file that I import. You can of course just include the whole function text in your script but importing means that if you change the function, you only have to change one file instead of twenty. Here's the latest version that can handle the input FX and monitor FX chains too...
Code:
// If bExtFX is > 0 use the record FX chain (monitor FX for master track)
// If named plugin not found and bCreate is > 0, add it to track FX chain
// If track FX chain is hidden, float the plugin.
// If track FX chain is open, switch focus to the plugin if it isn't selected
// If bToggleActive > 0 enable plugin if showing, disable if hiding or toggle if visible in fx chain window
// Returns 1 if plugin is visible, 2 if enabled, 3 if visible and enabled, 0 if not visible or enabled
function ShowNamedPlugin(sPluginName, pTrack, bToggleActive, bCreate, bExtFX)
local(iPlugin, iSel, ret)
(
ret = 0;
iPlugin = TrackFX_AddByName(pTrack, sPluginName, bExtFX, bCreate);
iPlugin > -1 ?
(
bExtFX ?
(
iPlugin |= 0x1000000;
iSel = TrackFX_GetRecChainVisible(pTrack);
)
:
(
iSel = TrackFX_GetChainVisible(pTrack);
);
iSel == -1 ? // FX chain hidden, show/hide floating FX window
(
TrackFX_GetOpen(pTrack, iPlugin) ?
(
TrackFX_Show(pTrack, iPlugin, 2);
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, 0);
);
)
:
(
TrackFX_Show(pTrack, iPlugin, 3);
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, 1);
);
);
)
: iSel == -2 ? // FX chain visible but no effect selected, select plugin in chain
(
TrackFX_Show(pTrack, iPlugin, 1);
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, 1);
);
)
: // FX chain is visible
(
iSel != iPlugin ? // Plugin isn't selected. Select and enable if necessary.
(
TrackFX_Show(pTrack, iPlugin, 1); // 0 == hidechain, 1 == showchain, 2 == hide floating window, 3 == show floating window
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, 1);
);
)
: // Plugin is selected. Toggle enable if necessary.
(
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, !TrackFX_GetEnabled(pTrack, iPlugin));
);
)
);
// Construct return value
TrackFX_GetOpen(pTrack, iPlugin) ? ret = 1;
TrackFX_GetEnabled(pTrack, iPlugin) ? ret |= 2;
)
:
(
MB(sprintf(#, "%s not found!", sPluginName), "Plugin not found", 0);
);
ret;
);
Most useful script I ever made.
|
|
|
01-13-2020, 12:16 PM
|
#29
|
Human being with feelings
Join Date: Aug 2019
Posts: 853
|
Quote:
Originally Posted by IXix
. You can of course just include the whole function text in your script
|
Sorry - I have very limited knowledge of scripting or coding...
If I were to combine these scripts as you suggested, then where would I add the code from one to the other? I don't need the extra flexibility of separating the plugin name scripts from the main script (although I see why it would be useful) so all I really need is a script that does what the script I posted above does, except it also creates the named FX if it's not present on the track.
If you could walk me through the simplest way to achieve that, I'd be very grateful. If you have an improved version (works with monitor FX etc) that is all wrapped up in one script per plugin, then even better.
Thanks.
|
|
|
01-13-2020, 02:05 PM
|
#30
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
Try this. Didn't test it but should be okay.
Code:
// Change this stuff
pluginName = "Some Plugin";
track = GetMasterTrack();
toggleActive = 1; // enable/disable plugin?
create = 1; // create the plugin if it doesn't exist?
extFX = 0; // input fx/monitor fx chain?
// If bExtFX is > 0 use the record FX chain (monitor FX for master track)
// If named plugin not found and bCreate is > 0, add it to track FX chain
// If track FX chain is hidden, float the plugin.
// If track FX chain is open, switch focus to the plugin if it isn't selected
// If bToggleActive > 0 enable plugin if showing, disable if hiding or toggle if visible in fx chain window
// Returns 1 if plugin is visible, 2 if enabled, 3 if visible and enabled, 0 if not visible or enabled
function ShowNamedPlugin(sPluginName, pTrack, bToggleActive, bCreate, bExtFX)
local(iPlugin, iSel, ret)
(
ret = 0;
iPlugin = TrackFX_AddByName(pTrack, sPluginName, bExtFX, bCreate);
iPlugin > -1 ?
(
bExtFX ?
(
iPlugin |= 0x1000000;
iSel = TrackFX_GetRecChainVisible(pTrack);
)
:
(
iSel = TrackFX_GetChainVisible(pTrack);
);
iSel == -1 ? // FX chain hidden, show/hide floating FX window
(
TrackFX_GetOpen(pTrack, iPlugin) ?
(
TrackFX_Show(pTrack, iPlugin, 2);
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, 0);
);
)
:
(
TrackFX_Show(pTrack, iPlugin, 3);
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, 1);
);
);
)
: iSel == -2 ? // FX chain visible but no effect selected, select plugin in chain
(
TrackFX_Show(pTrack, iPlugin, 1);
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, 1);
);
)
: // FX chain is visible
(
iSel != iPlugin ? // Plugin isn't selected. Select and enable if necessary.
(
TrackFX_Show(pTrack, iPlugin, 1); // 0 == hidechain, 1 == showchain, 2 == hide floating window, 3 == show floating window
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, 1);
);
)
: // Plugin is selected. Toggle enable if necessary.
(
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, !TrackFX_GetEnabled(pTrack, iPlugin));
);
)
);
// Construct return value
TrackFX_GetOpen(pTrack, iPlugin) ? ret = 1;
TrackFX_GetEnabled(pTrack, iPlugin) ? ret |= 2;
)
:
(
MB(sprintf(#, "%s not found!", sPluginName), "Plugin not found", 0);
);
ret;
);
Undo_BeginBlock2(0);
IsTrackSelected(GetMasterTrack()) ? ShowNamedPlugin(pluginName, track, toggleActive, create, extFX);
Undo_EndBlock2(0, sprintf(#, "Toggle %s visible", pluginName), 2);
|
|
|
01-13-2020, 02:57 PM
|
#31
|
Human being with feelings
Join Date: Aug 2019
Posts: 853
|
Thank you! Will test it tonight.
|
|
|
01-13-2020, 03:19 PM
|
#32
|
Human being with feelings
Join Date: Aug 2019
Posts: 853
|
No joy I'm afraid!
I assume the plugin name goes here at the start, replacing "Some Plugin"? -
// Change this stuff
pluginName = "Some Plugin";
That's what I've done, tried with a few different plugin names, checked everything is spelled correctly, but nothing. It doesn't throw up an error or do anything weird, it just does nothing.
|
|
|
01-14-2020, 02:04 PM
|
#33
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
It should give a message if it can't find the plugin. I just tested here and it works fine with this...
Code:
pluginName = "ReaEQ (Cockos)";
|
|
|
01-16-2020, 01:03 PM
|
#34
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
IXix - hey I've been using your script for years, so thanks again!
It's this:
Code:
//by IXix (translated by Elan Hickler)
function ShowNamedPlugin(sPluginName, pTrack, create) local(iSel iPlugin) (
/*
If named plugin not found and create is True, add it to track FX chain
If track FX chain is hidden, float the plugin.
If track FX chain is open, switch focus to the plugin if it isn't selected
*/
iPlugin = TrackFX_GetByName(pTrack, sPluginName, create);
iPlugin > -1 ? (
iSel = TrackFX_GetChainVisible(pTrack);
iSel == -1 ? (
TrackFX_GetOpen(pTrack, iPlugin) ?
TrackFX_Show(pTrack, iPlugin, 2):
TrackFX_Show(pTrack, iPlugin, 3);
):
iSel == -2 ? TrackFX_Show(pTrack, iPlugin, 1):
iSel != iPlugin ? TrackFX_Show(pTrack, iPlugin, 1);
);
);
sPluginName = "EQ";
pProject = 0;
i = 0;
loop(CountSelectedTracks(pProject),
pTrack = GetSelectedTrack(pProject, i);
ShowNamedPlugin(sPluginName, pTrack, 0);
i+=1;
);
IsTrackSelected(GetMasterTrack()) ? ShowNamedPlugin(sPluginName, GetMasterTrack(), 1);
It's not broken or anything, but which is the best version to use? Might as well update if you've improved it since...
|
|
|
01-16-2020, 02:50 PM
|
#35
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
Quote:
Originally Posted by foxAsteria
IXix - hey I've been using your script for years, so thanks again!
...
It's not broken or anything, but which is the best version to use? Might as well update if you've improved it since...
|
You're welcome! The version a couple of posts above is what I'm using now... https://forum.cockos.com/showpost.ph...6&postcount=28
The number of arguments changed though, so it will probably break any scripts that use it. You'd just need to add zeros for the new arguments bToggleActive and bExtFX.
Code:
// old
function ShowNamedPlugin(sPluginName, pTrack, create)
// new
function ShowNamedPlugin(sPluginName, pTrack, bToggleActive, bCreate, bExtFX)
|
|
|
01-19-2020, 07:35 PM
|
#36
|
Human being with feelings
Join Date: Aug 2019
Posts: 853
|
Hi IXix - I'm sorry, but I'm still having no luck with this - I've even tested on a fresh portable install and no luck.
The version Fox posted above will float/unfloat a plugin by name for me, but it still doesn't create it. The one you posted doesn't do anything, even throw up an error. I don't script but I've copied/pasted various lua and eel scripts I've found on the forum and it always works, so I'm not sure what's wrong.
Any possible idea?
Just for boring clarification - here is the exact code (copied from your post above) that I'm using. I'm testing with ReaEQ for now, but have tried with other plugins too.
Code:
// Change this stuff
pluginName = "ReaEQ (Cockos)";
track = GetMasterTrack();
toggleActive = 1; // enable/disable plugin?
create = 1; // create the plugin if it doesn't exist?
extFX = 0; // input fx/monitor fx chain?
// If bExtFX is > 0 use the record FX chain (monitor FX for master track)
// If named plugin not found and bCreate is > 0, add it to track FX chain
// If track FX chain is hidden, float the plugin.
// If track FX chain is open, switch focus to the plugin if it isn't selected
// If bToggleActive > 0 enable plugin if showing, disable if hiding or toggle if visible in fx chain window
// Returns 1 if plugin is visible, 2 if enabled, 3 if visible and enabled, 0 if not visible or enabled
function ShowNamedPlugin(sPluginName, pTrack, bToggleActive, bCreate, bExtFX)
local(iPlugin, iSel, ret)
(
ret = 0;
iPlugin = TrackFX_AddByName(pTrack, sPluginName, bExtFX, bCreate);
iPlugin > -1 ?
(
bExtFX ?
(
iPlugin |= 0x1000000;
iSel = TrackFX_GetRecChainVisible(pTrack);
)
:
(
iSel = TrackFX_GetChainVisible(pTrack);
);
iSel == -1 ? // FX chain hidden, show/hide floating FX window
(
TrackFX_GetOpen(pTrack, iPlugin) ?
(
TrackFX_Show(pTrack, iPlugin, 2);
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, 0);
);
)
:
(
TrackFX_Show(pTrack, iPlugin, 3);
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, 1);
);
);
)
: iSel == -2 ? // FX chain visible but no effect selected, select plugin in chain
(
TrackFX_Show(pTrack, iPlugin, 1);
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, 1);
);
)
: // FX chain is visible
(
iSel != iPlugin ? // Plugin isn't selected. Select and enable if necessary.
(
TrackFX_Show(pTrack, iPlugin, 1); // 0 == hidechain, 1 == showchain, 2 == hide floating window, 3 == show floating window
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, 1);
);
)
: // Plugin is selected. Toggle enable if necessary.
(
bToggleActive ?
(
TrackFX_SetEnabled(pTrack, iPlugin, !TrackFX_GetEnabled(pTrack, iPlugin));
);
)
);
// Construct return value
TrackFX_GetOpen(pTrack, iPlugin) ? ret = 1;
TrackFX_GetEnabled(pTrack, iPlugin) ? ret |= 2;
)
:
(
MB(sprintf(#, "%s not found!", sPluginName), "Plugin not found", 0);
);
ret;
);
Undo_BeginBlock2(0);
IsTrackSelected(GetMasterTrack()) ? ShowNamedPlugin(pluginName, track, toggleActive, create, extFX);
Undo_EndBlock2(0, sprintf(#, "Toggle %s visible", pluginName), 2);
Thank you for your assistance.
|
|
|
01-19-2020, 07:48 PM
|
#37
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
Quote:
Originally Posted by Joe90
The version Fox posted above will float/unfloat a plugin by name for me, but it still doesn't create it.
|
It's optional. At the bottom you just change this:
ShowNamedPlugin(sPluginName, pTrack, 0);
To this:
ShowNamedPlugin(sPluginName, pTrack, 1);
If you the newer version posted by IXix, I bet you just need to ensure that the main script is named ShowNamedPlugin.func.eel and you selected eel from the dropdown when you saved it (or it will add .lua and not work) and that it's saved in the same place as the per-plugin scripts.
|
|
|
01-20-2020, 05:02 AM
|
#38
|
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,889
|
Quote:
Originally Posted by Joe90
Hi IXix - I'm sorry, but I'm still having no luck with this...
|
As foxAsteria said, make sure the script is saved as an .eel file. That's the only thing I can think of as to why it wouldn't be working.
|
|
|
05-25-2020, 09:48 PM
|
#39
|
Human being with feelings
Join Date: Aug 2019
Posts: 853
|
Hi all,
This is the version of Ixix's script I am using, and it's working great. The only issue is that it doesn't work for custom FX chains that I've saved -
Code:
//by IXix (translated by Elan Hickler)
function ShowNamedPlugin(sPluginName, pTrack, create) local(iSel iPlugin) (
/*
If named plugin not found and create is True, add it to track FX chain
If track FX chain is hidden, float the plugin.
If track FX chain is open, switch focus to the plugin if it isn't selected
*/
iPlugin = TrackFX_GetByName(pTrack, sPluginName, create);
iPlugin > -1 ? (
iSel = TrackFX_GetChainVisible(pTrack);
iSel == -1 ? (
TrackFX_GetOpen(pTrack, iPlugin) ?
TrackFX_Show(pTrack, iPlugin, 2):
TrackFX_Show(pTrack, iPlugin, 3);
):
iSel == -2 ? TrackFX_Show(pTrack, iPlugin, 1):
iSel != iPlugin ? TrackFX_Show(pTrack, iPlugin, 1);
);
);
sPluginName = "The Drop";
pProject = 0;
i = 0;
loop(CountSelectedTracks(pProject),
pTrack = GetSelectedTrack(pProject, i);
ShowNamedPlugin(sPluginName, pTrack, 1);
i+=1;
);
IsTrackSelected(GetMasterTrack()) ? ShowNamedPlugin(sPluginName, GetMasterTrack(), 1);
Anyone know how to get it working for FX chains too?
Thanks for your help.
|
|
|
05-26-2020, 08:15 PM
|
#40
|
Human being with feelings
Join Date: Dec 2009
Location: Oblivion
Posts: 10,255
|
Quote:
Originally Posted by Joe90
Anyone know how to get it working for FX chains too?
|
Shouldn't matter if you've got the plugins named the same as what the script looks for.
|
|
|
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 07:25 AM.
|