Ways to speed up "sf.ui.proTools.trackGetSelectedTracks"?
So this isn't so much an issue, but an optimization I'm struggling with. I have several scripts using "sf.ui.proTools.trackGetSelectedTracks" and variations thereof. The scripts seem to hang specifically on this action for maybe 100-200 ms, which in a recording environment is a minor annoyance, especially when everything else is so snappy.
I've tried coming up with ways around using this method. And I have questions about the workarounds.
1: Is there a way to "Get Track By Input Name" instead of "trackGotoByInputName"?
I don't want to lose my selection when calling this action, and just want to access a particular track's info. (In one particular case the track name is changing per cue, so I can't "Get Track By Name". I've found some scripts here on the forum to this effect, but all use "sf.ui.proTools.selectedTrackNames" which has a similar hangup.
2: Is there a better way to get selected tracks without using "sf.ui.proTools.trackGetSelectedTracks"?
I'm still working on this so I'll update if the problem shifts.
Linked from:
- Christian Scheuer @chrscheuer2022-09-26 17:18:58.943Z
Generally, SoundFlow's speed when dealing with Pro Tools is tied to the amount of data needed to be transferred between the apps.
Optimizing your scripts so that SoundFlow's cache is only invalidated when needed will ensure less data needs transferred, causing things to go quicker.Frequent calls to
sf.ui.proTools.invalidate()
orsf.ui.proTools.mainWindow.invalidate()
will mean all tracks will need reloading, which could cause slowdowns in large sessions.Other important fixes are to ensure Pro Tools is as responsive as possible. It's a known issue that Pro Tools processes AudioSuite window GUI drawing on the same thread as it processes SoundFlow calls, so if you have many AudioSuite windows open (or even just a few that are draw-heavy) then that will slow SF down.
- In reply toJamison_Rabbe⬆:Chris Shaw @Chris_Shaw2025-04-04 16:01:03.919Z
I'm responding here from a linked forum post to add an updated response.
Getting track names using the new PT SDK implementation should be faster:function getSelectedTrackNamesViaSdk() { const tracks = sf.app.proTools.tracks.invalidate().allItems; const selectedTrackNames = tracks.filter(t => t.isSelected).map(t => t.name) return selectedTrackNames } // example log(getSelectedTrackNamesViaSdk())