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

*.AMS Velvet Studio pattern decoding #86

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mywave82
Copy link

Comparing the algorithm with the one in Open Cubic Player and with Velvet Studio https://github.com/Patosc/VelvetStudio/blob/master/Code/AMS_LOAD.ASM line 402 a minor detail seems to be missing

First byte in a row with value 0xff is special - meaning that the row is empty.

This is not documented the format documentation of Velvet Studio. Please test this against real Velvet Studio module files (can be found on https://modland.com/pub/modules/Velvet%20Studio/ )

@sagamusix
Copy link
Contributor

sagamusix commented Mar 21, 2022

The same fix needs to be applied to the other AMS loader in the same file (see e.g. target em.ams). And for the sake of consistency, the ModPlug code base uses uppercase hex literals.

@sezero
Copy link
Contributor

sezero commented Mar 22, 2022

For me, many of the ams files from modland don't play already, with or without this - their durations reported something close to 0...

@sagamusix
Copy link
Contributor

sagamusix commented Mar 22, 2022 via email

@mywave82
Copy link
Author

The same fix needs to be applied to the other AMS loader in the same file (see e.g. target em.ams). And for the sake of consistency, the ModPlug code base uses uppercase hex literals.

You seem to be correct, I will update PR later tonight or tomorrow

… without a note/instrument prefix.

(Please note that the current parser only keeps the last command if multiple commands are given at the same channel/row position)
@mywave82
Copy link
Author

I updated that Extreme's Tracker parser uses the same 0xff == no data on row.

I also tried to fix Velvet Studio parser with known good logic from Open Cubic Player. Please note that I have not compile-tested the code since I do not use libmodplug - only used it as code-reference.

Velvet Studio files that uses multiple commands on the same channel/row coordinate will not playback correctly due to libmodplug only supports one command per channel/row location (unless I have missed something)

@sagamusix
Copy link
Contributor

unless I have missed something

That's mostly correct, there is also the "volume column" which supports a smaller set of effects (like in S3M/IT/XM). OpenMPT, based on the same code, solves this problem by juggling around commands between those two columns, but all of the supporting code for that is completely missing in libmodplug, so probably not worth doing here.

@sezero
Copy link
Contributor

sezero commented Mar 25, 2022

I pulled this into my fork, and also ported to the libmodplug version embedded in SDL_sound. Let's see how it goes.

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

Successfully merging this pull request may close these issues.

3 participants