Hi,
we have the wonderful script called "Output Window: Follow Selected Track"
Is it possible to have this for Insert Slots?
Thanks
Linked from:
- Ingo Pusswald @ingo_luftrausch
So far I have this, and its working somehow. The PluginWindow is constantly re-opened (blinking :-(
Any Tipps on how to modify?
thxvar lastFocusedTrackName;
function main() {
const firstSelectedTrackHeader = sf.proTools.trackGetFirstSelectedTrackHeader({ onError: "Continue", }).firstSelectedTrackHeader; firstSelectedTrackHeader.trackInsertToggleShow({ insertNumber: 3, onError: "Continue", });
}
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 timeoutglobalState[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);
- In reply toingo_luftrausch⬆:Ingo Pusswald @ingo_luftrausch
After lots of try and error, here is it finally: Track Output Window + Insert Slot Nr3 follows Track Selection.
var lastFocusedTrackName; function main() { try { var newName = sf.ui.proTools.selectedTrackNames[0]; if (newName === lastFocusedTrackName || newName === undefined) return; lastFocusedTrackName = newName; if (sf.ui.proTools.selectedTrack.outputWindowButton.value.invalidate().value !== 'open') sf.ui.proTools.selectedTrack.trackOutputToggleShow({ onError: 'Continue' }); sf.ui.proTools.selectedTrack.trackInsertToggleShow({ insertNumber: 3, targetValue: "Enable", onError: "Continue", }); } catch (err) { } } 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)`;` `
Christian Scheuer @chrscheuer2020-04-17 17:29:55.060Z
Great work, Ingo!!
- In reply toingo_luftrausch⬆:DDan Bozek @Dan_Bozek
How are you getting this to work/trigger? I would love to get this working on my rig!!
Ingo Pusswald @ingo_luftrausch
Hi Dan,
I have a XL Deck full of triggers build around that script.
Follow Insert No. X with or without Pan Window of selected track etc.
Its basically working but sometimes there are hick-ups cause of the loop running in background.
If I forget to post it within the next 4 days give me a reminder ;-)
- DDan Bozek @Dan_Bozek
Cool!! No hurry. I'm just curious. It is a fantastic idea.
Ingo Pusswald @ingo_luftrausch
Here is the Deck:
The "STOP" button is the "stop all running commands" from the SF main menu.
You need to stop everytime you wanna switch the Insert number to follow.As I mentioned it has it hick-ups....
Here is the script for "follow Pan/Ins A":
var lastFocusedTrackName; function main() { try { var newName = sf.ui.proTools.selectedTrackNames[0]; if (newName === lastFocusedTrackName || newName === undefined) return; lastFocusedTrackName = newName; if (sf.ui.proTools.selectedTrack.outputWindowButton.value.invalidate().value !== 'open') sf.ui.proTools.selectedTrack.trackOutputToggleShow({ onError: 'Continue' }); sf.ui.proTools.selectedTrack.trackInsertToggleShow({ insertNumber: 1, targetValue: "Enable", onError: "Continue", }); } catch (err) { } } 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);
But its the same script allready posted above.......