Guest User

random.lua

a guest
Mar 2nd, 2016
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. blacklist = {'master', 'amp attack'}
  2.  
  3. function isBlacklisted(name)
  4.   blacklisted = false
  5.   for i, item in pairs(blacklist) do
  6.     if name:lower():find(item) ~= nil then
  7.       blacklisted = true
  8.     end
  9.   end
  10.   return blacklisted
  11. end
  12.  
  13. retval, tracknum, fx, paramnum = reaper.GetLastTouchedFX()
  14. if retval then
  15.   track = reaper.GetTrack(0, tracknum-1)
  16.   numparams = reaper.TrackFX_GetNumParams(track, fx)
  17.   for param = 0, numparams-3 do
  18.     r, name = reaper.TrackFX_GetParamName(track, fx, param, "")
  19.     if r then
  20.       if not isBlacklisted(name) then
  21.         reaper.TrackFX_SetParam(track, fx, param, math.random())
  22.       end
  23.     else
  24.       reaper.TrackFX_SetParam(track, fx, param, math.random())
  25.     end
  26.   end
  27. else
  28.   reaper.ShowMessageBox("Please touch any parameter of the target FX.", "Error", 0)
  29. end
Advertisement
Add Comment
Please, Sign In to add comment