Request: "sf.app.proTools.getTimelineSelection()" returns a property "mainCounterValue" or "playheadPosition".
Right now SoundFlow's Pro Tools API method sf.app.proTools.getTimelineSelection()
has the following properties.
sf.app.proTools.invalidate()
const timelineSelection = sf.app.proTools.getTimelineSelection({
timeScale: "Samples"
});
const {
inTime,
outTime,
playStartMarkerTime,
postRollEnabled,
postRollStopTime,
preRollEnabled,
preRollStartTime
} = timelineSelection;
log({
inTime,
outTime,
playStartMarkerTime,
postRollEnabled,
postRollStopTime,
preRollEnabled,
preRollStartTime
});
I'd love to see a property added for the playheadPosition
. For getting a sample-accurate timestamp of the current play head position without having to be in samples mode.
- GGraham Archer @Graham_Archer
Hey @Kitch, I'm not quite sure if this is the right place to ask this more general question, but what you've written here is brilliant, succinct, easy to follow and exactly what I need in order to go ahead and use sf.app.proTools.getTimelineSelection().
I've really seen the power and robustness in the SDK commands I've been using of late and I just wondered if there's a list of the commands with a working example for each command anywhere? I just think it would be so useful.
I have the link for the SF API:
https://soundflow.org/docs/api/globals
but maybe it's the fact I'm not an out and out programmer, it just doesn't make that much sense to me, the methods syntactically don't seem to be the same and I can't find working examples.
I know you can start by typing the commands in SF and what's available for sf.app.protools is shown but you have to do a fair bit of scrolling to see everything (in a list that will presumably grow) and then when you do find a command that sounds like what you need, I then spend a fair chunk of time on the forum trying to find the correct syntax to make it work.
I actually screenshotted all the sf.app.protools commands, stuck then into Chat GPT and got it to kick me back an excel table just so I can see everything that's currently available.I can't help thinking that the way you've laid this post out above is exactly what people need! Is there a way to weave that into the API manual or have a separate reference manual which is vetted by the SF team and results in the code that people need to practically get going? This post reminded me a little of how Max Msp has a working example as it's help/reference manual - in a great way.
Thank you and discuss!
Kitch Membery @Kitch2025-04-24 18:08:44.967Z
Hi @Graham_Archer,
Thanks for asking.
"I just wondered if there's a list of the commands with a working example for each command anywhere?" - Right now, there is not, but we plan on adding more documentation along these lines in the future.
Are you available to jump on a quick Zoom call right now... There are a few things that I can show you that may unlock this information without the need for such documentation. If so, please send an email to support@soundflow.org, and I can send you a Zoom link. :-)