Varispeed and tempo toggle
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 :)
- Chris Shaw @Chris_Shaw2023-11-27 19:10:24.729Z
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?
- EEmil Woxen @Emil_Woxen
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.
- In reply toChris_Shaw⬆:EEmil Woxen @Emil_Woxen
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();