Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 03-03-2021, 02:40 AM   #1
bhuether
Human being with feelings
 
Join Date: Nov 2016
Posts: 226
Default Remove Silence action - executable from script with no popup?

Hi,

Curious if there is any way to run the Remove Silence action on an item such that no pop up comes up. So, using some set default settings.

thanks
bhuether is offline   Reply With Quote
Old 03-03-2021, 04:49 AM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,901
Default

Edgemeal has posted a code snippet on the forum for auto closing the popup after it opens (which is the best we can do from reascript). You have to find the right keyword to find it :P

EDIT:
Ok I found the code on my script folder but not the thread


Code:
function auto_trim()
  local parent = reaper.JS_Window_FindTop('Auto trim/split items',true) 
  if parent then
    local btn = reaper.JS_Window_FindChild(parent,"Process",true)
    reaper.JS_WindowMessage_Send(btn, "WM_LBUTTONDOWN", 1, 0, 0, 0)
    reaper.JS_WindowMessage_Send(btn, "WM_LBUTTONUP", 0, 0, 0, 0)
  else
    reaper.defer(auto_trim)
  end
end

auto_trim()
reaper.JS_WindowMessage_Post(reaper.GetMainHwnd(), "WM_COMMAND", 40315,0,0,0)

Create a lua script from action list, and put the code in there, then CTRL+S.
X-Raym is offline   Reply With Quote
Old 03-03-2021, 05:57 AM   #3
bhuether
Human being with feelings
 
Join Date: Nov 2016
Posts: 226
Default

Great, will try this out! thanks!
bhuether is offline   Reply With Quote
Old 03-03-2021, 07:53 AM   #4
bhuether
Human being with feelings
 
Join Date: Nov 2016
Posts: 226
Default

Do you know if there is a way to specify the default values? Maybe they are in some ini file somewhere or as accessible ExtState data?
bhuether is offline   Reply With Quote
Old 03-03-2021, 08:21 AM   #5
bhuether
Human being with feelings
 
Join Date: Nov 2016
Posts: 226
Default

Ok, so in reaper.ini I found these params:

Code:
tsi_flags=48
tsi_lead=3
tsi_minnonsil=5000
tsi_minsil=5000
tsi_snappk=50
tsi_thr=0.06237348
tsi_thrhyst=1.00000000
tsi_trail=3
These are what determine the remove silence operation. Would be pretty great if there was a flag setting to have it operate without dialog window...
bhuether is offline   Reply With Quote
Old 03-03-2021, 02:27 PM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,901
Default

There is functions to change any rea0er ini files key = value, I let you explore the API doc and forum for that,


Cheers !
X-Raym is offline   Reply With Quote
Old 03-03-2021, 03:08 PM   #7
bhuether
Human being with feelings
 
Join Date: Nov 2016
Posts: 226
Default

Yeah, I know I can use the PrivateProfileString functions, just too bad they only reflect the change on Reaper restart...

That said, I don't see indication that this particular action's window can be closed automatically. Read in other threads (including one you were referring to I think) that this particular action is a bit of an odd one, doesn't lend itself to being closed by script.

In that case, would be great if Reaper added an API function for silence removal...
bhuether is offline   Reply With Quote
Old 02-20-2022, 03:05 PM   #8
Infrabass
Human being with feelings
 
Join Date: Apr 2014
Posts: 398
Default

I cant make it work.
Do you know if it should be OK on MacOS?

It seems the Auto split window is pausing the reascript and wait for an user action before finishing the script.
Infrabass 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 08:07 AM.


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