No internet connection
  1. Home
  2. Ideas

Access to Session Information

By Nathan Salefski @nathansalefski
    2024-02-13 22:13:30.522Z

    It would be awesome for SoundFlow to be able to pull Session information like Session Name, Session Path and the Session's Bit Depth and Sample Rate. It would be incredibly useful especially in places like the Bounce Window or Export Clips Dialog. Currently I'm using these functions for Bit Depth and Sample Rate, but built in direct access through something like sf.ui.proTools.session would be awesome!

    function getSessionBitDepth() {
        sf.ui.proTools.mainWindow.invalidate();
    
        const win = sf.ui.proTools.windows.whoseTitle.is('Session Setup').first;
    
        if (!win.exists) {
            sf.ui.proTools.menuClick({
                menuPath: ['Setup', 'Session'],
            }, `Could Not Open Session Setup Window`);
    
            win.elementWaitFor({},
                `Could Not Find Session Setup Window`
            );
        }
    
        const sessionFormatPanel = win.groups.whoseTitle.is('Session Format').first;
    
        const bitDepthString = sessionFormatPanel.popupButtons.allItems[1].value.invalidate().value;
    
        return bitDepthString;
    }
    
    function getSessionSampleRate() {
        sf.ui.proTools.mainWindow.invalidate();
    
        const win = sf.ui.proTools.windows.whoseTitle.is('Session Setup').first;
    
        const sessionFormatPanel = win.groups.whoseTitle.is('Session Format').first;
    
        const sampleRateString = sessionFormatPanel.children.whoseRole.is('AXStaticText').allItems[2].value.invalidate().value;
    
        if (win.exists) {
            sf.ui.proTools.menuClick({
                menuPath: ['Setup', 'Session']
            });
    
            win.elementWaitFor({ waitType: 'Disappear' });
        }
    
        return sampleRateString;
    }
    
    • 6 replies
    1. Chad Wahlbrink @Chad2024-02-13 22:23:13.304Z

      @nathansalefski, you can get values relating to session bit depth, sample rate, timecode, etc., from SoundFlow's integration with the Pro Tools SDK.

      Try this:

      log(sf.app.proTools.getSessionSampleRate().sampleRate);
      log(sf.app.proTools.getSessionBitDepth().currentSetting);
      
      1. Nathan Salefski @nathansalefski
          2024-02-13 22:26:03.594Z

          MAN that AWESOME! The formatting is a bit strange but that's awesome! Are all of the sf.app.proTools commands new?

          1. In reply toChad:
            Nathan Salefski @nathansalefski
              2024-02-13 23:07:48.316Z

              Also in regards to the Export Clips as Files Dialog, sf.app.proTools.exportClipsAsFiles() doesn't have an option for selecting the sample rate, could that be added?

              1. Hi Nathan,

                For any ideas to the sf.app.proTools.... namespace, please open up a thread here, as we can then forward the request to Avid:
                https://forum.soundflow.org/top/pt-sdk-ideas

                Unlike most other automation actions in SoundFlow, the functions here are entirely implemented by Avid so we have much less control over how they work.

                1. Nathan Salefski @nathansalefski
                    2024-02-14 02:23:03.821Z

                    Understood, sorry I assumed it was being implemented by you

                    1. Maybe one day ;)