Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER General Discussion Forum

Reply
 
Thread Tools Display Modes
Old 03-12-2020, 03:23 AM   #1
talustalus
Human being with feelings
 
Join Date: Dec 2018
Posts: 1,025
Default Mute / unmute hardware output sends impossible?

Hi there

I have found a script that removes track outputs. But is there one that exists for mute/unmute of hardware outputs?

Would make my life a lot easier.

Thanks
talustalus is offline   Reply With Quote
Old 06-09-2021, 08:15 AM   #2
flipotto
Human being with feelings
 
flipotto's Avatar
 
Join Date: Feb 2007
Location: VA
Posts: 885
Default

Quote:
Originally Posted by talustalus View Post
Hi there

I have found a script that removes track outputs. But is there one that exists for mute/unmute of hardware outputs?

Would make my life a lot easier.

Thanks
Bump!

Is this possible? Toggle Mute hardware output for selected tracks?
flipotto is offline   Reply With Quote
Old 06-09-2021, 12:25 PM   #3
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Quote:
Originally Posted by flipotto View Post
Bump!

Is this possible? Toggle Mute hardware output for selected tracks?
It's possible. I guess you've searched in ReaPack already?
Otherwise maybe open a request thread in the scripting forum (or use the Script request sticky thread).
nofish is offline   Reply With Quote
Old 06-09-2021, 02:31 PM   #4
flipotto
Human being with feelings
 
flipotto's Avatar
 
Join Date: Feb 2007
Location: VA
Posts: 885
Default

Yes I have - only thing close is your mute first n hardware outs on tracks that are currently recording.
If I could figure out how to remove your other code on recording logic, it might be simple.

Last edited by flipotto; 06-09-2021 at 02:47 PM.
flipotto is offline   Reply With Quote
Old 06-09-2021, 06:30 PM   #5
flipotto
Human being with feelings
 
flipotto's Avatar
 
Join Date: Feb 2007
Location: VA
Posts: 885
Default

Here is my request and the beginnings of an attempt from research
https://forum.cockos.com/showpost.ph...postcount=2561
flipotto is offline   Reply With Quote
Old 06-09-2021, 07:55 PM   #6
flipotto
Human being with feelings
 
flipotto's Avatar
 
Join Date: Feb 2007
Location: VA
Posts: 885
Default Here is a solution

Here is one possible solution
Code:
-- Lua script TOGGLE MUTE HARDWARE output 1 on selected tracks

--[[
The number of hw outs makes all the difference
parameters for reaper.ToggleTrackSendUIMute
*send_idx<0 for receives, >=0 for hw ouputs, >=nb_of_hw_ouputs for sends.
If hw outs are 1 and send_target = -1 the result is zero

--]]
local send_target = 0 -- just to set a value for the var, send counts start at 0 in Reaper 

function toggle_send_mute()
    local tr_count = reaper.CountSelectedTracks(0)
    if tr_count == 0 then
        return
    end
    reaper.Undo_BeginBlock()
    for i=1, tr_count do
        local tr = reaper.GetSelectedTrack(0, i-1)
        if tr ~= nil then
            -- count hardware outs (this is needed to get the correct send index)
            local tr_num_hw_outs = reaper.GetTrackNumSends(tr, 1)
            -- set send_target equal to numbers of hw outs
            local send_target = tr_num_hw_outs
            -- subtract the above vars to always get 0, which is the first hw output
            reaper.ToggleTrackSendUIMute(tr, tr_num_hw_outs - send_target)-- if >=0,then hw_out
        end
    end
    local undo_string = "Toggle send mute "..tostring(send_target+1)
    reaper.Undo_EndBlock(undo_string, -1)
end

reaper.defer(toggle_send_mute)
It has problems - it does react to no hw output, it will mute send.
Track A has hw out and Track B has send but no hw out it will mute send B.
Need logic to differentiate or be very careful with usage.

Last edited by flipotto; 06-09-2021 at 08:30 PM.
flipotto is offline   Reply With Quote
Old 06-10-2021, 05:57 AM   #7
flipotto
Human being with feelings
 
flipotto's Avatar
 
Join Date: Feb 2007
Location: VA
Posts: 885
Default

Here is me2beats select all tracks with hw outs
Code:
-- @description Select all tracks with hardware outputs
-- @version 1.0
-- @author me2beats
-- @changelog
--  + init

function nothing()
end

reaper.Main_OnCommand(40297, 0) -- unselect all tracks
t_cnt = reaper.CountTracks(0)
if t_cnt > 0 then
  
  script_title = "select all sends"
  reaper.Undo_BeginBlock()
  
  for t = 0, t_cnt-1 do
    tr = reaper.GetTrack(0,t)
    if reaper.GetTrackNumSends(tr, 1) > 0 then
      reaper.SetMediaTrackInfo_Value(tr, 'I_SELECTED', 1)
    end
  end
  
  reaper.Undo_EndBlock(script_title, -1)
else
  reaper.defer(nothing)
end
How to run more than one function in a lua script?
I could make custom action that runs the above script then my edited script from previous post.
Seems like these should be incorporated... how to do this?
flipotto is offline   Reply With Quote
Old 06-10-2021, 07:37 AM   #8
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

edit: replied in the Script request sticky thread
https://forum.cockos.com/showthread....43#post2453043

Last edited by nofish; 06-10-2021 at 08:11 AM.
nofish is offline   Reply With Quote
Old 06-17-2021, 05:36 AM   #9
flipotto
Human being with feelings
 
flipotto's Avatar
 
Join Date: Feb 2007
Location: VA
Posts: 885
Default CPU usage?

CPU?
I'm trying to determine if I need to mute the hw output?
Which case will use more cpu?

Setup - Using X32 console
32 Tracks in REAPER all with wave files playing back.
1 different hardware output
(Reaper track 1 hw out > x32 input chan 1... track 5 > x32 input 5)
for each of 32 reaper tracks

Which case uses more cpu?

A)All 32 Master Parent sends on AND 32 hardware outs muted
or
B)All 32 MP sends on AND 32 hardware outs unmuted?

My mind thinks B will use more cpu, due the active hardware output routing?
Perhaps it does not make a difference if the hw out is muted or not?
Thoughts?

Why - I am using a script to mute those hw outs, but may not need to, if it does not make a difference. Less complexity is better, when possible...
flipotto is offline   Reply With Quote
Old 06-17-2021, 06:49 AM   #10
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 3,015
Default

I'm actually surprised to learn that there are no native Reaper actions to toggle mute for hardware outputs.

However, you can easily automate mutes specifically for every hardware output.

.
__________________
Check out AVConvert (free, super-fast media file manipulation via the right-click context-menu in Windows Explorer) and my free VST plugins.
My Reaper tutorials and studio related videos on youtube.
SonicAxiom is offline   Reply With Quote
Old 06-19-2021, 09:57 AM   #11
flipotto
Human being with feelings
 
flipotto's Avatar
 
Join Date: Feb 2007
Location: VA
Posts: 885
Default

In my test, having the hw outs unmuted seems to use more cpu then when muted.
flipotto is offline   Reply With Quote
Old 02-21-2023, 01:02 PM   #12
Craigmorris74
Human being with feelings
 
Join Date: Oct 2022
Posts: 2
Default

Found this thread, and was wondering if I could create a function to mute a hardware output that is only found on the master channel using a button on my MIDI controller. This would allow me to turn off the output to my speakers when tracking. I have have a separate hardware output for headphones.

Any suggestions would be greatly appreciated.
Craigmorris74 is offline   Reply With Quote
Old 02-21-2023, 01:17 PM   #13
mim
Human being with feelings
 
Join Date: Mar 2009
Posts: 370
Default

You can put a -inf volume fx in the fx monitoring chain and toggle the bypass with a midi controller (with the learn function).
mim is offline   Reply With Quote
Old 02-21-2023, 01:29 PM   #14
jrk
Human being with feelings
 
Join Date: Aug 2015
Posts: 2,969
Default

Quote:
Originally Posted by Craigmorris74 View Post
Found this thread, and was wondering if I could create a function to mute a hardware output that is only found on the master channel using a button on my MIDI controller.
[edit: tiny script removed]

there's SWS actions eg:
SWS: Set master track output 2 muted

and of course, there's a toggle:
SWS: Toggle master track output 2 mute

Ther should be one that matches your requirement, assign shortcut triggered from controller button.
__________________
it's meant to sound like that...

Last edited by jrk; 02-21-2023 at 01:45 PM. Reason: next time, look for sws first
jrk is offline   Reply With Quote
Old 02-21-2023, 01:41 PM   #15
Craigmorris74
Human being with feelings
 
Join Date: Oct 2022
Posts: 2
Default

Quote:
Originally Posted by mim View Post
You can put a -inf volume fx in the fx monitoring chain and toggle the bypass with a midi controller (with the learn function).
Quote:
Originally Posted by jrk View Post
It's the littlest script of them all!
Code:
reaper.ToggleTrackSendUIMute(reaper.GetMasterTrack(), 1);
This should mute/unmute the second hardware send from the Master. I think.
You'd want to edit this if you wanted to mute some other send.
Assign a shortcut to it (i.e. your controller button)

Or there's SWS actions eg:
SWS: Set master track output 2 muted
Thanks for your replies. I'll try both and see which works best with my workflow.
Craigmorris74 is offline   Reply With Quote
Old 02-21-2023, 01:47 PM   #16
jrk
Human being with feelings
 
Join Date: Aug 2015
Posts: 2,969
Default

Quote:
Originally Posted by Craigmorris74 View Post
Thanks for your replies.
Oh, I was hoping the world would forget I started typing before looking for the sws action.
__________________
it's meant to sound like that...
jrk 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 04:05 AM.


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