Old 01-13-2021, 11:48 AM   #1
babiuk
Human being with feelings
 
Join Date: Apr 2012
Posts: 121
Default Action for "clicking" a button into a plugin

Hello,
it is possible to create a custom action for something like "when I press a chosen key then a a button of a certain plugin is pressed (from off to on or viceversa)".

I don´t know if this is possible. I don´t need to control knobs or similar, just switch between two states of a parameter of a plugin using a custom action for that.

If not, any idea for getting something similar?

Thanks in advance
babiuk is offline   Reply With Quote
Old 01-13-2021, 03:59 PM   #2
jrk
Human being with feelings
 
Join Date: Aug 2015
Posts: 1,324
Default

Which parameter? which plugin? which track?
... are the things the action would need to know.

There's actions for doing things to the "last touched" fx.

Check out some of those (and in ReaPack)

The SWS extension has next/previous preset triggers.

Although showing a parameter as a knob would be by far the easiest way of doing it.
__________________
it's meant to sound like that...
jrk is offline   Reply With Quote
Old 01-13-2021, 04:35 PM   #3
babiuk
Human being with feelings
 
Join Date: Apr 2012
Posts: 121
Default

Thanks for replying.

I didn’t want to guve much more info in order to ask in a simple way.

But I can be more explicit, yes. Some plugins making tape stop effect has a button so when you click it the plugin stops audio slowly. That is what I want, to have an action so when I press a key that button is clicked.

That button is susceptible to be used as a parameter in reaper so I can linked it to an external midi controller and to another plugin’s button. But what I need is activate it by pressing a key through an action.

Any idea?
babiuk is offline   Reply With Quote
Old 01-13-2021, 05:26 PM   #4
valy
Human being with feelings
 
Join Date: Jan 2020
Posts: 1,556
Default

I'm almost certain this can at least be done with AutoHotkey
valy is offline   Reply With Quote
Old 01-13-2021, 10:32 PM   #5
babiuk
Human being with feelings
 
Join Date: Apr 2012
Posts: 121
Default

Quote:
Originally Posted by valy View Post
I'm almost certain this can at least be done with AutoHotkey
Thanks! Could you explain a bit more, please?
babiuk is offline   Reply With Quote
Old 01-14-2021, 04:42 AM   #6
valy
Human being with feelings
 
Join Date: Jan 2020
Posts: 1,556
Default

Check out what Coachz did here:

https://forum.cockos.com/showthread.php?t=247743
valy is offline   Reply With Quote
Old 01-15-2021, 06:21 AM   #7
babiuk
Human being with feelings
 
Join Date: Apr 2012
Posts: 121
Default

Quote:
Originally Posted by valy View Post
Check out what Coachz did here:

https://forum.cockos.com/showthread.php?t=247743
Thanks for link, but I guess I am dumb and don't understand it...

I need some other way maybe.


Any more ideas, please?

Last edited by babiuk; 01-15-2021 at 06:36 AM.
babiuk is offline   Reply With Quote
Old 01-15-2021, 01:54 PM   #8
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 654
Default

Quote:
Originally Posted by valy View Post
I'm almost certain this can at least be done with AutoHotkey
Not necessary. You can do it with ReaScript.
ErBird is offline   Reply With Quote
Old 01-15-2021, 01:57 PM   #9
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 654
Default

Quote:
Originally Posted by babiuk View Post
I didn’t want to guve much more info in order to ask in a simple way.
Sry, you're saying you don't want to share the name of the plugin? If you give the name and the parameter you want to control it's easy to do what you want through scripting.
ErBird is offline   Reply With Quote
Old 01-15-2021, 04:10 PM   #10
valy
Human being with feelings
 
Join Date: Jan 2020
Posts: 1,556
Default

Quote:
Originally Posted by ErBird View Post
Not necessary. You can do it with ReaScript.
hence the "at least"
valy is offline   Reply With Quote
Old 01-16-2021, 03:43 AM   #11
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 702
Default

Quote:
Originally Posted by ErBird View Post
Sry, you're saying you don't want to share the name of the plugin? If you give the name and the parameter you want to control it's easy to do what you want through scripting.
Sorry for hijacking but as you are stating this, it would be really helpful for me to have an action that presses “Import item from arrange” in reasamplomatic5000 to be used inside a custom action. Any idea how that could be done?
Phazma is online now   Reply With Quote
Old 01-16-2021, 05:37 AM   #12
babiuk
Human being with feelings
 
Join Date: Apr 2012
Posts: 121
Default

Quote:
Originally Posted by ErBird View Post
Sry, you're saying you don't want to share the name of the plugin? If you give the name and the parameter you want to control it's easy to do what you want through scripting.
Oh, no, sorry, no secret at all!

It is not an specific plugin , just one which does tape stop effect like Kilohearts one, Softube one, many ones..

When you are on playing audio on reaper and you press that button (Let us say on Kilohearts Tapestop plugin, where the button I am talking about is the classic triangle for "PLAY") sound stops like on tape machines, slowly. And if you press button again then it starts to sound slowly. It is a 2 states button.

My idea is make an action attached to a key(really they should be 2 keys) for that list of actions:


FIRST KEY FOR:

- "Start" on transport
- Pressing plugin button

That way it could start to play like on a tape machine. Of course we need to have the plugin on "off" state firstly.

SECOND KEY FOR:

- Pressing plugin button (so as to do "tape stop" effect)
- "stop" in transport.

That way I could get both start/stop effects.


Do you know how to implement this, please?
I would be so grateful.

PS: My first idea was applying this to the plugin being on "monitoring fx" rack so it does not affexct to audio renders, but I am afraid we can not control monitoring fx rack plugins, at least using "parameter link" way. So maybe it should be done using the plugin on master bus.

Last edited by babiuk; 01-16-2021 at 05:44 AM.
babiuk is offline   Reply With Quote
Old 01-18-2021, 08:42 AM   #13
babiuk
Human being with feelings
 
Join Date: Apr 2012
Posts: 121
Default

Quote:
ErBird
could you help me on this, please?
babiuk is offline   Reply With Quote
Old 01-18-2021, 04:58 PM   #14
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 654
Default

Quote:
Originally Posted by babiuk View Post
could you help me on this, please?
Yeah, let me read over your posts. I'll respond later.
ErBird is offline   Reply With Quote
Old 01-19-2021, 06:39 AM   #15
babiuk
Human being with feelings
 
Join Date: Apr 2012
Posts: 121
Default

Quote:
Originally Posted by ErBird View Post
Yeah, let me read over your posts. I'll respond later.
Of course, thanks!
babiuk is offline   Reply With Quote
Old 01-20-2021, 11:58 AM   #16
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 654
Default

Let's start simple. This is how you would toggle a parameter in the monitoring fx chain.

As far as linking the parameter change to the playback state, are you sure you want two separate actions and not one play/stop toggle?

Lua Script:
Code:
fx_name = "ggain" --Enter your fx name here
param = 0         --Enter the parameter number (Count starts at zero)

track = reaper.GetMasterTrack(0)
fx = 0x1000000 + reaper.TrackFX_AddByName(track, fx_name, 1, 0)
_, param_name = reaper.TrackFX_GetParamName(track, fx, param, "")
state = reaper.TrackFX_GetParamNormalized(track, fx, param)

if state == 0 then
  state = 1
else
  state = 0
end

reaper.TrackFX_SetParamNormalized(track, fx, param, state)
ErBird is offline   Reply With Quote
Old 01-20-2021, 12:07 PM   #17
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 654
Default

Quote:
Originally Posted by Phazma View Post
Sorry for hijacking but as you are stating this, it would be really helpful for me to have an action that presses “Import item from arrange” in reasamplomatic5000 to be used inside a custom action. Any idea how that could be done?
Have you checked out MPL's RS5k tools in ReaPack? There might be an action in there that does this.

Otherwise, I know “Import item from arrange” is possible via script.
ErBird is offline   Reply With Quote
Old 01-20-2021, 02:01 PM   #18
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 702
Default

Quote:
Originally Posted by ErBird View Post
Have you checked out MPL's RS5k tools in ReaPack? There might be an action in there that does this.

Otherwise, I know “Import item from arrange” is possible via script.
Yes I have messed more thoroughly with those some months ago and I remember that they did not work for my purpose. Probably it was because he only has scripts for importing to an RS5k instance on a track while I need to import to RS5k on an item. Here is a video of what I am doing:

https://vimeo.com/502766290

I wouldn't go into the details of what I am doing and why I am doing it this way because it would require a lengthy explanation (and I know there are alternatives but this still works best for me).

However if it was possible to have a script that works with items and

clicks "import item from arrange" in currently visible instance of RS5K and closes the FX chain window

I could merge my custom action with "Take: Switch items to next take" and the whole thing would work with one click and as I use this custom action quite often my workflow would feel smoother.

Btw. I guess the closing of the FX chain would also work with "SWS/S&M: Close all FX chain windows" as part of the custom action after this script, so probably all I really need is actually just

Script: click "import item from arrange" in currently visible instance of RS5K
Phazma is online now   Reply With Quote
Old Yesterday, 10:53 AM   #19
babiuk
Human being with feelings
 
Join Date: Apr 2012
Posts: 121
Default

Quote:
Originally Posted by ErBird View Post
Let's start simple. This is how you would toggle a parameter in the monitoring fx chain.

As far as linking the parameter change to the playback state, are you sure you want two separate actions and not one play/stop toggle?

Lua Script:
Code:
fx_name = "ggain" --Enter your fx name here
param = 0         --Enter the parameter number (Count starts at zero)

track = reaper.GetMasterTrack(0)
fx = 0x1000000 + reaper.TrackFX_AddByName(track, fx_name, 1, 0)
_, param_name = reaper.TrackFX_GetParamName(track, fx, param, "")
state = reaper.TrackFX_GetParamNormalized(track, fx, param)

if state == 0 then
  state = 1
else
  state = 0
end

reaper.TrackFX_SetParamNormalized(track, fx, param, state)
Thanks, Erbird,

I have been trying to do it, my first time...
I copy that and paste into texedit and save as txt, later I change name to .lua file, yes?

I do it without altering your code, I loaded ggain plugin on masterbus and then went to action list and imported the lua file, reaper recognized lua script but when I clicked on run nothing happens. I tried changing the paramenter number (I mean "param = 0", I wrote 1 on first test later 2 and later 3) by deleting the lua file aqnd creating a new one with a different number and importing again (and I deleted the lua script on reaper action list before, every time).
BUt it does not do anything.

I am sure I am doing things badly, could you tell me what I am wrong on, please?
babiuk is offline   Reply With Quote
Old Yesterday, 11:01 AM   #20
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 654
Default

That's weird, idk.
You can paste the text within reaper. In the action list, click new action, new Reascript.

And this will work for any plugin if you change "ggain" to something else. The parameter list is found by clicking the UI button in top right of your VST window.
ErBird is offline   Reply With Quote
Old Yesterday, 11:06 AM   #21
ErBird
Human being with feelings
 
Join Date: Jan 2017
Location: Los Angeles
Posts: 654
Default

Quote:
Originally Posted by babiuk View Post
I loaded ggain plugin on masterbus
This is the problem I think.

The script acts on the monitoring fx. Either put ggain there or to act on the master bus, change this line:

Code:
fx = 0x1000000 + reaper.TrackFX_AddByName(track, fx_name, 1, 0)
to
Code:
fx = reaper.TrackFX_AddByName(track, fx_name, 0, 0)
If that works, it's just a couple more lines to control stop/start.

Last edited by ErBird; Yesterday at 11:13 AM.
ErBird is offline   Reply With Quote
Old Yesterday, 12:31 PM   #22
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 702
Default

Quote:
Originally Posted by Phazma View Post
Script: click "import item from arrange" in currently visible instance of RS5K (valid for item FX)
Hey ErBird, any chance you might also help me with this one or is that rather time-consuming to do?
Phazma is online now   Reply With Quote
Old Yesterday, 12:32 PM   #23
babiuk
Human being with feelings
 
Join Date: Apr 2012
Posts: 121
Default

Quote:
Originally Posted by ErBird View Post
This is the problem I think.

The script acts on the monitoring fx. Either put ggain there or to act on the master bus, change this line:

Code:
fx = 0x1000000 + reaper.TrackFX_AddByName(track, fx_name, 1, 0)
to
Code:
fx = reaper.TrackFX_AddByName(track, fx_name, 0, 0)
If that works, it's just a couple more lines to control stop/start.
thank you so much, I will do it now
babiuk is offline   Reply With Quote
Old Yesterday, 12:40 PM   #24
babiuk
Human being with feelings
 
Join Date: Apr 2012
Posts: 121
Default

Wow!!!

it works now with ggain, I saw that list of parameters on UI menu just shows gain while in "learn" menu you have gain, bypass and wet with numbers 0,1 and 2 as I have tested.

Now I will try to do it with other plugin, I will tell you right now. Thanks!!
babiuk is offline   Reply With Quote
Old Yesterday, 01:14 PM   #25
babiuk
Human being with feelings
 
Join Date: Apr 2012
Posts: 121
Default

Thanks a lot, it worked with Softube's Tape plugin.


Now what would next step be? My goal is setting a key as play/stop (like space is right now, is it was space then it would be better!) so when I press it then it does play/sstop thing pluds this plugin toogling.

I have just add a key for that action, so when I press it the script runs, but now I would need something extra which joins "script" and "play/stop" thing.

There should be a little delay time when stopping, between "script" and "stop" instructions so the fade out (which the plugin does from script's call) is listened and then stop acts, no need to be an exact delay(0,5s or more is ok)

And same about when starting to play, I mean first "play" and then "script"(because once "play" starts script makes the fade in)

Here you have a link to the screen video I made showing it works:

https://gofile.io/d/sOO3RL

Last edited by babiuk; Yesterday at 01:33 PM.
babiuk 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 03:11 AM.


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