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

.it global sample volume is broken #102

Closed
AliceLR opened this issue Aug 13, 2017 · 3 comments · Fixed by #218
Closed

.it global sample volume is broken #102

AliceLR opened this issue Aug 13, 2017 · 3 comments · Fixed by #218
Assignees
Labels
Milestone

Comments

@AliceLR
Copy link
Contributor

AliceLR commented Aug 13, 2017

This .it file contains two copies of the same sample with different global sample volumes that are played at different pitches. When played in Impulse Tracker, one low sample can be heard clearly; when it's played with xmp, both samples can be heard equally loud. libxmp seems to treat the global sample volume as maximum.

global_sample_volume.it.zip

@AliceLR
Copy link
Contributor Author

AliceLR commented Sep 7, 2017

Fixing this seems to be a matter of

  1. Enabling QUIRK_INSVOL in sample mode (it_load.c, line 1120)
	if (sample_mode || ifh.cmwt >= 0x200) {
		m->quirk |= QUIRK_INSVOL;
	}
  1. Setting the volume of the fake instruments that get generated in sample mode (it_load.c, line 783)
	if (sample_mode) {
		/* Create an instrument for each sample */
		mod->xxi[i].vol = 64;

I don't know how this would affect old format .its though.

@AliceLR
Copy link
Contributor Author

AliceLR commented Nov 10, 2020

It looks like load_it_sample assigns the subinstrument global volume to the sample global volume regardless of the IT format version. QUIRK_INSVOL must be enabled to apply subinstrument global volume (https://github.com/libxmp/libxmp/blob/master/src/player.c#L736) so as far as I can tell QUIRK_INSVOL should be applied unconditionally to IT modules.

This should still be verified with an old format IT module.

@AliceLR
Copy link
Contributor Author

AliceLR commented Nov 10, 2020

Here's an IT 1.x module with instrument mode enabled that very obviously relies on sample global volume (in one of the drums, but much more noticeably with the vocal samples). IT 1.06, IT 2.14, and OpenMPT all play these samples at a lower volume than xmp. When I change this patch to unconditionally enable QUIRK_INSVOL xmp also plays it correctly.

https://modland.com/pub/modules/Impulsetracker/Ranger%20Rick/witness.it

Current patch here: master...AliceLR:fix-it-sample-volume-vibrato. The vibrato part of this patch (#103) still needs to be verified.

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

Successfully merging a pull request may close this issue.

3 participants