Old 05-05-2020, 03:18 AM   #1
dupont
Human being with feelings
 
dupont's Avatar
 
Join Date: Nov 2007
Location: France
Posts: 919
Default modulated parameters

a couple of days ago, reascript package was updated and I there was a usefull scipt to show all assigned envelopes and modulated parameters for all tracks.
I think it was an MPL script.
I can't no more find it in the ation menu, any ideas of this script name ?
dupont is offline   Reply With Quote
Old 05-05-2020, 10:16 AM   #2
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,960
Default

mpl_Show and arm envelopes linked to learn for selected tracks.lua

The script looks like this:
Code:
-- @description Show and arm envelopes linked to learn for selected tracks
-- @version 1.01
-- @author MPL
-- @website https://forum.cockos.com/showthread.php?t=188335
-- @changelog
--    # fix name

  function literalize(str) return str:gsub("[%(%)%.%%%+%-%*%?%[%]%^%$]", function(c) return "%" .. c end) end
  function ArmEnvLearn(tr)    
    if not tr then return end    
    local GUID = {}
    for fx = 1,  reaper.TrackFX_GetCount( tr) do GUID[#GUID+1]= reaper.TrackFX_GetFXGUID( tr, fx-1 ) end
    local _, chunk = reaper.GetTrackStateChunk(tr, '', true)
    for line in chunk:gmatch('BYPASS.-WAK') do
      if line:match('PARMLEARN') then 
        for GUID_id = 1, #GUID do
          if line:match(literalize(GUID[GUID_id])) then            
            for parid_line in line:gmatch('PARMLEARN %d+') do
              local parid = parid_line:match('%d+')
              if parid and tonumber(parid) then 
                local fxenv = reaper.GetFXEnvelope( tr, GUID_id-1, tonumber(parid), true )
                local BR_env = reaper.BR_EnvAlloc( fxenv, false )
                local _, _, _, inLane, laneHeight, defaultShape, _, _, _, _, faderScaling = reaper.BR_EnvGetProperties( BR_env )
                reaper.BR_EnvSetProperties( BR_env, true, true, true, inLane, laneHeight, defaultShape, faderScaling )
                reaper.BR_EnvFree( BR_env, true )
              end
            end            
            break
          end
        end
      end
    end    
    reaper.TrackList_AdjustWindows( false )
  end
  ---------------------------------   
  
  for i = 1, reaper.CountSelectedTracks(0) do
    local tr= reaper.GetSelectedTrack(0,i-1) 
    ArmEnvLearn(tr)
  end
As I stated here I`m trying to not use chunking anymore (and SWS API using it also), so that script also will be soon removed as potentially not stable for end users.

I`m sad I have to say this: Justin and Schwa made great work for us, developers, but evolution of REAPER via extending APIs is not their priority (you can overview tons of ignored API requests on Feature Request area or totally ignored API WishList thread). Anyway, I hope it just planned and they someday will put their attention on this.

Last edited by mpl; 05-05-2020 at 07:32 PM.
mpl is offline   Reply With Quote
Old 05-06-2020, 12:02 AM   #3
dupont
Human being with feelings
 
dupont's Avatar
 
Join Date: Nov 2007
Location: France
Posts: 919
Default

Quote:
Originally Posted by mpl View Post
mpl_Show and arm envelopes linked to learn for selected tracks.lua

The script looks like this:
Code:
-- @description Show and arm envelopes linked to learn for selected tracks
-- @version 1.01
-- @author MPL
-- @website https://forum.cockos.com/showthread.php?t=188335
-- @changelog
--    # fix name

  function literalize(str) return str:gsub("[%(%)%.%%%+%-%*%?%[%]%^%$]", function(c) return "%" .. c end) end
  function ArmEnvLearn(tr)    
    if not tr then return end    
    local GUID = {}
    for fx = 1,  reaper.TrackFX_GetCount( tr) do GUID[#GUID+1]= reaper.TrackFX_GetFXGUID( tr, fx-1 ) end
    local _, chunk = reaper.GetTrackStateChunk(tr, '', true)
    for line in chunk:gmatch('BYPASS.-WAK') do
      if line:match('PARMLEARN') then 
        for GUID_id = 1, #GUID do
          if line:match(literalize(GUID[GUID_id])) then            
            for parid_line in line:gmatch('PARMLEARN %d+') do
              local parid = parid_line:match('%d+')
              if parid and tonumber(parid) then 
                local fxenv = reaper.GetFXEnvelope( tr, GUID_id-1, tonumber(parid), true )
                local BR_env = reaper.BR_EnvAlloc( fxenv, false )
                local _, _, _, inLane, laneHeight, defaultShape, _, _, _, _, faderScaling = reaper.BR_EnvGetProperties( BR_env )
                reaper.BR_EnvSetProperties( BR_env, true, true, true, inLane, laneHeight, defaultShape, faderScaling )
                reaper.BR_EnvFree( BR_env, true )
              end
            end            
            break
          end
        end
      end
    end    
    reaper.TrackList_AdjustWindows( false )
  end
  ---------------------------------   
  
  for i = 1, reaper.CountSelectedTracks(0) do
    local tr= reaper.GetSelectedTrack(0,i-1) 
    ArmEnvLearn(tr)
  end
As I stated here I`m trying to not use chunking anymore (and SWS API using it also), so that script also will be soon removed as potentially not stable for end users.

I`m sad I have to say this: Justin and Schwa made great work for us, developers, but evolution of REAPER via extending APIs is not their priority (you can overview tons of ignored API requests on Feature Request area or totally ignored API WishList thread). Anyway, I hope it just planned and they someday will put their attention on this.
Thanks. In hope Cockos will put attention to API. You're scripts (and other developers) are a very nice addition to Reaper and it is what make it different from other DAWs.
dupont 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 09:59 AM.


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