expose endTime and endTick #520
Replies: 3 comments 2 replies
-
I do not yet get why the According to your use case description you are trying to sync alphaTab with an audio player. From this I would derive that you actually need a mechanism to set the cursor of the tab to a given time (second) position which is coming from the audio player. Am I right with this assumption? If you have a separate audio player I would guess the synthesizer does not really have a relevance for you. Of course if the user might switch between synth and let's say mp3, you would need to send the current position once to the player. All this goes with the assumption that the audio played in the source is already 100% synchronized with the synthesized audio and we can safely assume that there are no differences. |
Beta Was this translation helpful? Give feedback.
-
yes your assumptions are correct. Although, I had a corner case where the
it would have been very convenient for me to reuse that code to trigger
vs
In that way I can just spam sync() all over my code without thinking too much about when to play alphatab. sorry I dragged you into this mess of a project I'm trying to put up :D |
Beta Was this translation helpful? Give feedback.
-
This actually solves it Basically I was not setting my global Few more details about my implementation: My current sync implementation is basically setting Also I don't really rely on the end time of the track being the same of the video cause when I transcribe a tab, the endTime is actually less than the video. I made a small editor which allows you to edit the tab with raw alphatex in relatime. (yeah interactive tab editing would be cool but that's a start) I like the "stop point" approach. I remember seeing the part of the code where you're building the event map from last time when I was trying to get metronome events. Unluckily it's not yet exposed and IIRC it's buried in the worker. I Might try to build something on top of what you mentioned once events are exposed! Your examples are really cool, the logic is very similar to what I'm doing. I like the one where you stretch the time. That'll definitively come handy to implement something like loop-up-to-speed. I'll DM a link to my POC in case you wanna have a sneak peak ;) Thanks for the support! |
Beta Was this translation helpful? Give feedback.
-
can you please consider exposing
this._sequencer.endTime
asat.player.playbackEndTime
and
this._sequencer.endTick
asat.player.playbackEndTick
?Use case is: I need to keep the tab in sync with an audio player. I know
endTime
is available in thewindow.at.playerPositionChanged
event.When I play the
audio player
and sync the time with thetab
, I check theaudio player
current time did not overshoot thetab
end time before playing thetab
but now I lack that info at the first iterationI'll open a PR as well since it's an easy fix
edit: PR is here #521
Beta Was this translation helpful? Give feedback.
All reactions