Old 03-19-2024, 01:04 PM   #1
Subz
Human being with feelings
 
Subz's Avatar
 
Join Date: Jun 2006
Location: UK
Posts: 3,210
Default A script to toggle 'Anticipative FX Processing' ?

Hi All,

anybody know of a script or action to toggle "Anticipative FX Processing"

Subz
Subz is offline   Reply With Quote
Old 03-19-2024, 03:45 PM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

"Allow anticipative FX processing when rendering (better multiprocessing)"

Code:
-- Meo-Ada Mespotine 2024 - licensed under MIT-license
-- toggles "Allow anticipative FX processing when rendering (better multiprocessing)"-setting
value = reaper.SNM_GetIntConfigVar("workrender", -9)
if value&1024==0 then 
  value=value+1024
elseif value&1024==1024 then 
  value=value-1024
end
value = reaper.SNM_SetIntConfigVar("workrender", value)
or "Anticipative FX processing - superior multiprocessing and lower interface latencies"?

Code:
-- Meo-Ada Mespotine 2024 - licensed under MIT-license
-- toggles "Anticipative FX processing - superior multiprocessing and lower interface latencies"-setting

value = reaper.SNM_GetIntConfigVar("workrender", -9)
if value&1==0 then 
  value=value+1 
elseif value&1==1 then 
  value=value-1
end
value = reaper.SNM_SetIntConfigVar("workrender", value)
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 03-19-2024 at 03:57 PM.
Meo-Ada Mespotine is online now   Reply With Quote
Old 03-19-2024, 08:53 PM   #3
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Can be greatly simplified:

Code:
local workrender = reaper.SNM_GetIntConfigVar('workrender', 0)
reaper.SNM_SetIntConfigVar("workrender", workrender ~ 1024)
cfillion is offline   Reply With Quote
Old 03-20-2024, 11:41 AM   #4
Subz
Human being with feelings
 
Subz's Avatar
 
Join Date: Jun 2006
Location: UK
Posts: 3,210
Default

Hi and Thank You!!

What format do I save these as? And where do I put them?

Scripts? Then load as new script?

I did try them as a new script, but they did not seem to work,

Subz
Subz is offline   Reply With Quote
Old 03-20-2024, 11:45 AM   #5
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Action List > ReaScript: New > Something.lua. Also you'll only see it change in Preferences the next time the window is open.
cfillion is offline   Reply With Quote
Old 03-20-2024, 12:19 PM   #6
Subz
Human being with feelings
 
Subz's Avatar
 
Join Date: Jun 2006
Location: UK
Posts: 3,210
Default

Quote:
"Anticipative FX processing - superior multiprocessing and lower interface latencies"?

Code:
-- Meo-Ada Mespotine 2024 - licensed under MIT-license
-- toggles "Anticipative FX processing - superior multiprocessing and lower interface latencies"-setting

value = reaper.SNM_GetIntConfigVar("workrender", -9)
if value&1==0 then 
  value=value+1 
elseif value&1==1 then 
  value=value-1
end
value = reaper.SNM_SetIntConfigVar("workrender", value)
This works perfect!

Thank You!

Is there a way I can get the toolbar icon to 'animate' when it's disabled?

Subz
Subz is offline   Reply With Quote
Old 03-20-2024, 12:21 PM   #7
Subz
Human being with feelings
 
Subz's Avatar
 
Join Date: Jun 2006
Location: UK
Posts: 3,210
Default

Quote:
Originally Posted by cfillion View Post
Can be greatly simplified:

Code:
local workrender = reaper.SNM_GetIntConfigVar('workrender', 0)
reaper.SNM_SetIntConfigVar("workrender", workrender ~ 1024)
Thanks for the advice!

This script doesn't seem to work?!

The one posted above is doing the job though!

Thank You!

Subz
Subz is offline   Reply With Quote
Old 03-20-2024, 01:38 PM   #8
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

It's for "Allow anticipative FX processing when rendering (better multiprocessing)". Replace 1024 by 1 to be like the other one.
cfillion is offline   Reply With Quote
Old 03-20-2024, 03:22 PM   #9
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by Subz View Post
This works perfect!

Thank You!

Is there a way I can get the toolbar icon to 'animate' when it's disabled?

Subz
This needs to be set in the menu-editor for the toolbar-icon. You need to choose a toolbar-icon, that includes an animation.
But can't help you much with that, since I haven't had the time to really look into toolbar-animations yet.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is online now   Reply With Quote
Old 03-20-2024, 03:23 PM   #10
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by cfillion View Post
Can be greatly simplified:

Code:
local workrender = reaper.SNM_GetIntConfigVar('workrender', 0)
reaper.SNM_SetIntConfigVar("workrender", workrender ~ 1024)
What's the descriptive term for ~ you used in the code?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is online now   Reply With Quote
Old 03-20-2024, 09:47 PM   #11
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

XOR
cfillion is offline   Reply With Quote
Old 03-21-2024, 03:55 AM   #12
Subz
Human being with feelings
 
Subz's Avatar
 
Join Date: Jun 2006
Location: UK
Posts: 3,210
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
This needs to be set in the menu-editor for the toolbar-icon. You need to choose a toolbar-icon, that includes an animation.
But can't help you much with that, since I haven't had the time to really look into toolbar-animations yet.
I have set it up the same way my other animated buttons are set up,

I notice some actions just don't report the toggle state,


Subz
Subz is offline   Reply With Quote
Old 03-21-2024, 02:30 PM   #13
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Ah, got it.

This should work:

Code:
-- Meo-Ada Mespotine 2024 - licensed under MIT-license
-- toggles "Anticipative FX processing - superior multiprocessing and lower interface latencies"-setting

local a,b,c,d = reaper.get_action_context()

value = reaper.SNM_GetIntConfigVar("workrender", -9)
if value&1==0 then 
  value=value+1 
  reaper.SetToggleCommandState(d, 1)
elseif value&1==1 then 
  value=value-1
  reaper.SetToggleCommandState(d, 1)
end
value = reaper.SNM_SetIntConfigVar("workrender", value)
You might need to toggle it once after Reaper start for the toggle state to be correct.

It's possible to correctly set the toggle state at Reaper startup automatically, but for this, I need the action-command-id of your action. You can get it by right-clicking the action in the actionlist and selecting "Copy selected action command id".
Paste this in here as reply and I give you instructions on how to set it up.

@cfillion
Thnx. I wonder, if this could be used for setting toggle-state as well. But probably only by doing something like:
Code:
reaper.SetToggleCommandID(cmdid, reaper.SNM_GetIntConfigVar("workrender", -9)&1)
or something in this case.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is online now   Reply With Quote
Old 03-21-2024, 03:12 PM   #14
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Thnx. I wonder, if this could be used for setting toggle-state as well. But probably only by doing something like:
Code:
reaper.SetToggleCommandID(cmdid, reaper.SNM_GetIntConfigVar("workrender", -9)&1)
or something in this case.
Yeah.

Code:
local command_id = select(5, reaper.get_action_context())
local workrender = reaper.SNM_GetIntConfigVar('workrender', 0) ~ 1
reaper.SNM_SetIntConfigVar('workrender', workrender)
reaper.SetToggleCommandState(0, command_id, workrender & 1)

Last edited by cfillion; 03-23-2024 at 12:59 AM.
cfillion is offline   Reply With Quote
Old 03-22-2024, 10:48 PM   #15
Subz
Human being with feelings
 
Subz's Avatar
 
Join Date: Jun 2006
Location: UK
Posts: 3,210
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Ah, got it.

This should work:

Code:
-- Meo-Ada Mespotine 2024 - licensed under MIT-license
-- toggles "Anticipative FX processing - superior multiprocessing and lower interface latencies"-setting

local a,b,c,d = reaper.get_action_context()

value = reaper.SNM_GetIntConfigVar("workrender", -9)
if value&1==0 then 
  value=value+1 
  reaper.SetToggleCommandState(d, 1)
elseif value&1==1 then 
  value=value-1
  reaper.SetToggleCommandState(d, 1)
end
value = reaper.SNM_SetIntConfigVar("workrender", value)
Hi & thanks for the help!

This gives me


Toggle Anticipative FX Processing.lua:12: bad argument #3 to 'SetToggleCommandState' (number expected, got no value)


Subz

EDIT: the ID of the script that I currently use and edit for this action is: _RS56f757e5f60c78f4fb698bd048d9390c6664ec18

Last edited by Subz; 03-23-2024 at 07:04 AM.
Subz 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 04:02 AM.


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