Old 02-22-2021, 09:55 AM   #2401
Pink Wool
Human being with feelings
 
Pink Wool's Avatar
 
Join Date: Apr 2020
Posts: 294
Default

Quote:
Originally Posted by MusoBob View Post
You can look for a selected track and insert it the FX in it or this is out of another script to insert new track and add FX.
Code:
      commandID1 = reaper.NamedCommandLookup("_XENAKIOS_INSNEWTRACKTOP") -- Xenakios/SWS: Insert new track at the top of track list
      reaper.Main_OnCommand(commandID1, 0) -- Xenakios/SWS: Insert new track at the top of track list
      
      seltrack = reaper.GetTrack( 0, 0 )
      
      reaper.SetTrackSelected( seltrack, 1 )
      
      seltrack = reaper.GetSelectedTrack2( 0, 0, 1 )
      
      reaper.TrackFX_AddByName( seltrack, "ReaTrak note-counter.jsfx", 0, -1 )
I'm afraid I don't know how to combine this with "look for selected track" as you put it? Help?
Pink Wool is online now   Reply With Quote
Old 02-22-2021, 03:11 PM   #2402
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 1,866
Default

Try this:
Code:
 track_count = reaper.CountTracks(0)
 
 if track_count > 0 then
   seltrack = reaper.GetSelectedTrack(0,0)
   
   seltrack = reaper.GetSelectedTrack2( 0, 0, 1 )
   
   if not seltrack then
     reaper.MB( "Select Track", "Track ?", 0 )
     goto finish
   end
   reaper.TrackFX_AddByName( seltrack, "audio_statistics", 0, -1 )
   
 else
 
   reaper.Main_OnCommand(40001, 0) -- Track: Insert new track
         
   seltrack = reaper.GetSelectedTrack2( 0, 0, 1 )
         
   reaper.TrackFX_AddByName( seltrack, "audio_statistics", 0, -1 )
 end   
 
 ::finish::
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
MusoBob is offline   Reply With Quote
Old 02-22-2021, 11:31 PM   #2403
Pink Wool
Human being with feelings
 
Pink Wool's Avatar
 
Join Date: Apr 2020
Posts: 294
Default

Quote:
Originally Posted by MusoBob View Post
Try this:
Code:
 track_count = reaper.CountTracks(0)
 
 if track_count > 0 then
   seltrack = reaper.GetSelectedTrack(0,0)
   
   seltrack = reaper.GetSelectedTrack2( 0, 0, 1 )
   
   if not seltrack then
     reaper.MB( "Select Track", "Track ?", 0 )
     goto finish
   end
   reaper.TrackFX_AddByName( seltrack, "audio_statistics", 0, -1 )
   
 else
 
   reaper.Main_OnCommand(40001, 0) -- Track: Insert new track
         
   seltrack = reaper.GetSelectedTrack2( 0, 0, 1 )
         
   reaper.TrackFX_AddByName( seltrack, "audio_statistics", 0, -1 )
 end   
 
 ::finish::

Hey! Thanks! It seems the add new track function works only the first time though. Is there a way that it wouldn't be dependent on the track count? So that it would ALWAYS (when used) add a new track and put the fx on it, if no track was selected?
Pink Wool is online now   Reply With Quote
Old 02-23-2021, 12:27 AM   #2404
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 1,866
Default

Code:
 seltrack = reaper.GetSelectedTrack(0,0)
 
 if seltrack then
   reaper.TrackFX_AddByName( seltrack, "audio_statistics", 0, -1 )
   
 else
 
   reaper.Main_OnCommand(40001, 0) -- Track: Insert new track
         
   seltrack = reaper.GetSelectedTrack2( 0, 0, 1 )
         
   reaper.TrackFX_AddByName( seltrack, "audio_statistics", 0, -1 )
 end
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
MusoBob is offline   Reply With Quote
Old 02-23-2021, 08:22 AM   #2405
Pink Wool
Human being with feelings
 
Pink Wool's Avatar
 
Join Date: Apr 2020
Posts: 294
Default

Quote:
Originally Posted by MusoBob View Post
Code:
 seltrack = reaper.GetSelectedTrack(0,0)
 
 if seltrack then
   reaper.TrackFX_AddByName( seltrack, "audio_statistics", 0, -1 )
   
 else
 
   reaper.Main_OnCommand(40001, 0) -- Track: Insert new track
         
   seltrack = reaper.GetSelectedTrack2( 0, 0, 1 )
         
   reaper.TrackFX_AddByName( seltrack, "audio_statistics", 0, -1 )
 end
Hey! It works! Thank you very much!
Pink Wool is online now   Reply With Quote
Old 02-26-2021, 07:11 PM   #2406
Kr3eM
Human being with feelings
 
Kr3eM's Avatar
 
Join Date: Apr 2019
Posts: 102
Default

Quote:
Originally Posted by Edgemeal View Post
Monitor FX uses a different indexing # for FX slot,
Try this script on toolbar button,

Getting back to this script, I managed to make it work for the master track ny change the 0x1000000 to 0x000000, but then I wanted it to work with my pre-Master bus track (which is track 1) as well but I could not figure out how to do it. I know there other ways but this script worked so well with Master and Monitor fx when it comes to have visible active toolbar buttons... so I hope it's only an easy modification that is needed...if doable


Code:
-- Toggle FX # bypass for Monitor FX
-- Edgemeal - Apr 04, 2020
-- Donate: https://www.paypal.me/Edgemeal

-- Copy this script file and rename the FX # for,
-- the FX slot number you want to toggle bypass.
-- For example,
-- Toggle FX 3 bypass for Monitor FX.lua
-- Toggle FX 4 bypass for Monitor FX.lua
-- Toggle FX 5 bypass for Monitor FX.lua
-- etc, etc...

local name = ({reaper.get_action_context()})[2]:match("([^/\\_]+).lua$")
local fxIndex = tonumber(name:match("FX (%d+)"))
local track = reaper.GetMasterTrack()
local cnt = reaper.TrackFX_GetRecCount(track)
if fxIndex <= cnt then
  fxIndex = (0x1000000 + (fxIndex-1))
  local enabled = reaper.TrackFX_GetEnabled(track, fxIndex)
  reaper.TrackFX_SetEnabled(track, fxIndex, not enabled)
  -- set toolbar highlight
  local self = ({reaper.get_action_context()})[4]
  if enabled then  
    reaper.SetToggleCommandState(0, self, 1)
  else
    reaper.SetToggleCommandState(0, self, 0)
  end
end
reaper.defer(function () end)
Kr3eM is offline   Reply With Quote
Old 02-26-2021, 08:36 PM   #2407
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 2,252
Default

Quote:
Originally Posted by Kr3eM View Post
Getting back to this script, I managed to make it work for the master track ny change the 0x1000000 to 0x000000, but then I wanted it to work with my pre-Master bus track (which is track 1) as well but I could not figure out how to do it. I know there other ways but this script worked so well with Master and Monitor fx when it comes to have visible active toolbar buttons... so I hope it's only an easy modification that is needed...if doable
Try,....
Code:
-- Toggle FX # bypass for track #
--
-- File name examples,...
-- Toggle FX 3 bypass for track 1.lua
-- Toggle FX 2 bypass for track 2.lua
-- Toggle FX 1 bypass for track 3.lua

local name = ({reaper.get_action_context()})[2]:match("([^/\\_]+).lua$")
local fxIndex = tonumber(name:match("FX (%d+)"))
local trNum = tonumber(name:match("track (%d+)"))
local track = reaper.GetTrack(0,trNum-1)

if track ~= nil then
  local cnt = reaper.TrackFX_GetCount(track) 
  if fxIndex <= cnt then
    fxIndex = fxIndex - 1
    local enabled = reaper.TrackFX_GetEnabled(track, fxIndex)
    reaper.TrackFX_SetEnabled(track, fxIndex, not enabled)
    -- set toolbar highlight
    local self = ({reaper.get_action_context()})[4]
    if enabled then  
      reaper.SetToggleCommandState(0, self, 1)
    else
      reaper.SetToggleCommandState(0, self, 0)
    end 
  end
end  
reaper.defer(function () end)

Last edited by Edgemeal; 02-26-2021 at 08:53 PM. Reason: Add error trap for missing track #
Edgemeal is offline   Reply With Quote
Old 02-27-2021, 09:17 AM   #2408
Kr3eM
Human being with feelings
 
Kr3eM's Avatar
 
Join Date: Apr 2019
Posts: 102
Default

Quote:
Originally Posted by Edgemeal View Post
Try,....
This is working great, I can't thank you enuff... is it possible to make it toggle float Fx as well? If it's not too much of a hassle, I tried but I couldn't find anything good to copy and paste from which made sense.... made it float but toggle it did not it ended up being the script who said "Nil!"
Kr3eM is offline   Reply With Quote
Old 02-27-2021, 10:18 AM   #2409
Kr3eM
Human being with feelings
 
Kr3eM's Avatar
 
Join Date: Apr 2019
Posts: 102
Default

Oh... hold on, I think I actually made it work...

Replaced a bit of the script and inverted the toggle Set in the end to be accurate...

Code:
-- Toggle FX # float for track #
-- File name examples,...
-- Toggle FX 3 float for track 1.lua
-- Toggle FX 2 float for track 2.lua
-- Toggle FX 1 float for track 3.lua

local name = ({reaper.get_action_context()})[2]:match("([^/\\_]+).lua$")
local fxIndex = tonumber(name:match("FX (%d+)"))
local trNum = tonumber(name:match("track (%d+)"))
local track = reaper.GetTrack(0,trNum-1)

if track ~= nil then
  local cnt = reaper.TrackFX_GetCount(track) 
  if fxIndex <= cnt then
    fxIndex = fxIndex - 1
	
	------------changed-----------------------
	
    local enabled = reaper.TrackFX_GetFloatingWindow(track, fxIndex, 3)
	
	if enabled then;
	reaper.TrackFX_Show(track, fxIndex, 2);
	
	else;
	reaper.TrackFX_Show(track, fxIndex, 3);
end
	-------------changed--------------------

    -- set toolbar highlight
    local self = ({reaper.get_action_context()})[4]
    if enabled then  
      reaper.SetToggleCommandState(0, self, 0)
    else
		  
      reaper.SetToggleCommandState(0, self, 1)

    end 
 end
end

reaper.defer(function () end)

Last edited by Kr3eM; 02-27-2021 at 10:43 AM. Reason: added code
Kr3eM is offline   Reply With Quote
Old 02-27-2021, 10:35 AM   #2410
Kr3eM
Human being with feelings
 
Kr3eM's Avatar
 
Join Date: Apr 2019
Posts: 102
Default

@Edgemeal

I just wanted to thank you again for your help, very much appreciated.
Kr3eM is offline   Reply With Quote
Old 03-01-2021, 12:17 PM   #2411
strachupl
Human being with feelings
 
strachupl's Avatar
 
Join Date: Jan 2013
Posts: 448
Default

I wonder if there is some other randomizer of FX there.
I know about:


Code:
Script: mpl_Randomize Track FX parameters.lua
and
Code:
Script: kawa_GUI_FxRandomiza.lua

Kawa randomizer work as I want in most cases but I discovered that sometimes it do not randomize some parameters in full scale. For example it randomize delay knob in plugin from 0-50% and do not pick values of 50-100%. In most cases it works but some plugins not. This script is very usefull and have locking values feature. Mpl script don't work in same way but it morph 0-100% in cases that Kawas script not.

Maybe somone know about some other script that is able to randomize FX parameters with locking/securing feature? Thanks
__________________
It's Easier To Fool People Than To Convince Them That They've Been Fooled.
strachupl is online now   Reply With Quote
Old 03-02-2021, 04:30 AM   #2412
zamboknee
Human being with feelings
 
Join Date: Jun 2009
Posts: 162
Default

Would like a script (already existing for MAC?) that allows me to adjust the font of time selections.
see attachment from post here. https://forum.cockos.com/showthread.php?t=248594
zamboknee is offline   Reply With Quote
Old 03-02-2021, 08:40 AM   #2413
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 263
Default

Hello !

I try to spare my CPU a little bit & I notice that the monitoring fx take a lot of resources here. I wish I could create cycle actions to put some of the monitoring FX offline/online. Currently we can bypass and unbypass in the action list.

"Set monitoring FX number n offline"

"Set monitoring FX number n online"

Any input appreciated !!
xxxxxxxxxxxxxxxxx
Loulou92 is offline   Reply With Quote
Old 03-02-2021, 10:34 AM   #2414
Kr3eM
Human being with feelings
 
Kr3eM's Avatar
 
Join Date: Apr 2019
Posts: 102
Default

Quote:
Originally Posted by Loulou92 View Post
Hello !

I try to spare my CPU a little bit & I notice that the monitoring fx take a lot of resources here. I wish I could create cycle actions to put some of the monitoring FX offline/online. Currently we can bypass and unbypass in the action list.

"Set monitoring FX number n offline"

"Set monitoring FX number n online"

Any input appreciated !!
xxxxxxxxxxxxxxxxx

I made some minor changes to Edgemeal's script, try this and see if it works...

EDIT: However, not sure if it makes that much difference than bypass in regards to save CPU, but perhaps there are certain plugins that will.

Code:
-- Toggle FX # offline for Monitor FX
-- Copy this script file and rename the FX # for,
-- the FX slot number you want to toggle offline.
-- For example,
-- Toggle FX 3 offline for Monitor FX.lua
-- Toggle FX 4 offline for Monitor FX.lua
-- Toggle FX 5 offline for Monitor FX.lua
-- etc, etc...

local name = ({reaper.get_action_context()})[2]:match("([^/\\_]+).lua$")
local fxIndex = tonumber(name:match("FX (%d+)"))
local track = reaper.GetMasterTrack()
local cnt = reaper.TrackFX_GetRecCount(track)
if fxIndex <= cnt then
  fxIndex = (0x1000000 + (fxIndex-1))
   local enabled = reaper.TrackFX_GetOffline(track, fxIndex, 1)
  reaper.TrackFX_SetOffline(track, fxIndex, not enabled)
  -- set toolbar highlight
  local self = ({reaper.get_action_context()})[4]
  if enabled then  
    reaper.SetToggleCommandState(1, self, 1)
  else
    reaper.SetToggleCommandState(1, self, 0)
  end
end
reaper.defer(function () end)

Last edited by Kr3eM; 03-02-2021 at 10:42 AM.
Kr3eM is offline   Reply With Quote
Old 03-02-2021, 01:15 PM   #2415
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 263
Default

Quote:
Originally Posted by Kr3eM View Post
I made some minor changes to Edgemeal's script, try this and see if it works...

EDIT: However, not sure if it makes that much difference than bypass in regards to save CPU, but perhaps there are certain plugins that will.

Code:
-- Toggle FX # offline for Monitor FX
-- Copy this script file and rename the FX # for,
-- the FX slot number you want to toggle offline.
-- For example,
-- Toggle FX 3 offline for Monitor FX.lua
-- Toggle FX 4 offline for Monitor FX.lua
-- Toggle FX 5 offline for Monitor FX.lua
-- etc, etc...

local name = ({reaper.get_action_context()})[2]:match("([^/\\_]+).lua$")
local fxIndex = tonumber(name:match("FX (%d+)"))
local track = reaper.GetMasterTrack()
local cnt = reaper.TrackFX_GetRecCount(track)
if fxIndex <= cnt then
  fxIndex = (0x1000000 + (fxIndex-1))
   local enabled = reaper.TrackFX_GetOffline(track, fxIndex, 1)
  reaper.TrackFX_SetOffline(track, fxIndex, not enabled)
  -- set toolbar highlight
  local self = ({reaper.get_action_context()})[4]
  if enabled then  
    reaper.SetToggleCommandState(1, self, 1)
  else
    reaper.SetToggleCommandState(1, self, 0)
  end
end
reaper.defer(function () end)
Thank you ! your script works. May I ask for versions of this script that doesn't toggle ? One script that put offline, and one script that put online ? That would be very helpfull to me ! Althought I think I understand the basic of the script, I'm not sure how to mod it.
Loulou92 is offline   Reply With Quote
Old 03-02-2021, 03:58 PM   #2416
Kr3eM
Human being with feelings
 
Kr3eM's Avatar
 
Join Date: Apr 2019
Posts: 102
Default

Quote:
Originally Posted by Loulou92 View Post
May I ask for versions of this script that doesn't toggle ? One script that put offline, and one script that put online ?
Code:
-- Set FX # offline for Monitor FX
-- Copy this script file and rename the FX # for,
-- the FX slot number you want to set offline.
-- For example,
-- Set FX 3 offline for Monitor FX.lua
-- Set FX 4 offline for Monitor FX.lua
-- Set FX 5 offline for Monitor FX.lua
-- etc, etc...

local name = ({reaper.get_action_context()})[2]:match("([^/\\_]+).lua$")
local fxIndex = tonumber(name:match("FX (%d+)"))
local track = reaper.GetMasterTrack()
local cnt = reaper.TrackFX_GetRecCount(track)
if fxIndex <= cnt then
  fxIndex = (0x1000000 + (fxIndex-1))
  reaper.TrackFX_SetOffline(track, fxIndex, 1)
end

and for Online
Code:
-- Set FX # online for Monitor FX
-- Copy this script file and rename the FX # for,
-- the FX slot number you want to set online.
-- For example,
-- Set FX 3 online for Monitor FX.lua
-- Set FX 4 online for Monitor FX.lua
-- Set FX 5 online for Monitor FX.lua
-- etc, etc...

local name = ({reaper.get_action_context()})[2]:match("([^/\\_]+).lua$")
local fxIndex = tonumber(name:match("FX (%d+)"))
local track = reaper.GetMasterTrack()
local cnt = reaper.TrackFX_GetRecCount(track)
if fxIndex <= cnt then
  fxIndex = (0x1000000 + (fxIndex-1))
  reaper.TrackFX_SetOffline(track, fxIndex, 0)
end

Last edited by Kr3eM; 03-02-2021 at 05:19 PM.
Kr3eM is offline   Reply With Quote
Old 03-02-2021, 05:10 PM   #2417
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 263
Default

Thank you so much Kr3eM ! The last two scripts will be used a lot and sure enough other readers of the thread will find use for the toggle version too.

Conerning CPU use of offline versus bypass, I notice a difference with the Sonarwork plugin. The offline is really welcome. My PC ventirad thanks you.
Loulou92 is offline   Reply With Quote
Old 03-02-2021, 05:18 PM   #2418
Kr3eM
Human being with feelings
 
Kr3eM's Avatar
 
Join Date: Apr 2019
Posts: 102
Default

Quote:
Originally Posted by Loulou92 View Post
Thank you so much Kr3eM ! The last two scripts will be used a lot and sure enough other readers of the thread will find use for the toggle version too.

Conerning CPU use of offline versus bypass, I notice a difference with the Sonarwork plugin. The offline is really welcome. My PC ventirad thanks you.
Glad to help, can't code by any stretch, most of the work is credited to Edgemeal... I just Frankenstein'ed it.

Also, edited the script... you can delete the last row
"reaper.defer(function () end)"

Thanks for letting me know about Sonarworks.

Last edited by Kr3eM; 03-02-2021 at 05:21 PM. Reason: spelling skills = not
Kr3eM is offline   Reply With Quote
Old 03-05-2021, 10:55 AM   #2419
buddhajuke
Human being with feelings
 
buddhajuke's Avatar
 
Join Date: Jun 2012
Posts: 254
Default Select track(s) sent to hardware output 12 (or any number)

Hi, looking for a script that selects the track or tracks routed or sent to a hardware output x. I have a 40 channel analog console mixer, and 30 channels of i/o routed to and from that mixer.

It's an old mixer, and the only midi functionality is the mutes. You can turn the mutes on and off with midi. That's it. So I am always fiddling with ways to use those buttons to also select the corresponding track in REAPER, but I don't want to simply say if mute 23 is pressed, then selact track 23, because I am constantly moving tracks around, so that won't work. But if the mute can select the track that's routed to it, that would be fantastic.
buddhajuke is offline   Reply With Quote
Old 03-06-2021, 04:16 AM   #2420
Phazma
Human being with feelings
 
Join Date: Jun 2019
Posts: 854
Default

I was trying to make a custom action that reverses an item and the envelope points directly under it and was somehow surprised that while we have "Toggle Take Reverse" and "Envelope: Reverse Points" we don't have "Select envelope points under selected item" to put inbetween.

So could someone script this? A reverse function that does not only reverse an item but also the envelope points of all envelope lanes underneath it (not the whole lanes tough, just the part under the item). Or perhaps simply "Select envelope points under selected item" which can be used for my purpose as well as other purposes.
Phazma 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 12:06 AM.


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