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

Speed-invariant time measurements #112

Open
mmontag opened this issue Jun 4, 2023 · 3 comments
Open

Speed-invariant time measurements #112

mmontag opened this issue Jun 4, 2023 · 3 comments

Comments

@mmontag
Copy link

mmontag commented Jun 4, 2023

Hi, I noticed that the return values of PlayerA::GetTotalTime and PlayerA::GetCurTime change with playback speed.
For example, if current/total time is 10s/30s, and you set speed to 2.0x, then current/total time becomes 5s/15s.

I find it easier to think of a song's clock duration as fixed, much like song ticks.
What is the simplest way to modify this behavior in my fork so that the time is constant over change of playback speed?

@mmontag
Copy link
Author

mmontag commented Jun 4, 2023

Just multiplying these by current speed is the easiest fix (thanks @ValleyBell).

Now I remember I had to do a similar tweak in game_music_emu:
mmontag/chip-player-js@8e912ff

@ValleyBell
Copy link
Owner

The eventual play is to have a separate "flags" parameter that allows the user to switch between various time formats.

  • with or without loops
  • actual (playback) time or file time

Use cases:

  • VGMPlay: without loops (jumps back at loop point), "file time" (progressing going slower or faster when changing playback speed)
  • in_vgm: with loops (effective playing time), "actual time" (real time independent of playback speed)

@ValleyBell
Copy link
Owner

Does 77909e3 add all the options you need?

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

No branches or pull requests

2 participants