No internet connection
  1. Home
  2. Ideas

Soundradix Mutematic “over ride” script

By Sean McDonald @Sean_McDonald5
    2023-10-31 02:58:18.565Z

    Hello!
    Christian suggested I create a new thread here for a soundflow solution that I think many could benefit from.

    I’m looking for script/ trigger for the free Sound Radix Mutematic plugin.

    This talkback plugin opens / closes the inserted channel based on a sessions playback status.
    But can be overridden by pressing the “state” gui button.

    The script I’m looking for would “press” the GUI “state” button, and that script could be mapped to some tactile source.

    This new trigger/ button will essentially act as a push to talk switch.

    Thanks in advance for your time and interest.

    Stoked to find out if this is a doable thing or not.

    All the best,
    Sean

    • 9 replies
    1. D
      danielkassulke @danielkassulke
        2023-10-31 08:37:48.586Z

        Hi Sean,

        I've actually created a script to do this without a plugin. It's a talkback mute toggle, but it sounds like it could easily be tweaked for your needs. All artist talkback channels have the prefix "TB", so this acts on every channel with "TB" in the name. I just have to ensure those TB channels are initially muted, because the toggle toggles the mute and input monitoring state simultaneously.

        sf.ui.proTools.appActivateMainWindow();
        sf.ui.proTools.invalidate();
        
        function toggleInput(trackName) {
            var track = sf.ui.proTools.trackGetByName({
                name: trackName,
                makeVisible: true,
            }).track;
        
            var inputBtn = track.buttons.whoseTitle.is('TrackInput Monitor').first;
        
            // Check if the track is muted
            if (track.isMuted) {
                // Enable input monitoring
                inputBtn.elementClick();
        
                // Disable mute state
                track.trackSetMute({
                    targetValue: "Disable",
                });
            } else {
                // Disable input monitoring
                inputBtn.elementClick();
        
                // Enable mute state
                track.trackSetMute({
                    targetValue: "Enable",
                });
            }
        }
        
        function toggleInputContaining(partialTrackName) {
            var matchingTrackNames = sf.ui.proTools.trackNames.filter(n => n.toLowerCase().indexOf(partialTrackName.toLowerCase()) >= 0);
            matchingTrackNames.map(toggleInput);
        }
        
        toggleInputContaining('TB');
        
        1. S
          In reply toSean_McDonald5:
          Sean McDonald @Sean_McDonald5
            2023-10-31 18:32:59.702Z

            thanks for the reply!

            heres the features im looking for [with or without the mutematic plug]

            1. TB channel automatically opens when parked.

            2. TB automatically closes during playback.

            3. physical key/ button to override either open or closed auto status of TB channel

            do you think your script could make this happen?

            thanks!
            Sean

            1. D
              In reply toSean_McDonald5:
              danielkassulke @danielkassulke
                2023-11-03 00:16:10.830Z

                Hi Sean,

                I think there is definitely a way to make this happen. My instinct would be that you need two scripts: one that assesses the playback state and enables input monitoring when playback is stopped. Then use an application trigger so it's only acting when protools is active. The second script would do the opposite; disables input monitoring during playback. My script does the third already. I had a bash at a script more closely matching your requirements, but it was buggy. I'll keep chipping away to see if I can get it up to scratch before I try posting it here. From what I've read on this forum, those scripts that are always running are potentially problematic, but there might be a more experienced user who has a neater solution for this kind of thing.

                1. SSean McDonald @Sean_McDonald5
                    2023-11-03 00:20:00.349Z

                    Hey,
                    Thanks sooooooo much for the interest and the offer of assistance.

                    Much appreciated 👍👍👍👍

                    1. Ddanielkassulke @danielkassulke
                        2023-11-03 02:12:27.685Z

                        This is working so far. Note that you'll have to change line 35 to suit your preferred talkback track naming convention. I use 'TB'. If you initially enable input monitoring while playback is paused, it should reliably work without manual intervention from then onwards.

                        sf.ui.proTools.appActivateMainWindow();
                        sf.ui.proTools.invalidate();
                        
                        function setTrackState(trackName, enableInputMonitoring) {
                            const track = sf.ui.proTools.trackGetByName({
                                name: trackName,
                                makeVisible: true,
                            }).track;
                        
                            const inputBtn = track.buttons.whoseTitle.is('TrackInput Monitor').first;
                        
                            if (inputBtn.value !== enableInputMonitoring) {
                                inputBtn.elementClick();
                            }
                        }
                        
                        function setTracksStateForTracksContaining(partialTrackName, enableInputMonitoring) {
                            const matchingTrackNames = sf.ui.proTools.trackNames.filter(n => n.toLowerCase().includes(partialTrackName.toLowerCase()));
                            matchingTrackNames.forEach(function(trackName) {
                                setTrackState(trackName, enableInputMonitoring);
                            });
                        }
                        
                        function monitorProTools() {
                            sf.ui.proTools.appActivateMainWindow();
                            sf.ui.proTools.mainWindow.invalidate();
                        
                            let lastIsPlayingValue = null;
                        
                            while (true) {
                                const isPlaying = sf.ui.proTools.isPlaying;
                                
                                if (isPlaying !== lastIsPlayingValue) {
                                    // If Pro Tools is playing, disable input monitoring for tracks containing 'TB'
                                    setTracksStateForTracksContaining('TB', !isPlaying);
                                    
                                    lastIsPlayingValue = isPlaying;
                                }
                        
                                sf.wait({ intervalMs: 500 });
                            }
                        }
                        
                        monitorProTools();
                        
                        1. Ddanielkassulke @danielkassulke
                            2023-11-03 05:11:25.357Z

                            This actually seems to make other soundflow commands run unreliably as this script is always running. Not sure how this could be avoided.

                      • S
                        In reply toSean_McDonald5:
                        Sean McDonald @Sean_McDonald5
                          2023-11-03 10:12:16.814Z

                          Thanks for the update, AND the effort/ leg work.
                          Much appreciated.

                          I’m wondering, if the solution would need to include 2 talkback channels to cover the auto start /stop (mute/ open) as well as the push to talk override feature?

                          TB Channel 1:
                          Mic feeding aux with sound radix mutematic plugin inserted.
                          Opening channel when parked.
                          Close channel when rolling.

                          TB channel 2:
                          This is with the current, working soundflow script that opens / closes that talkback channel with a push of a mapped key/ button.
                          Fed by same talkback mic and input.

                          The thought is, can you add a script to TB channel 2’s current code, to ALSO mute or bypass TB channel 1 when Channel
                          2 is being used?

                          So we get an “either or” type of performance between the two channels.
                          A division of labor.

                          Hopefully that made sense🙂

                          And thanks once again for the interest and expertise.

                          Best,
                          Sean

                          1. Ddanielkassulke @danielkassulke
                              2023-11-10 03:10:57.311Z

                              Sorry for the sluggish reply, Sean. The current issue is that for soundflow to be perpetually evaluating its playback state, other commands executed will either not work, or not work consistently. I wouldn't say my attempts to squirrel code from other areas of the forum is expertise, but I have read that @chrscheuer was weighing up the possibility of implementing a specific talkback feature within a future soundflow release. I'm wary of spamming the soundflow team, but I think for this to work in the background as effectively as we would both need while letting soundflow run other tasks, it's a bit beyond my skillset or current understanding. For now though, the initial script I posted seems to be bullet proof in my use in 2023.9, and the only drawback is (as with any comms switch) remembering to hit the talkback button. It's super convenient if you have a streamdeck / surface.

                              1. SSean McDonald @Sean_McDonald5
                                  2024-04-02 01:52:13.131Z

                                  thanks!
                                  sorry for MY sluggish response.

                                  Hopefully you are correct, and there will be some TB solution in future builds.

                                  thanks again.

                                  Best,
                                  Sean