Can You Read Play Position Of Currently Playing Sample?

I want to try make a script that let’s you add new slices as the sample plays in the editor.
It needs to read the currently playback position of the playing sample in the sample editor. (how) Is this possible?

Thanks

Sounds a little too close to real-time processing to be likely. Saying even playback position in the pattern is sketchy…

But theres still a property for pattern position isnt there.

Seems a bit crazy you can play a song backwards but i can’t do this.
I think i know what you mean by real time though

To “read the currently playback position of the playing sample in the sample editor” is something i’d like to see in the lua API. I actually wouldn’t consider reading from a real-time buffer to count as real-time processing as it is a one shot request at script level that will not affect the buffer. On the other hand the result might be late, but that shouldn’t matter as use cases should be at script level and not attempting real-time updates. In short we’re getting data to display it, not to manipulate it, should be ok.

But “a little too close to real-time processing to be likely” is valid as the API is today.

Yet “theres still a property for pattern position” so it seems we could somehow approach this problem with a work around, true.

But “playback position in the pattern is sketchy…” so we should avoid it, yet “Seems a bit crazy you can play a song backwards but i can’t do this”, oh but you can :) – I guess we could say that Reverse Playback is sketchy, but I like sketchy code so I implemented your idea with some sketchy work arounds.

2066 mogue.Cyflow.SampleMarkerHotkey-0_1.xrnx

The XRNX adds a keybinding to “Sample Editor:Slices” called “Add Slice Marker At Playback Position” the keybinding only works in the sample editor during playback and adds a slice marker at the currently playing sample. Note that adding a slice marker during playback causes an off trigger on the sample that the marker was added to. So the sound stops when using the tool, but this is an unrelated bug to your question.

The tool is not nearly perfect and will always be sketchy as it uses it’s own function to calculate the final sample playback position. But it’s actually quite accurate in time and worked in most of my testing scenarios so it might be of more use then expected.

I hope you enjoy the XRNX and that it will help you achieve what you wanted, post if you have any comments or questions. At least it was a fun project, thanks for a interesting problem.