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

Calculate track durations #40

Closed
2 tasks
pinobatch opened this issue Mar 8, 2019 · 0 comments
Closed
2 tasks

Calculate track durations #40

pinobatch opened this issue Mar 8, 2019 · 0 comments
Labels
enhancement pentlyas shell NES, NSF, and NSFe shells

Comments

@pinobatch
Copy link
Owner

Loop detection in some NSF players has false positives and false negatives, and the way Pently handles tempo (particularly with PENTLY_USE_TEMPO_ROUNDING_* off) is likely to trigger them. It'd be better to include actual playback times in an NSFe or NSF2 format file.

VGM taggers assume these conventions:

  • For songs using fine, write the duration, and don't fade out.
  • For songs using da capo, write twice the duration.
  • For songs using dal segno, write the duration plus the portion of
    the duration after segno.

How to calculate: The handler for at (which emits waitRows) will need to count not only musical time but also wall time, which is musical time divided by the tempo at which each row was played.

NSFe durations are in a time chunk, with each track's duration expressed in milliseconds as a 32-bit integer. The fade chunk expresses fade times similarly: $00000000 for immediate cut, $FFFFFFFF for fade of unspecified duration, or a custom value for a specific fade.

Steps toward solving this:

  • Write the duration of each track as source code comments
  • After Write NSFe format #39, if duration estimation is USEd, write the durations to NSFe as time and fade chunks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement pentlyas shell NES, NSF, and NSFe shells
Projects
None yet
Development

No branches or pull requests

1 participant