pinobatch / pently

Scalable music engine for NES games
zlib License
72 stars 4 forks source link

Calculate track durations #40

Closed pinobatch closed 5 years ago

pinobatch commented 5 years ago

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:

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: