DigiBooster 2/3 plugin

Started by krashan,

saga

Quote from: krashan1. How would you determine the length (playback time) of a module, which is explicitly infinitely looped with Bxx and Dxx effects?
It's not like this is an unsolved problem, plenty of other plugins and XMPlay's own module player can do it as well.
To give you a very rough idea of how OpenMPT (and most likely also XMPlay) does it...

- Initialize some bit array which stores one bit for every row of every pattern. Bit set = row has been visited. Initially, all bits are 0.
- Emulate module playback (i.e. without rendering samples and such, since it's not necessary), and for every row that has been visited, set the corresponding bit to 1.
- If a row has been visited before (bit is 1), abort length detection.
- For seeking, extend the above behaviour to also keep track of row times, and as soon as the wanted seek time is reached, stop the emulated playback process and set the "real" player's playback position to the one determined by the emulation.
Now if a module is set to loop endlessly, obviously the reported song length would be the time at which the song starts to loop.

Two things to keep in mind:
- Pattern loops may lead to infinite loops. To avoid this, Keep track of the time of first row of the pattern loop, and when you reach the end of the loop, add the time that has passed since the first row of the loop as many times as the loop count is set to.
- Emulation should probably keep track of any kind of "global" effects such as global volume changes, so that their correct value is set when seeking.

Since, as far as I understand, you are also the author of libdigibooster3, it should be possible for you to implement this stuff directly in the library.

krashan

#21
@saga: Thank you for these explanations. While not trivial, the task seems to be doable, and in fact it would be better to implement this functionality inside libdigibooster3 and expose through the public API.

guest

ftp://modland.com/pub/modules/Digibooster Pro/Blakkhar/zuckerfrei.dbm
1. Sample names 7, 8, 9, 18 aren't displayed completely.
2. There are clicks eg. at 1:10-1:30.

krashan

Quote from: guest1. Sample names 7, 8, 9, 18 aren't displayed completely.

Seems that FormatInfoText() function from the XMPlay API filters out texts with characters outside ASCII range. All these samples contain German character "ü". I will probably have to replace FormatInfoText() with custom code. It is also possible that this function expects UTF-8 string, so ISO-1 "ü" is detected as bad encoding.

Quote from: guest2. There are clicks eg. at 1:10-1:30

This requires further investigation. It may be a bug in the replayer.

saga

Yes, XMPlay expects UTF-8 strings. You can use WinAPI's MultiByteToWideChar to convert between charsets.

krashan

I've released version 0.4, which fixes problem with non-ASCII characters in the module title and sample names. As DigiBooster Pro 2.x not saved any codepage information, I assume that all the names are in Amiga standard ECMA Latin-1, which is identical to ISO-8859-1. Then I convert these strings from ISO-8859-1 to UTF-8 and pass to XMPlay.

As for clicks in "zuckerfrei.dbm", the problem is located inside libdigibooster3 and will be fixed there, then I will update the plugin.