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

Reply
 
Thread Tools Display Modes
Old 03-24-2023, 09:34 AM   #1
Sound asleep
Human being with feelings
 
Sound asleep's Avatar
 
Join Date: Nov 2009
Location: Montreal, Canada
Posts: 9,068
Default MPL Script: mpl_Toggle solo focused FX track.lua Not quite working.

Code:
 reaper.Undo_BeginBlock()
  local _, tracknumber = reaper.GetFocusedFX()
  local param = 'I_SOLO'
  if tracknumber >= 0 then 
    local tr =  reaper.CSurf_TrackFromID( tracknumber, false )
    local solo_state = reaper.GetMediaTrackInfo_Value( tr, param )
    reaper.SetMediaTrackInfo_Value( tr, param, math.abs(solo_state-1) )
    reaper.TrackList_AdjustWindows( false )
  end
  reaper.Undo_EndBlock('Toggle solo focused FX track', 0 )

This is the script, it sort of works, but sort of doesn't. It will solo the track, as in the solo button turns on, and everything else mutes, however, audio doesn't pass through. I noticed this in a particular routing situation. So, the track in question is in a folder, and the audio is being sent to the parent just fine, that parent is set not to send to master, but instead to a music buss, and the audio is not making it to that buss.

Unsoloing manually, and then soloing again works as expected.
__________________
Slava Ukraini
Sound asleep is offline   Reply With Quote
Old 03-24-2023, 09:41 AM   #2
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,107
Default

My hunch is that SetMediaTrackInfo_Value(tr, 'I_SOLO'...) might ignore routing or some such.

May try SetTrackUISolo instead.
nofish is offline   Reply With Quote
Old 03-24-2023, 03:04 PM   #3
Sound asleep
Human being with feelings
 
Sound asleep's Avatar
 
Join Date: Nov 2009
Location: Montreal, Canada
Posts: 9,068
Default

Quote:
Originally Posted by nofish View Post
My hunch is that SetMediaTrackInfo_Value(tr, 'I_SOLO'...) might ignore routing or some such.

May try SetTrackUISolo instead.
Ok, sweet. So, I should replace "SetMediaTrackInfo_Value" with "SetTrackUISolo" I guess?
__________________
Slava Ukraini
Sound asleep is offline   Reply With Quote
Old 03-24-2023, 05:15 PM   #4
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,107
Default

Yes, that would be my suggestion (without having tested).
nofish is offline   Reply With Quote
Old 03-24-2023, 07:31 PM   #5
Sound asleep
Human being with feelings
 
Sound asleep's Avatar
 
Join Date: Nov 2009
Location: Montreal, Canada
Posts: 9,068
Default

Quote:
Originally Posted by nofish View Post
Yes, that would be my suggestion (without having tested).
Ok, sweet. I'll test it out and report back.
__________________
Slava Ukraini
Sound asleep is offline   Reply With Quote
Old 03-25-2023, 12:08 AM   #6
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

it seems solo value==1 was changed to solo-in-place, so output should be multiplied to 2 or 3.

Please write all issues related to my scripts to dedicated thread at forum (see signature). Otherwise it has low chance to be fixed.
mpl is offline   Reply With Quote
Old 03-25-2023, 09:06 AM   #7
Sound asleep
Human being with feelings
 
Sound asleep's Avatar
 
Join Date: Nov 2009
Location: Montreal, Canada
Posts: 9,068
Default

Quote:
Originally Posted by mpl View Post
it seems solo value==1 was changed to solo-in-place, so output should be multiplied to 2 or 3.

Please write all issues related to my scripts to dedicated thread at forum (see signature). Otherwise it has low chance to be fixed.
Ok, sorry. I didn't realize you had a thread like that. Would be useful if mods stickied that one, I find it is a sticky worthy thread.

I'm not sure I see what you mean. I don't see that in the script. Is that a reaper change? I am using an older version of reaper, 5.99, is it possible that was changed in reaper 6, and your script would function correctly there?
__________________
Slava Ukraini
Sound asleep is offline   Reply With Quote
Old 03-27-2023, 03:54 AM   #8
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

changes solo switch to Solo-in-place (that was Solo (ignore routing) before, as a ==1 default value for SetMediaTrackInfo_Value)
mpl is offline   Reply With Quote
Old 03-27-2023, 10:33 AM   #9
Sound asleep
Human being with feelings
 
Sound asleep's Avatar
 
Join Date: Nov 2009
Location: Montreal, Canada
Posts: 9,068
Default

Quote:
Originally Posted by mpl View Post
changes solo switch to Solo-in-place (that was Solo (ignore routing) before, as a ==1 default value for SetMediaTrackInfo_Value)
Well, unfortunately I'm way too much of a programming plebe to understand exactly what you mean, however, I noticed you updated the script to 1.01 in reapack, and that works great, so thanks a lot!


I also use another of your scripts which disables all non-vsti FX

Code:
--[[
   * ReaScript Name:Bypass all FX except instruments on all tracks 
   * Lua script for Cockos REAPER
   * Author: Michael Pilyavskiy (mpl)
   * Author URI: http://forum.cockos.com/member.php?u=70694
   * Licence: GPL v3
   * Version: 1.1
  ]]
  
  -- changelog
  -- 14.01.2014 1.1 fixed wron getinstr id
  
  script_title = "Bypass all FX except instruments on all tracks"
  reaper.Undo_BeginBlock()
  
  counttracks = reaper.CountTracks(0)
  if counttracks  ~= nil then
    for i = 1, counttracks do
      tr = reaper.GetTrack(0,i-1)
      if tr ~= nil then
      
        fxcount = reaper.TrackFX_GetCount(tr)
        if fxcount ~= nil then
          for j = 1, fxcount do
            if j == reaper.TrackFX_GetInstrument(tr)+1 then
              reaper.TrackFX_SetEnabled(tr, j-1, true)
               else
              reaper.TrackFX_SetEnabled(tr, j-1, false)
            end
          end
        end  
              
      end
    end
  end
  
  tr= reaper.GetMasterTrack(0)
  
        fxcount = reaper.TrackFX_GetCount(tr)
        if fxcount ~= nil then
          for j = 1, fxcount do
            if j == reaper.TrackFX_GetInstrument(tr)+1 then
              reaper.TrackFX_SetEnabled(tr, j-1, true)
               else
              reaper.TrackFX_SetEnabled(tr, j-1, false)
            end
          end
        end  
            
  reaper.Undo_EndBlock(script_title, 0)
This works great, however, my ampsims are not considered VSTi.

I was thinking of adding just an "or" statement that might incorporate the name of my ampsim VST, or something like that. This way if it is an instrument it gets enabled state or if it is called guitar rig it gets enable state.

But I don't see how to do that with the J=1 thing. I really know nothing about scripting, unfortunately.

But, if this is too complicated, I get it, it's ok. Thanks for your help.
__________________
Slava Ukraini
Sound asleep is offline   Reply With Quote
Old 03-27-2023, 10:52 AM   #10
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Quote:
Originally Posted by Sound asleep View Post
however, my ampsims are not considered VSTi.
fx chain - rightclick plugin - rename FX instance - enable "categorize as instrument"

Last edited by mpl; 03-27-2023 at 10:58 AM.
mpl is offline   Reply With Quote
Old 03-29-2023, 01:12 PM   #11
Sound asleep
Human being with feelings
 
Sound asleep's Avatar
 
Join Date: Nov 2009
Location: Montreal, Canada
Posts: 9,068
Default

Quote:
Originally Posted by mpl View Post
fx chain - rightclick plugin - rename FX instance - enable "categorize as instrument"
Sweet. Thanks! I guess that must be a reaper 6+ thing because I don't see that checkbox. I guess I'm gonna have to upgrade lol.

That's again for all your help, and your sweet scripts.
__________________
Slava Ukraini
Sound asleep is offline   Reply With Quote
Old 04-01-2023, 01:39 AM   #12
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Quote:
Originally Posted by Sound asleep View Post
Sweet. Thanks! I guess that must be a reaper 6+ thing because I don't see that checkbox. I guess I'm gonna have to upgrade lol.

That's again for all your help, and your sweet scripts.
Hm, I remember that was possible before.
However, this possible from same menu but from FX browser:
[fx browser - right click - rename]
mpl is offline   Reply With Quote
Old 04-02-2023, 04:33 PM   #13
Sound asleep
Human being with feelings
 
Sound asleep's Avatar
 
Join Date: Nov 2009
Location: Montreal, Canada
Posts: 9,068
Default

Quote:
Originally Posted by mpl View Post
Hm, I remember that was possible before.
However, this possible from same menu but from FX browser:
[fx browser - right click - rename]
No, you were right, I was just confused. I went to do it in FX chain, rather than FX browser. For anyone else wondering, if you do this, it works, however, if you have a track template with guitar rig on it for example, you will need to load up the track template, and then replace guitar rig with the new version that you have now changed to be an instrument, and then save your track template again.
__________________
Slava Ukraini
Sound asleep 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 02:09 AM.


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