Old 10-14-2021, 12:13 PM   #1
Reflected
Human being with feelings
 
Reflected's Avatar
 
Join Date: Jul 2009
Posts: 3,295
Default FR: FX Window - prefix (vst3, vsti, vst....) remover

Since 2009 I'm looking for away to remove these VSTx/JS prefixes from the fx in the fx window.
Unfortunately, I lost hope in our devs...

can this be done with a script?

something like:
*remove all type prefixes from selected plugins (anything before and include the Colon ":")
*remove all type prefixes from the plugins in the select tracks

please help

Reflected is online now   Reply With Quote
Old 10-14-2021, 12:48 PM   #2
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

With latest addition to reaper that seems possible without fragile workarounds.
mpl is offline   Reply With Quote
Old 10-14-2021, 01:46 PM   #3
Reflected
Human being with feelings
 
Reflected's Avatar
 
Join Date: Jul 2009
Posts: 3,295
Default

Quote:
Originally Posted by mpl View Post
With latest addition to reaper that seems possible without fragile workarounds.
sounds great to me
but how?
Reflected is online now   Reply With Quote
Old 10-14-2021, 09:50 PM   #4
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Sorry, it seems not working, my bad.
I was expecting reaper.TrackFX_SetNamedConfigParm(track, fx-1, 'fx_name', buf) set FX name but it is not.
Here is feature requiest I made.
However you can try chunking like this (that was I meant by "fragile workarounds"):

Code:
  function main()
    retval, tracknumber, itemnumber, fxnumber = reaper.GetFocusedFX2()
    if retval == 0 then return end
    if tracknumber < 0 then return end
    if tracknumber == 0 then track = reaper.GetMasterTrack(0) else track = reaper.GetTrack(0,tracknumber-1)end
    if not track then return end
    for fx = 1,  reaper.TrackFX_GetCount( track ) do
      local retval,  buf = reaper.TrackFX_GetNamedConfigParm(track, fx-1, 'fx_name')
      if buf:match('[%d%a]+%:%s.*') then
        buf = buf:match('[%d%a]+%:%s(.*)')
        --reaper.TrackFX_SetNamedConfigParm(track, fx-1, 'fx_name', buf)
        SetFXName(track, fx-1, buf)
      end 
    end
  end
  
  -----------------------------------------------------------------------
  function SetFXName(track, fx, new_name)
    if not new_name then return end
    local edited_line,edited_line_id, segm
    -- get ref guid
      if not track or not tonumber(fx) then return end
      local FX_GUID = reaper.TrackFX_GetFXGUID( track, fx )
      if not FX_GUID then return else FX_GUID = FX_GUID:gsub('-',''):sub(2,-2) end
      local plug_type = reaper.TrackFX_GetIOSize( track, fx )
    -- get chunk t
      local retval, chunk = reaper.GetTrackStateChunk( track, '', false )
      local t = {} for line in chunk:gmatch("[^\r\n]+") do t[#t+1] = line end
    -- find edit line
      local search
      for i = #t, 1, -1 do
        local t_check = t[i]:gsub('-','')
        if t_check:find(FX_GUID) then search = true  end
        if t[i]:find('<') and search and not t[i]:find('JS_SER') then
          edited_line = t[i]:sub(2)
          edited_line_id = i
          break
        end
      end
    -- parse line
      if not edited_line then return end
      local t1 = {}
      for word in edited_line:gmatch('[%S]+') do t1[#t1+1] = word end
      local t2 = {}
      for i = 1, #t1 do
        segm = t1[i]
        if not q then t2[#t2+1] = segm else t2[#t2] = t2[#t2]..' '..segm end
        if segm:find('"') and not segm:find('""') then if not q then q = true else q = nil end end
      end
  
      if plug_type == 2 then t2[3] = '"'..new_name..'"' end -- if JS
      if plug_type == 3 then t2[5] = '"'..new_name..'"' end -- if VST
  
      local out_line = table.concat(t2,' ')
      t[edited_line_id] = '<'..out_line
      local out_chunk = table.concat(t,'\n')
      --msg(out_chunk)
      reaper.SetTrackStateChunk( track, out_chunk, false )
  end 
  -----------------------------------------------------------------------  
  main()

Last edited by mpl; 10-14-2021 at 11:42 PM.
mpl is offline   Reply With Quote
Old 10-15-2021, 11:02 AM   #5
Reflected
Human being with feelings
 
Reflected's Avatar
 
Join Date: Jul 2009
Posts: 3,295
Default

Quote:
Originally Posted by mpl View Post
Sorry, it seems not working, my bad.
I was expecting reaper.TrackFX_SetNamedConfigParm(track, fx-1, 'fx_name', buf) set FX name but it is not.
Here is feature requiest I made.
I see..
thanks for trying to help!

Quote:
However you can try chunking like this (that was I meant by "fragile workarounds"):

Code:
  function main()
    retval, tracknumber, itemnumber, fxnumber = reaper.GetFocusedFX2()
    if retval == 0 then return end
    if tracknumber < 0 then return end
    if tracknumber == 0 then track = reaper.GetMasterTrack(0) else track = reaper.GetTrack(0,tracknumber-1)end
    if not track then return end
    for fx = 1,  reaper.TrackFX_GetCount( track ) do
      local retval,  buf = reaper.TrackFX_GetNamedConfigParm(track, fx-1, 'fx_name')
      if buf:match('[%d%a]+%:%s.*') then
        buf = buf:match('[%d%a]+%:%s(.*)')
        --reaper.TrackFX_SetNamedConfigParm(track, fx-1, 'fx_name', buf)
        SetFXName(track, fx-1, buf)
      end 
    end
  end
  
  -----------------------------------------------------------------------
  function SetFXName(track, fx, new_name)
    if not new_name then return end
    local edited_line,edited_line_id, segm
    -- get ref guid
      if not track or not tonumber(fx) then return end
      local FX_GUID = reaper.TrackFX_GetFXGUID( track, fx )
      if not FX_GUID then return else FX_GUID = FX_GUID:gsub('-',''):sub(2,-2) end
      local plug_type = reaper.TrackFX_GetIOSize( track, fx )
    -- get chunk t
      local retval, chunk = reaper.GetTrackStateChunk( track, '', false )
      local t = {} for line in chunk:gmatch("[^\r\n]+") do t[#t+1] = line end
    -- find edit line
      local search
      for i = #t, 1, -1 do
        local t_check = t[i]:gsub('-','')
        if t_check:find(FX_GUID) then search = true  end
        if t[i]:find('<') and search and not t[i]:find('JS_SER') then
          edited_line = t[i]:sub(2)
          edited_line_id = i
          break
        end
      end
    -- parse line
      if not edited_line then return end
      local t1 = {}
      for word in edited_line:gmatch('[%S]+') do t1[#t1+1] = word end
      local t2 = {}
      for i = 1, #t1 do
        segm = t1[i]
        if not q then t2[#t2+1] = segm else t2[#t2] = t2[#t2]..' '..segm end
        if segm:find('"') and not segm:find('""') then if not q then q = true else q = nil end end
      end
  
      if plug_type == 2 then t2[3] = '"'..new_name..'"' end -- if JS
      if plug_type == 3 then t2[5] = '"'..new_name..'"' end -- if VST
  
      local out_line = table.concat(t2,' ')
      t[edited_line_id] = '<'..out_line
      local out_chunk = table.concat(t,'\n')
      --msg(out_chunk)
      reaper.SetTrackStateChunk( track, out_chunk, false )
  end 
  -----------------------------------------------------------------------  
  main()
I must be missing something
I created new action using this script but nothing happens
Reflected is online now   Reply With Quote
Old 10-15-2021, 11:49 AM   #6
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Navigate any plugin in chain to make it focused before executing script.
mpl is offline   Reply With Quote
Old 10-15-2021, 12:21 PM   #7
Reflected
Human being with feelings
 
Reflected's Avatar
 
Join Date: Jul 2009
Posts: 3,295
Default

Quote:
Originally Posted by mpl View Post
Navigate any plugin in chain to make it focused before executing script.
I tried it also with hotkey and by running it from the actions window by pressing Run
nothing happens

https://ibb.co/y5jBg46
Reflected is online now   Reply With Quote
Old 10-15-2021, 12:29 PM   #8
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Close reascript in IDE before executing from action list?
mpl is offline   Reply With Quote
Old 10-15-2021, 12:36 PM   #9
Reflected
Human being with feelings
 
Reflected's Avatar
 
Join Date: Jul 2009
Posts: 3,295
Default

Quote:
Originally Posted by mpl View Post
Close reascript in IDE before executing from action list?
same
nothing happens

FWIW, I'm running reaper portable v6.36+dev0924 as admin


EDIT: updating to v6/37+dev 1015 solved the problem

Thank you so much MPL, once again! <3

Last edited by Reflected; 10-15-2021 at 12:49 PM.
Reflected is online now   Reply With Quote
Old 10-15-2021, 12:54 PM   #10
Reflected
Human being with feelings
 
Reflected's Avatar
 
Join Date: Jul 2009
Posts: 3,295
Default

is it possible to apply it for all tracks at the same time?

and btw is it possible to remove the "(company)" suffix?

so instead of this:




we will have something like this:
Reflected is online now   Reply With Quote
Old 10-16-2021, 07:14 AM   #11
cool
Human being with feelings
 
Join Date: Dec 2017
Location: Sunny Siberian Islands
Posts: 962
Default

Quote:
Originally Posted by Reflected View Post
is it possible to apply it for all tracks at the same time?

and btw is it possible to remove the "(company)" suffix?

so instead of this:




we will have something like this:

Yes. Just rename FX by right mouse click.
cool is online now   Reply With Quote
Old 04-19-2023, 12:28 PM   #12
Reflected
Human being with feelings
 
Reflected's Avatar
 
Join Date: Jul 2009
Posts: 3,295
Default

is it possible to update the action to work for the plugins inside containers too?
Reflected is online now   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 11:40 AM.


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