No internet connection
  1. Home
  2. How to

Varispeed and tempo toggle

By Emil Woxen @Emil_Woxen
    2023-11-23 18:32:17.415Z

    I would like a script that toggles between "none" and "Varispeed" on elastic audio, as well as toggling the Tempo menu open, and close.

    I found a script on the forum that should set elastic to Varispeed, however it prompts "Popup menu was not found".

    
    const popupMenu = sf.ui.proTools.selectedTrack.popupButtons.whoseTitle.is("Current Elastic Audio or ARA Plug-in").first.popupMenuOpenFromElement({
        relativePosition: { "x": -3, "y": 3 },
        isOption: true,
        isShift: true,
    }).popupMenu;
    
    popupMenu.popupMenuSelect({
        menuPath: ["Monophonic"],
    });
    
    

    Maybe some of you kind people could throw some light on this, and help me out :)

    • 3 replies
    1. this should toggle the Elastic Audio between None and Varispeed:

      const currentEaSetting = sf.ui.proTools.selectedTrack.popupButtons
          .whoseTitle.is("Current Elastic Audio or ARA Plug-in").first
          .value.invalidate().value;
      
      const eaPopup = sf.ui.proTools.selectedTrack.popupButtons.whoseTitle.is("Elastic Audio or ARA Plug-in selector").first;
      
      let newEaSetting = currentEaSetting == "" ? "Varispeed" : "None"
      
      eaPopup.popupMenuSelect({
          menuPath: [newEaSetting],
          isShift: true,
          isOption: true,
      })
      

      I'm not sure which tempo menu you're referring to. Cooould you be more specific?

      1. EEmil Woxen @Emil_Woxen
          2023-11-29 09:26:26.269Z

          That works great, thank you!

          It's the window at the top between the top bar, and the arrangement view.
          It's right between Timecode and Markers, called Tempo.

          I would like that to open, if it's not opened, when i select varispeed, and close it, if it's not closed, when i changed it back to none.

          1. In reply toChris_Shaw:
            EEmil Woxen @Emil_Woxen
              2023-11-29 12:54:19.440Z

              I made it myself

              const currentTempoSetting = sf.ui.proTools.mainWindow.buttons.whoseTitle.is("Tempo Editor expand/collapse").first.value.invalidate().value;
              
              const currentEaSetting = sf.ui.proTools.selectedTrack.popupButtons
                  .whoseTitle.is("Current Elastic Audio or ARA Plug-in").first
                  .value.invalidate().value;
              
              const eaPopup = sf.ui.proTools.selectedTrack.popupButtons.whoseTitle.is("Elastic Audio or ARA Plug-in selector").first;
              let newEaSetting = currentEaSetting == "" ? "Varispeed" : "None"
              
              eaPopup.popupMenuSelect({
                  menuPath: [newEaSetting],
                  isShift: true,
                  isOption: true,
              })
              
              const tempoValidate = () => {
                  if (newEaSetting === "Varispeed" && !currentTempoSetting) {
                      sf.soundflow.runCommand({
                          commandId: 'user:ckp49i4j60000a2100yfwywgf:cku2diuae0000sz10rkogpg2j#cktxjf0yq005j5310swemd9wj',
                          props: {}
                      });
                  } else if (currentTempoSetting) {
                      sf.soundflow.runCommand({
                          commandId: 'user:ckp49i4j60000a2100yfwywgf:cku2diuae0000sz10rkogpg2j#cktxjf0yq005j5310swemd9wj',
                          props: {}
                      });
                  }
              };
              
              tempoValidate();