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
[Bug] Psirius Memories of Time differs between OMPT and libxmp #588
Comments
@AliceLR ? |
Is Alice unwell? |
I wonder as well... |
Is the issue specifically in channels 21 and 22, i.e. does this command produce all of the affected notes?
This is the only problem I've heard so far. |
Yeah it does; some high-pitched (wrong instrument?), and yes. probably issue with older OMPT (Since this module indicate itself as saved with OMPT) |
Does it sound alright with this patch? This doesn't fix the fundamental issue (missing stereo sample support), just the junk sample data from delta decoding the right channel. diff --git a/src/loaders/xm.h b/src/loaders/xm.h
index 6a863183..4d41486c 100644
--- a/src/loaders/xm.h
+++ b/src/loaders/xm.h
@@ -14,6 +14,7 @@
#define XM_LOOP_FORWARD 1
#define XM_LOOP_PINGPONG 2
#define XM_SAMPLE_16BIT 0x10
+#define XM_SAMPLE_STEREO 0x20
#define XM_ENVELOPE_ON 0x01
#define XM_ENVELOPE_SUSTAIN 0x02
#define XM_ENVELOPE_LOOP 0x04
diff --git a/src/loaders/xm_load.c b/src/loaders/xm_load.c
index 9919ad82..282cbe28 100644
--- a/src/loaders/xm_load.c
+++ b/src/loaders/xm_load.c
@@ -683,6 +683,12 @@ static int load_instruments(struct module_data *m, int version, HIO_HANDLE *f)
xxs->lps >>= 1;
xxs->lpe >>= 1;
}
+ if (xsh[j].type & XM_SAMPLE_STEREO) {
+ /* xxs->flg |= XMP_SAMPLE_STEREO; */
+ xxs->len >>= 1;
+ xxs->lps >>= 1;
+ xxs->lpe >>= 1;
+ }
xxs->flg |= xsh[j].type & XM_LOOP_FORWARD ? XMP_SAMPLE_LOOP : 0;
xxs->flg |= xsh[j].type & XM_LOOP_PINGPONG ? XMP_SAMPLE_LOOP | XMP_SAMPLE_LOOP_BIDIR : 0;
@@ -736,6 +742,11 @@ static int load_instruments(struct module_data *m, int version, HIO_HANDLE *f)
} else {
total_sample_size += xsh[j].length;
}
+
+ /* TODO: workaround for missing stereo sample support */
+ if (xsh[j].type & XM_SAMPLE_STEREO) {
+ hio_seek(f, xsh[j].length >> 1, SEEK_CUR);
+ }
}
}
|
Will check in few. |
Just tested; It works fine. |
This have playback issues between OMPT and Libxmp with weird artifact plays on Ord 1 on libxmp, where OpenMPT doesn't.
Modarchive
The text was updated successfully, but these errors were encountered: