opencubicplayer icon indicating copy to clipboard operation
opencubicplayer copied to clipboard

Broken IT modules

Open m4tustechna opened this issue 10 months ago • 10 comments

Hello!

First of all, thank you for continuing to develop this awesome tracker. Your player was one of the main reasons I switched to GNU/Linux (before then, there weren't Windows builds).

I noticed that some tunes don't play well in OCP. I'm guessing that some IT files were probably converted from MO3. Both Future Crew and Skaven uploaded MO3 and IT versions, but I'm not sure.

All of these files played fine in Impulse, Schism, ModPlug, and OpenMPT.

I also noticed that MOD files run slightly slower than on the original Amiga hardware. I have to press CTRL+F11 to change the speed value by 0.33% instead of 3%. Then, I press F10 twice to reach 100.66% speed. This also happens on FastTracker ][.

Here are links to the files that play incorrectly:

Amazonas - Dynomite Mix (amazonas-1347.it) https://modarchive.org/index.php?request=view_by_moduleid&query=172351

Ocean Paradise (bacter_vs_saga_musix_-_ocean_paradise.it) https://modarchive.org/index.php?request=view_by_moduleid&query=193037

Beyond the Network (beyond_the_network.it) https://modarchive.org/index.php?request=view_by_moduleid&query=156184

Bookworm (bookworm.it) https://modarchive.org/index.php?request=view_by_moduleid&query=191058

Codename Silver (Codename_Silver.it) http://www.futurecrew.com/skaven/song_files/Codename_Silver.it

Deep in her Eyes (deep_in_her_eyes_-_remake.it) https://modarchive.org/index.php?request=view_by_moduleid&query=133609

Fourth Symmetriad (skaven-fourth_symmetriad.it) https://modarchive.org/index.php?request=view_by_moduleid&query=67203

Hamster Ball (hamsterball_gold.it) https://modarchive.org/index.php?request=view_by_moduleid&query=179543

Rama Gardens v1.1 (rama_gardens_-_remake.it) https://modarchive.org/index.php?request=view_by_moduleid&query=133610

Bad Tracker!! (badapple.it) https://modarchive.org/index.php?request=view_by_moduleid&query=179366

m4tustechna avatar Feb 26 '25 15:02 m4tustechna

Let me first comment on your remark regarding speed. That Open Cubic Player matches Fast Tracker II. It actually a good thing, since most of the Amiga formats are played back using "playxm", which is the Fast Tracker II playback driver.

playgmd 669 (Composer 669, DOS) AMS (Extreme Tracker, DOS) DMF (d-lusion X-Tracker, DOS) MDL (DigiTrakker, DOS) MTM (Multi Tracker by DigiTrakker, DOS) OKT (Oktalyzer, Amiga) PTM (Polytracker, DOS) S3M (Scream Tracker 3, DOS) STM (Scream Tracker II, DOS) ULT (UltraTracker, DOS)

playit IT (Impulse Tracker, DOS)

playxm M15 (Noise Tracker 15 instruments, Amiga) M15t (Noise Tracker 15 + ProTracker 1.1b tempo commands, Amiga) M31 (Noise Tracker 31 instruments, Amiga) MOD (ProTracker 1.1b, Amiga, ish) MODd (ProTracker 1.1b + Dual Module Player panning, Amiga) MODf (Fast Tracker II, DOS) MODt (ProTracker 1.1b, only tempo, no speed, Amiga) MXM (MXMPlayer, originaly XM files, DOS) WOW (Mod's Grave utility, originally Composer 669 files, DOS) XM (Fast Tracker II, DOS)

On PC, the playback can calculate exactly how many samples one tick should be.

On Amiga this work is put onto timers and interrupts, and to my knowledge, those timers had a given granularity that always would make the timers inaccurate. So if we want to Amiga compatibility an option, we likely need a lookup table, resolving module BPM values into real herz. Also PAL and NTSC Amiga have different base-clocks.

mywave82 avatar Mar 01 '25 19:03 mywave82

I am looking at one detail at a time. So the timing is the first thing I am looking into.

Testing the algorithm from https://github.com/8bitbubsy/pt2-clone/blob/master/src/pt2_replayer.c vs calculating perfect BPM to tick lengths, the difference I get for a PAL Amiga is that speed should be set to 100.003% to match.

So that would not account for what you experience, the need for speed to be set to 100.66%.

How did you actually reach this number, and how does https://github.com/8bitbubsy/pt2-clone compare to your experience of what the correct speed should be.

I need to clarify what the cause is, before hunting this down any further,

mywave82 avatar Mar 06 '25 21:03 mywave82

I believe ddefb1f0116b6650ccb0500046d72685120a0da6 fixes the broken IT files. Please verify if possible.

mywave82 avatar Apr 01 '25 21:04 mywave82

I apologize for the delay in getting back to you.

How did you actually reach this number

I based it on OCP’s top-right speed value and counted how many times I pressed the F10 key. I’ll try to get the actual value you’re asking for sometime this week.

I believe ddefb1f fixes the broken IT files. Please verify if possible.

Playback does sound much more listenable now! Some of the samples are still a bit off, but honestly, I’m not complaining—I’m very happy with the results so far. Thanks a lot for taking the time to fix this!

m4tustechna avatar Apr 14 '25 15:04 m4tustechna

I am working on playback of stereosamples in actual stereo, and not downmixed to mono and panned. It works when testing, but I need to refine the code first

mywave82 avatar Apr 14 '25 15:04 mywave82

I apologize for the delay in getting back to you.

How did you actually reach this number

I based it on OCP’s top-right speed value and counted how many times I pressed the F10 key. I’ll try to get the actual value you’re asking for sometime this week.

Not how to adjusted the speed in OCP, but how did you reach the conclusion that OCP plays them at the incorrect speed. I did compare the tick-length against the crystals-values and the expected numbers of cycles for the programmable timer used by Amiga hardware.

mywave82 avatar Sep 07 '25 18:09 mywave82

Hello,

Apologies for the delayed response.

To clarify my conclusion that OCP plays at an incorrect speed, I based my observation on the playback of Daxx/Ravebusters mods. After listening carefully, I noticed discrepancies in the timing of the samples, which led me to investigate further.

I've created a video to demonstrate this. In the video, you can observe noticeable gaps between samples when comparing playback at 100% speed and at 101% speed (I made an error earlier by mentioning 100.66, apologies for that).

VIDEO: https://www.youtube.com/watch?v=aPKKepFfXfA LINK TO MOD: https://api.modarchive.org/downloads.php?moduleid=92506#children_165bpm.mod

The first part shows a recording of an Amiga 1200 playing children_165bpm_mix.mod on Protracker 3. The second part shows OCP playing at 100% speed. The final part shows OCP adjusted to 101%, which aligns more closely with the Amiga 1200's playback.

Please let me know if there's anything unclear.

m4tustechna avatar Sep 27 '25 12:09 m4tustechna

I just tested 8bitbubsy's FT2 clone and the same speed issue occurs there as well. Not sure if that’s helpful, but I thought I'd mention it.

m4tustechna avatar Sep 27 '25 12:09 m4tustechna

I will look more into this later (and study your videos). Thank you for sticking to the report.

Tick length I have verified against Amiga specified crystals and timer programming.

So problem is probably not the tick-length, but the sample-pitch. (adjust speed up a tiny bit, will in effect to the same as adjusting the tempo tiny bit down)

The sample pitch is then another detail I have to look further into, and it comes with some oddities as well. Amiga MOD files do not actually store note-data, but register pitch values to be written to the hardware. Amiga MOD files do actually allow to fine-tune these, while most MOD software will round these to nearest note, and the the reverse when saving the file.

So I need to verify the pitch-calculations, and perhaps for Amiga MOD files, use the register pitch values stored in the file, and only use the rounded off note-data for screen-display purposes.

mywave82 avatar Sep 29 '25 08:09 mywave82

children_165bpm.mod sounds correct with the patch in #144 (currently stored with branch name "protracker-rate").

Playing samples at 99.1% rate compared to earlier. (adjusting down pitch, to match expected default sample rate of an Amiga PAL machine)

mywave82 avatar Oct 02 '25 21:10 mywave82