Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add playposition_samples #12950

Open
ronso0 opened this issue Mar 11, 2024 · 8 comments
Open

add playposition_samples #12950

ronso0 opened this issue Mar 11, 2024 · 8 comments

Comments

@ronso0
Copy link
Member

ronso0 commented Mar 11, 2024

Feature Description

Just an idea to simplify position comparison in scripts, which currently requires calculating the sample position with playposition * playposition_samples
Would be an equivalent to sample positions like loop_end_position and others.

@yatigautam
Copy link

i would like to work on this issue.

@ronso0
Copy link
Member Author

ronso0 commented Mar 20, 2024

Just do it.
(tasks are not 'assigned', whoever likes to work on this or that simply does it)

@yatigautam
Copy link

Thankyou.
I would be grateful for your advice on how to approach the issue effectively.

@ronso0
Copy link
Member Author

ronso0 commented Mar 22, 2024

"playposition" is a relative control (0.0 = track start, 1.0 = track end).
Other controls, "loop_end_position" is just an example, are absolute controls (value is track samples), so find out what control type these are and how they are set.
Find out where "playposition" is set, add a new absolute control, probably use toEngineSamplePos() to get the value from the original (internal) control.
I think all this is happening in EngineBuffer.

@yatigautam
Copy link

How can I ensure that the new absolute control behaves correctly across different playback scenarios, such as when the track is being looped or when there are tempo changes?

@daschuer
Copy link
Member

daschuer commented Apr 9, 2024

Since "playposition" is known good, you may find all places where it is written and replace it with a wrapper to write this along with the new "playposition_samples"

@Holzhaus
Copy link
Member

Holzhaus commented Apr 17, 2024

What do we need that new control for? You can already just multiply the track_samples and playposition COs. Do you need this calculation often enough that this additional CO is needed?

I'd rather not add more sample-based COs when we plan to switch to frame-based COs for a long time but also need the sample-based ones for backwards-compatibility.

If this is just about scripts, we could also add a JS helper method instead.

@ronso0
Copy link
Member Author

ronso0 commented Apr 17, 2024

Agreed, let's go with the script helper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants