No internet connection
  1. Home
  2. How to

RX 7 Module Chain

By Tony @AJPJR
    2019-08-08 20:59:00.389Z2019-08-08 21:08:46.882Z

    Hello! In RX 7 I use Module Chain a lot and I was wondering if it would be possible to have a command to open it. I have pretty minimal Javascript knowledge​ but understand it enough to modify/copy/paste etc.

    I tried to run this:

    var moduleName = "Module Chain";
    
    sf.ui.izotope.menuClick({
        menuPath: ['Modules', moduleName + '...']
    });
    

    And it was not able to find it. I am guessing RX7 does not see that plugin as a Module? How would you direct the code to find it?

    In an ideal world,​ I would love to have one command to:

    • Open "Module Chain"
    • Select my preset
    • Then Render

    I like working on this stuff but I need help!!

    Thanks, ​everyone!!
    Tony​

    Solved in post #2, click to view
    • 13 replies
    1. Hi @AJPJR.
      Thanks for your question.
      This will be a lot easier in SoundFlow 3 (launching first half of September), where you can create this as a macro (drag and drop).

      You're right, the "Module Chain" is in a different menu, so you'd need to open it like this:

      sf.ui.izotope.menuClick({
          menuPath: ['Window', 'Module Chain']
      });
      

      Since we can't access changing the preset very easily, I've created a script that does it here:

      
      function ensureModuleChainIsOpen() {
          var win = sf.ui.izotope.windows.whoseTitle.is('Module Chain').first;
          if (!win.exists) {
              sf.ui.izotope.menuClick({
                  menuPath: ['Window', 'Module Chain']
              });
              win.elementWaitFor();
          }
      }
      
      function selectModuleChainPreset(name) {
          var btn = sf.ui.izotope.windows.whoseTitle.is('Module Chain').first.groups.whoseDescription.is('Module Chain Panel').first.popupButtons.whoseDescription.is('Preset').first;
          if (btn.value.invalidate().value == name) return;
          btn.elementClick();
          sf.keyboard.press({ keys: 'enter' });
          while (true) {
              sf.engine.checkForCancellation();
              if (btn.value.invalidate().value == name) break;
              sf.keyboard.press({ keys: 'down' });
          }
      }
      
      function processOpenModuleChain() {
          sf.ui.izotope.windows.whoseTitle.is('Module Chain').first.groups.whoseDescription.is('Module Chain Panel').first.buttons.whoseDescription.is('Process').first.elementClick();
      }
      
      function processModuleChain(name) {
          sf.ui.izotope.invalidate();
          sf.ui.izotope.appActivateMainWindow();
          ensureModuleChainIsOpen();
          selectModuleChainPreset(name);
          processOpenModuleChain();
      }
      
      processModuleChain('[Default]');
      

      To use it, change the last line between the single quotes to the preset you want.

      ReplySolution
      1. ATony @AJPJR
          2019-08-08 21:36:45.051Z

          Christian! You are amazing!! I am excited to see/use SoundFlow 3!! Sounds like it will all be much more straight forward.

          I loaded up the code and everything is working great but getting an error at: sf.engine.checkForCancellation();

          I tried to play around with the code on my own and couldn't figure it out, ​unfortunately​.

          1. Hi Tony.
            Thank you :)
            Oh ok, just delete that line for now, it's not strictly necessary. I may have used a SoundFlow 3 command there.

            1. ATony @AJPJR
                2019-08-08 21:59:18.826Z

                Alright... we are getting closer... haha!

                Now it is opening the menu but it just endlessly scrolls and it will scroll in every application I have open. The only way I could get it to stop is by restarting the computer!! Haha.

                I am sure this will be easier in version 3 so no worries if this is a huge headache. Even just being able to pull up the Module Chain is good enough for me!

                Thank you again for all your super quick responses​ and help!!

                1. Yea the checkForCancellation is a SoundFlow 3 feature in which you can cancel a running command by pressing Ctrl+Shift+Escape.
                  It's likely that either this has changed a little bit in RX7 (I tested in RX6), or you didn't spell the name of the preset you're trying to load exactly identically to how it's spelled in the menu (case sensitive). To narrow down the cause of the problem, I would try with the "[Default]" one.
                  But yea, it's not nice with an endless loop in a command. I'll try to see if we can come up with some better logic.

                  1. JJohn Rammelt @John_Rammelt
                      2019-09-10 08:46:05.382Z

                      Hi, I could get the script you posted above to work with RX 7, I only had to switch out 'Process' on line 24 to 'Render'.

                      Now, my next feat will be looking into sending selected clips in Pro Tools to RX 7, switching to Composite view and apply my Module Chain Preset with one script/trigger...

                      1. Great!! Keep us posted on your progress :)

                        1. JJohn Rammelt @John_Rammelt
                            2019-09-10 14:45:40.487Z2019-09-11 06:54:12.490Z

                            Yep, I did it by copying code from different scripts and it seems to work great. I have 2 different versions for the 2 Module chain presets I use frequently. Maybe not as elegant as you would do it but it seems to work.

                            var win = sf.ui.proTools.getAudioSuiteWindow('RX 7 Connect');
                            if (!win || !win.exists) {
                                win = sf.ui.proTools.audioSuiteOpenPlugin({
                                    category: 'Noise Reduction',
                                    name: 'RX 7 Connect'
                                }).window;
                            }
                            
                            win.audioSuiteSetOptions({ processingInputMode: 'ClipByClip', processingOutputMode: 'CreateIndividualFiles' });
                            win.getFirstWithTitle("Analyze").elementClick();    
                            
                            sf.wait({ intervalMs: 1500 });
                            
                            var compositeViewBtn = sf.ui.izotope.mainWindow.getFirstWithDescription('RX7 Main Window').getFirstWithDescription("Composite View");
                            compositeViewBtn.elementClick();
                            function ensureModuleChainIsOpen() {
                                var win = sf.ui.izotope.windows.whoseTitle.is('Module Chain').first;
                                if (!win.exists) {
                                    sf.ui.izotope.menuClick({
                                        menuPath: ['Window', 'Module Chain']
                                    });
                                    win.elementWaitFor();
                                }
                            }
                            
                            function selectModuleChainPreset(name) {
                                var btn = sf.ui.izotope.windows.whoseTitle.is('Module Chain').first.groups.whoseDescription.is('Module Chain Panel').first.popupButtons.whoseDescription.is('Preset').first;
                                if (btn.value.invalidate().value == name) return;
                                btn.elementClick();
                                sf.keyboard.press({ keys: 'enter' });
                                while (true) {
                                    sf.engine.checkForCancellation();
                                    if (btn.value.invalidate().value == name) break;
                                    sf.keyboard.press({ keys: 'down' });
                                }
                            }
                            
                            function processOpenModuleChain() {
                                sf.ui.izotope.windows.whoseTitle.is('Module Chain').first.groups.whoseDescription.is('Module Chain Panel').first.buttons.whoseDescription.is('Render').first.elementClick();
                            }
                            
                            function processModuleChain(name) {
                                sf.ui.izotope.invalidate();
                                sf.ui.izotope.appActivateMainWindow();
                                ensureModuleChainIsOpen();
                                selectModuleChainPreset(name);
                                processOpenModuleChain();
                            }
                            
                            processModuleChain('000_Start-VO-extra allt');
                            
                            1. JJohn Rammelt @John_Rammelt
                                2019-09-10 14:51:13.612Z

                                Hmmm... I obviously did not format the code portion correctly when posting. What did I do wrong?
                                BTW, the last entry is the name of my Module Chain Preset-

                                1. JJohn Rammelt @John_Rammelt
                                    2019-09-10 16:23:36.156Z

                                    ...and the above script only works if more than one clip is selected in Pro Tools, otherwise the Composite View will not be there and thus the script halts at the compositeViewBtn elementClick...

                                    1. Nice work!!

                                      You might mitigate that by changing this line:

                                      compositeViewBtn.elementClick();
                                      

                                      to:

                                      if (compositeViewBtn.exists) compositeViewBtn.elementClick();
                                      
                                      1. JJohn Rammelt @John_Rammelt
                                          2019-09-11 08:34:38.861Z

                                          Yes! Works like a charm

                                      2. In reply toJohn_Rammelt:

                                        To format the code surround it with 3 backticks on their own line (one line of 3 backticks before the code, one line of 3 backticks after the code) - ```
                                        You can edit your own post to see how I fixed it :)