No internet connection
  1. Home
  2. Support

Pan Window Follow Track command stops working

By Curtis Macdonald @Curtis_Macdonald
    2020-09-22 17:49:24.647Z

    Pan Window Follow Track command stops working

    System Information

    SoundFlow 4.1.1

    OS: darwin 19.6.0

    ProductName: Mac OS X
    ProductVersion: 10.15.6
    BuildVersion: 19G2021

    Steps to Reproduce

    1. I Run the Command
    2. I click on various tracks in Pro Tools, and the pan window follows track selection
    3. After a short time, this functionality stops and I see the SoundFlow error "Object reference not set to an instance of an object"

    Expected Result

    Constant pan window follows track selection

    Actual Result

    consistently stops working

    Workaround

    no.

    Other Notes


    Links

    User UID: BAHRTrNpErQGSMCXb1Gj6AHsSU13

    Feedback Key: sffeedback:BAHRTrNpErQGSMCXb1Gj6AHsSU13:-MHqvnFbhXV4JRdapNvy

    Feedback ZIP

    Solved in post #6, click to view
    • 5 replies
    1. Thank you, Curtis!

      I believe this is the same bug that we're seeing here:
      https://forum.soundflow.org/-2876/output-window-follows-selectiontoggle-command-stopped-working-after-411#post-9

      We're currently investigating this.

      1. Curtis Macdonald @Curtis_Macdonald
          2021-01-27 16:50:58.506Z

          An update: I break this command and experience this bug when ever I temporarily select all tracks in the session, by the default PT shortcut shift+opt+click. I then see this error and have to re-trigger the command.

          1. Thanks for the update, Curtis.

            Can I get you to quote the exact script you're using? I'll need it exactly copied, so I can see which line is line 17.

            1. Curtis Macdonald @Curtis_Macdonald
                2021-02-10 16:06:04.765Z

                yes! thanks for the help - I'm using the "Pan Window Follow Track" command, code below:

                var lastFocusedTrackName;
                
                function main() {
                var newName = sf.ui.proTools.selectedTrackNames[0];
                if (newName === lastFocusedTrackName || newName === undefined) return;
                
                lastFocusedTrackName = newName;
                
                sf.ui.proTools.selectedTrack.trackOutputToggleShow();
                }
                
                function runForever(name, action, interval, timeout) {
                var now = (new Date).valueOf();
                if (now - globalState[name] < timeout) throw 0; //Exit if we were invoked again inside the timeout
                
                globalState[name] = now;
                sf.engine.runInBackground(function () {
                    try {
                        while (true) {
                            sf.engine.checkForCancellation();
                            globalState[name] = (new Date).valueOf();
                
                            action();
                
                            sf.wait({ intervalMs: interval, executionMode: 'Background' });
                        }
                    } finally {
                        globalState[name] = null;
                    }
                });
                }
                
                runForever("isFollowFocusedTrackRunning", main, 500, 5000);
                1. Thanks, Curtis.

                  I highly recommend using this command instead:

                  It has the necessary error handling built in.

                  Reply1 LikeSolution