strangerattractor / Soundvision_PUBLIC

Max's long long journey into the unity world.
Other
12 stars 1 forks source link

Timeline Pause overshooting if timeline speed is very high #124

Closed strangerattractor closed 4 years ago

strangerattractor commented 4 years ago

I want to end transitions between states with timeline in time with a chosen downbeat after either a four bar or one bar loop.

I therefore chose to make every transition between states 16 seconds long in the timeline ((time between two markers in the timeline) and speedup timeline playback, so that so the whole transition animation gets played, no matter when we trigger it (forwards or backwards) I chose 16 seconds because the minimum tempo that we could technically play with CYLVESTER is 30BPM (none of our instruments goes slower) and the longest triggerloop we currently have is 4 bars. Thus 16 seconds for the longest possible transition if we don't want to loose resolution of the animation. I therefore only have to speed up the timeline playback. So we couldn't technically get any jittery transitions.

But this throws two problems:

  1. working with a 16 seconds transition in the timeline view is confusing, I now have to place markers at 0 16 32 48 64 80 .... It would be easier to go 0 10 20 30 40....

  2. public void OnNotify doesn't seem to be called often/quick enough. the playhead overshoots the marker if the timeline speed is set higher then 1.
    So when we resume timeline, we jump back to the marker, which results in a noticeable jump in the beginning of each transition.

so maybe 16 seconds is a bit overkill?

strangerattractor commented 4 years ago

could you please have a look at this? Do you see a solution? This started to become obvious once I added changed timeline speeds

chikashimiyama commented 4 years ago

I guess some math solves #1. Another option is to have multiple timelines but then you lose the visual overview of the composition.

chikashimiyama commented 4 years ago

hmm... I have never thought about the backward playback.
OK if I understand correctly, the AC of this bug fix is following.

in Qlist demo scene

strangerattractor commented 4 years ago

Correct

strangerattractor commented 4 years ago

1 is already in my code. The problem is, that I was a afraid to loose resolution if I go to 0 1 2 3 seconds. I'll investigate how bad the problem can become and then decide. Choosing 16 seconds made the need for a high speed playback of the time line. And this might increase the problem of overshoot bug. that was why I explained the whole functionality of the stuff I added.

chikashimiyama commented 4 years ago

It's kinda complicated problem but there is a solution I guess

I think the biggest problem is the time in timeline is not in our hands. so I changed Update Method of Playable Director to Manual and control the position of play cursor from the script manually. In this way, I can prevent PlayableDirector to update values and increment the position of playcursor without my permission.

chikashimiyama commented 4 years ago

I also implement stop at previous marker feature in Timeline Controller