|
|
|
01-13-2021, 11:48 AM
|
#1
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
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
|
|
|
01-13-2021, 03:59 PM
|
#2
|
Human being with feelings
Join Date: Aug 2015
Posts: 2,969
|
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...
|
|
|
01-13-2021, 04:35 PM
|
#3
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
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?
|
|
|
01-13-2021, 05:26 PM
|
#4
|
Human being with feelings
Join Date: Jan 2020
Posts: 1,927
|
I'm almost certain this can at least be done with AutoHotkey
|
|
|
01-13-2021, 10:32 PM
|
#5
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
Quote:
Originally Posted by valy
I'm almost certain this can at least be done with AutoHotkey
|
Thanks! Could you explain a bit more, please?
|
|
|
01-14-2021, 04:42 AM
|
#6
|
Human being with feelings
Join Date: Jan 2020
Posts: 1,927
|
|
|
|
01-15-2021, 06:21 AM
|
#7
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
Quote:
Originally Posted by valy
|
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.
|
|
|
01-15-2021, 01:54 PM
|
#8
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
Quote:
Originally Posted by valy
I'm almost certain this can at least be done with AutoHotkey
|
Not necessary. You can do it with ReaScript.
|
|
|
01-15-2021, 01:57 PM
|
#9
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
Quote:
Originally Posted by babiuk
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.
|
|
|
01-15-2021, 04:10 PM
|
#10
|
Human being with feelings
Join Date: Jan 2020
Posts: 1,927
|
Quote:
Originally Posted by ErBird
Not necessary. You can do it with ReaScript.
|
hence the "at least"
|
|
|
01-16-2021, 03:43 AM
|
#11
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Quote:
Originally Posted by ErBird
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?
|
|
|
01-16-2021, 05:37 AM
|
#12
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
Quote:
Originally Posted by ErBird
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.
|
|
|
01-18-2021, 08:42 AM
|
#13
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
could you help me on this, please?
|
|
|
01-18-2021, 04:58 PM
|
#14
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
Quote:
Originally Posted by babiuk
could you help me on this, please?
|
Yeah, let me read over your posts. I'll respond later.
|
|
|
01-19-2021, 06:39 AM
|
#15
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
Quote:
Originally Posted by ErBird
Yeah, let me read over your posts. I'll respond later.
|
Of course, thanks!
|
|
|
01-20-2021, 11:58 AM
|
#16
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
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)
|
|
|
01-20-2021, 12:07 PM
|
#17
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
Quote:
Originally Posted by Phazma
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.
|
|
|
01-20-2021, 02:01 PM
|
#18
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Quote:
Originally Posted by ErBird
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
|
|
|
01-25-2021, 10:53 AM
|
#19
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
Quote:
Originally Posted by ErBird
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?
|
|
|
01-25-2021, 11:01 AM
|
#20
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
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.
|
|
|
01-25-2021, 11:06 AM
|
#21
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
Quote:
Originally Posted by babiuk
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; 01-25-2021 at 11:13 AM.
|
|
|
01-25-2021, 12:31 PM
|
#22
|
Human being with feelings
Join Date: Jun 2019
Posts: 2,872
|
Quote:
Originally Posted by Phazma
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?
|
|
|
01-25-2021, 12:32 PM
|
#23
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
Quote:
Originally Posted by ErBird
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
|
|
|
01-25-2021, 12:40 PM
|
#24
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
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!!
|
|
|
01-25-2021, 01:14 PM
|
#25
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
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; 01-25-2021 at 01:33 PM.
|
|
|
01-26-2021, 11:07 AM
|
#26
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
I have advanced one more step.
I found a lua script for "wait x seconds before next action" made by a member called nofish, I tried it and it works.
So I have a custom action(assigned to a key) with these actions:
1 - your script for activate the plgin's parameter which makes the "tape stop" effect.
2 - action which waits for 0.5 seconds without doing anything
3 - stop in transport,
this way I can press a key for that custom action and sound slowly cease and the transport stop acts.
It seems we are closer to the end...
Wondering how to implement the start/stop thing...
|
|
|
01-26-2021, 01:49 PM
|
#27
|
Human being with feelings
Join Date: Nov 2009
Location: Montreal, Canada
Posts: 9,050
|
Quote:
Originally Posted by ErBird
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)
|
I have a couple questions about this.
-How do I find the parameter count?
I'm actually trying to get this to work to toggle a button in fabfilter Pro-L, which toggles whether the loudness goes louder or not. the 1:1 button, which basically keeps the loudness constant so you can hear what the limiter is doing.
I'm also not really sure what I'd do with these parts:
Quote:
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)
|
and
Quote:
reaper.TrackFX_SetParamNormalized(track, fx, param, state)
|
Nor what to do with the script and how to bind a key to it in reaper. I know reaper well, but not using or creating scripts so much.
__________________
Slava Ukraini
|
|
|
01-26-2021, 02:05 PM
|
#28
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
Quote:
Originally Posted by babiuk
So I have a custom action(assigned to a key) with these actions:
|
You can totally do it that way, with a custom action. I was going to trigger the start/stop within the script to ensure the tapestop and Reaper stop were always synchronized.
Question, do you like that the script is a toggle, or do you prefer two separate scripts?
|
|
|
01-26-2021, 02:18 PM
|
#29
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
Quote:
Originally Posted by ErBird
You can totally do it that way, with a custom action. I was going to trigger the start/stop within the script to ensure the tapestop and Reaper stop were always synchronized.
Question, do you like that the script is a toggle, or do you prefer two separate scripts?
|
of course, your choice is infinitely much better. Could you do it in that toogle way, please?
Synchronizing reaper stop and tapestop would be the perfection, yes, but we need it includes that 0,5 seconds of "awaiting time" between tapestop action and reaper real stop. I can not figure out how this and the start part could be implemented. I hope you find some solution.
Thanks again!
Last edited by babiuk; 01-26-2021 at 03:23 PM.
|
|
|
01-27-2021, 12:26 PM
|
#30
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
See how this works for you. The wait time is set to half-a-second and you can change it to whatever.
The script looks at the playback state of the tape plugin, toggles it, waits, then toggles Reaper's playback accordingly.
Code:
--@description Toggle FX Parameter & Playback
--User-Defined--------------------------------------------------------
fx_name = "ggain"
param = 0 --Parameter Number (Count starts at zero)
wait_time = 0.5 --Seconds
----------------------------------------------------------------------
start_time = reaper.time_precise()
track = reaper.GetMasterTrack(0)
fx = reaper.TrackFX_AddByName(track, fx_name, 0, 0) --Master Track
--fx = 0x1000000 + reaper.TrackFX_AddByName(track, fx_name, 1, 0) --Monitoring FX
state = reaper.TrackFX_GetParamNormalized(track, fx, param)
if state == 0 then
state = 1
else
state = 0
end
reaper.TrackFX_SetParamNormalized(track, fx, param, state)
function main()
current_time = reaper.time_precise()
elapsed_time = current_time - start_time
if elapsed_time < wait_time then
reaper.defer(main)
else
if state == 1 then
reaper.Main_OnCommand(1007, 0) --Action "Transport: Play"
else
reaper.Main_OnCommand(1016, 0) --Action "Transport: Stop"
end
end
end
main()
|
|
|
01-27-2021, 12:46 PM
|
#31
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
Thanks!
It does not work now.
I see that line 11,37 is 0 and in the old script it was 1.
Anyway I tried changing it to 1 but no luck. It does not affect to the plugin at all.
Maybe it is not calling or talking to the plugin?
I can see that when I run script it does nothing.
If I press space to play and after that I press run script then the result is that in 0.5 seconds audio stops. But without doing plugin thing.
And this is that way whatever it is the initial state of the plugin parameter
Last edited by babiuk; 01-27-2021 at 12:53 PM.
|
|
|
01-27-2021, 12:50 PM
|
#32
|
Human being with feelings
Join Date: Jan 2017
Location: Los Angeles
Posts: 1,161
|
I put in 2 "fx = " lines so you can pick either master track or monitoring fx.
The -- at the start of the line deactivates that line.
So change
Code:
fx = reaper.TrackFX_AddByName(track, fx_name, 0, 0) --Master Track
--fx = 0x1000000 + reaper.TrackFX_AddByName(track, fx_name, 1, 0) --Monitoring FX
to
--fx = reaper.TrackFX_AddByName(track, fx_name, 0, 0) --Master Track
fx = 0x1000000 + reaper.TrackFX_AddByName(track, fx_name, 1, 0) --Monitoring FX
|
|
|
01-27-2021, 02:59 PM
|
#33
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
Quote:
Originally Posted by ErBird
I put in 2 "fx = " lines so you can pick either master track or monitoring fx.
The -- at the start of the line deactivates that line.
So change
Code:
fx = reaper.TrackFX_AddByName(track, fx_name, 0, 0) --Master Track
--fx = 0x1000000 + reaper.TrackFX_AddByName(track, fx_name, 1, 0) --Monitoring FX
to
--fx = reaper.TrackFX_AddByName(track, fx_name, 0, 0) --Master Track
fx = 0x1000000 + reaper.TrackFX_AddByName(track, fx_name, 1, 0) --Monitoring FX
|
ok!!!! Infinite thanks!!!
I didn´t know it. I just changed it and it works!
the only thing missing is when Starting to play, it does not do the tape/start effect (increasing rate and volume, like the opposite to when tape stopping). That would need (I guess) first starting and then changing the state of plugin. No?
Last edited by babiuk; 01-29-2021 at 01:09 AM.
|
|
|
01-28-2021, 12:57 PM
|
#34
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
I have seen that "start/play" part of my process does not need a delay, the only important thing is the order: first transport:start and then plugin's action. No need to be delayed each other (while stop part does need it as you successfully did).
I have been trying to do it by myself playing with the code like a monkey but no success
|
|
|
01-29-2021, 12:34 AM
|
#35
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
I got it!
I placed a order to play just into first loop, when script verifies if state is 0, this way if it is zero then reaper stars to play and after that changes states to 1 so plugin effect happens and I get the "tape start" thing!
if state == 0 then
reaper.Main_OnCommand(1007, 0) --Action "Transport: Play"<-----HERE!!!!
state = 1
else
state = 0
end
So I think it is finished, nevertheless I would like you to take a look on it because maybe it is not the cleverest idea or maybe you found other way much more efficent.
Last edited by babiuk; 01-29-2021 at 01:10 AM.
|
|
|
02-03-2021, 05:10 AM
|
#36
|
Human being with feelings
Join Date: Jan 2013
Posts: 1,126
|
Not sure but I think all of this could be done without any plugin, but by simply modulating Reaper’s playrate
|
|
|
02-03-2021, 10:30 AM
|
#37
|
Human being with feelings
Join Date: Apr 2012
Posts: 140
|
Quote:
Originally Posted by lexaproductions
Not sure but I think all of this could be done without any plugin, but by simply modulating Reaper’s playrate
|
thanks,
but how could you do that?
|
|
|
02-03-2021, 11:18 AM
|
#38
|
Human being with feelings
Join Date: Jan 2013
Posts: 1,126
|
I would assume to make a ramp in/ramp out script and then assign it to your play/stop action.
A bit like a fade in/out script that would use a deferred function. I never tried it but I’m pretty sure it would work.
|
|
|
02-12-2022, 09:39 AM
|
#39
|
Human being with feelings
Join Date: Sep 2019
Posts: 1,134
|
Quote:
Originally Posted by Phazma
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
|
In case the quest hasn't been satisfied yet, check out this script in ReaPack
Quote:
Create pitch-rate (vari-speed) take envelope and render to new take
|
It imports an item to the only RS5k instance in the take FX chain, not to the focused one, but changing that and following by closing the chain shouldn't be difficult.
Thanks for the idea of using Macro controller plugin by Jon Tidey which i spotted in your video.
|
|
|
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 03:59 PM.
|