01-27-2018, 09:20 AM | #1 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Does toggle button work with a custom script?
Hey all,
I have a Steinberg CMC-CH and I'm just diving into OSCIIBot. So far, I am able to turn on and off the light of a button But before I continue, here the following info: - there is an "open VST instrument" button on the device - I have a script, that looks for the first VST instrument on a track and toggles open and close of the GUI I would like to know if this is possible: - when I select a track, that shows the VST instrument GUI, I would like the "open VST instrument" button light turned on. And when I press the button, the GUI should disappear and turn off the light as well. Now, I'm not quite sure, if this can be achieved. Does my LUA script need a toggle, so that Reaper can send a "VST instrument is not showing"?
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-27-2018, 10:13 AM | #2 |
Human being with feelings
Join Date: Feb 2016
Posts: 189
|
One probably does need to identify & follow whether or not the FX Gui is opened or not, so one would use a toggle, as in storing the state within the OSCII-bot EEL script. If the script follows this, then the opening and closing and LED switching can all be controlled from the EEL script.
See this post from Erriez https://forum.cockos.com/showpost.ph...84&postcount=2 that should be helpful. The useful hints here helped implementstion of the instrument mode for the MIDIMIX control surface which opens selected FX/instruments on a track, so looking at its script may help. |
01-27-2018, 10:16 AM | #3 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Thanks goldenarpharazon! That's really good news. Will check out that thread.
I'm studying your MIDIMix script. Thanks for that one! I'm familiar with LUA, but EEL2 was new to me. Now that I know what "?" and ":" means, it all makes way more sense to me
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-29-2018, 12:22 PM | #4 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
I'm pretty far already, but I somehow can't solve this problem.
My button action looks like this: Code:
msg1 == 0x90 ? + msg2 == 0x2d + msg3 == 0x7F ? // if VST instrument button is pressed ( oscmatch("/fxinst/openui") + oscparm(0, f) == 0 ? // if VST instrument GUI is closed oscsend(osc_out, "b/fxinst/openui", 1) // open VST instrument GUI ); (pseudo code) Code:
if button is pressed if /fxinst/openui and oscparm(0,f) == 0 open VSTi GUI elseif /fxinst/openui and oscparm(0,f) == 1 close VSTi GUI
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-29-2018, 02:18 PM | #5 |
Human being with feelings
Join Date: Feb 2016
Posts: 189
|
Reckon it might need splitting into two separate code blocks, one to process midi inputs, one to process the OSC feedback from Reaper with a single flag UIopen that tracks the GUI state.
Loosely in pseudo code something like Code:
@midimsg if button is pressed if UIopen close VSTi GUI else open VSTi GUI @oscmsg if /fxinst/openui if oscparm(0,f) == 0 UIopen=false // it is closed if oscparm(0,f) == 1 UIopen=true // it is open |
01-29-2018, 03:34 PM | #6 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
That worked, awesome, thanks a lot!!!
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
01-29-2018, 10:41 PM | #7 | |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,785
|
Quote:
Are there really other values but 0 and 1 ? Else : @osemsg UIopen=oscparm(0,f); -Michael |
|
01-30-2018, 11:08 AM | #8 |
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Yep, that's how I did it
__________________
My Reascripts forum thread | My Reascripts on GitHub If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom |
Thread Tools | |
Display Modes | |
|
|