No internet connection
  1. Home
  2. How to

Set AFL/PFL level?

By Ben Rubin @Ben_Rubin
    2022-03-08 22:26:42.336Z

    Anyone know how to set the AFL/PFL level in SoundFlow? The only way i know how to control it is by Command-clicking the Solo button when in AFL/PFL mode. Would love to have a way to set this level without having to do it that way. I believe it's a universal setting for the session.

    thanks
    ben

    • 6 replies
    1. Ben Rubin @Ben_Rubin
        2022-03-29 01:49:15.001Z

        bumping this thread. anyone have any ideas?

        1. Chris Shaw @Chris_Shaw2022-03-29 19:06:33.410Z2022-03-29 23:13:45.922Z

          Hey Ben:
          Unfortunately there's no way to directly enter the PFL level but you could simulate a cmd-click and drag.

          Use this script and tweak the dragAmount to set the level you want.
          Each time trigger the script the gain will be lowered more.
          Use negative values with dragAmount to raise the level.
          As written, each press will lower the gain by a db. (assuming the initial level is 0).
          Doubling the dragAmount value will lower by 2, doubling again will be 4 db, etc)

          There must be at least one track selected.
          The first selected track must be visible in the edit window for this to work.

          // Tweak drag amount(in pixels) to adjust level change (use negative numbers to adjust gain upward)
          const dragAmount = 15 
          
          //get solo button XX/Y parameters
          const soloButtonFrame = sf.ui.proTools.selectedTrack.soloButton.frame
          const soloX = soloButtonFrame.x + soloButtonFrame.w / 2
          const soloY = soloButtonFrame.y + soloButtonFrame.h / 2
          
          // cmd -click and drag AFL Popup fader
          sf.mouse.simulateDrag({
              isCommand: true,
              startPosition: { x: soloX, y: soloY },
              endPosition: { x: soloX, y: soloY + dragAmount }
          });
          
          //slight pause
          sf.wait({intervalMs:150});
          
          //cmd click Solo to briefly show new gain setting
          sf.mouse.down({
              position: { x: soloX, y: soloY },
              isCommand: true
          })
          
          sf.wait({intervalMs:300});
          
          sf.mouse.up({
              position: { x: soloX, y: soloY + dragAmount }
          });
          

          Use this to set Level to unity / 0db:

          //get solo button XX/Y parameters
          const soloButtonFrame = sf.ui.proTools.selectedTrack.soloButton.frame
          const soloX = soloButtonFrame.x + soloButtonFrame.w / 2
          const soloY = soloButtonFrame.y + soloButtonFrame.h / 2
          
          sf.ui.proTools.selectedTrack.soloButton.mouseClickElement({
              isCommand: true,
              isControl: true
          })
          
          //cmd - click Solo to briefly show new gain setting
          sf.mouse.down({
              position: { x: soloX, y: soloY },
              isCommand: true
          })
          
          sf.wait({ intervalMs: 300 });
          
          sf.mouse.up({
              position: { x: soloX, y: soloY }
          });
          
          1. Ben Rubin @Ben_Rubin
              2022-03-30 15:53:27.849Z

              Brilliant, Chris! Thanks so much for this. Works great!

              Btw, it's not necessary to select more than one track because the AFL/PFL level is universal for all tracks.

              1. Ben Rubin @Ben_Rubin
                  2022-03-30 16:15:35.172Z

                  To get the exact level I want, I just put the two scripts in succession (with the 0db first). A drag amount of 242 gets me to -16 db. So great as using the mouse is so inaccurate sometimes.

                  1. In reply toBen_Rubin:

                    But the script could fail if more than one track is selected and the first select the track is offscreen.

                    1. Ben Rubin @Ben_Rubin
                        2022-03-30 17:46:48.881Z

                        understood.