Author Topic: Soundtracker mods won't play  (Read 11053 times)

Fraggie

  • Posts: 710
Re: Soundtracker mods won't play
« Reply #25 on: 13 Feb '13 - 17:36 »
That D00 command is a probably a tracking mistake as blood money is a Soundtracker 2.0-2.2 Master Soundtracker song.

Since, in any Soundtracker, you cannot jump to a particular row with Dxx, notes after a Dxx command are never reachable, so there's no point to have them there. So, if there are notes after Dxx you can make a lucky guess that that command was not a pattern break after all. ;)
 
How did you do it, Ian? :)

Edit: Since Dxx is neither volume slide nor pattern break this must be Master Soundtracker of course.
« Last Edit: 14 Feb '13 - 07:55 by Fraggie »

saga

  • Posts: 2131
Re: Soundtracker mods won't play
« Reply #26 on: 13 Feb '13 - 18:41 »
This file posted on page 1 definitely uses D00 for pattern jumps, but also has a D00 which is followed by more pattern data in pattern 27 - so nope, that heuristic also won't work reliably. The only heuristic I can think of right now would be to reject pattern jumps on row 0, which would be extremely specific and arbitrary, but hey, we're talking about Soundtracker. :)

Ian @ un4seen

  • Administrator
  • Posts: 19987
Re: Soundtracker mods won't play
« Reply #27 on: 14 Feb '13 - 13:30 »
Edit: So the E0F effects in sll17.3 are all useless, right?
Why? They seem legit. (I've updated the post, Exy also slides by itself.)

I wasn't sure about that either. The wording in the Soundtracker III docs suggests that Exx alone does nothing, but it does appear to behave like Dxx then, so here's an update that will treat it the same as Dxx...

   www.un4seen.com/stuff/xmplay.exe

The files below refuse to play or sound like garbage:
http://files.exotica.org.uk/?file=exotica/media%2Faudio%2FUnExoticA%2FGame%2FBaudlot_Jean%2FBad_Dudes.lha
http://files.exotica.org.uk/?file=exotica/media%2Faudio%2FUnExoticA%2FGame%2FBaudlot_Jean%2FBad_Dudes_Dragonninja.lha
http://files.exotica.org.uk/?file=exotica/media%2Faudio%2FUnExoticA%2FGame%2FBaudlot_Jean%2FOperation_Wolf.lha
This is because of non-existing pattern numbers present in the order table. I've double checked that these rips are correct. I don't know if this is specific to Soundtracker or to these games only. Can we have a mechanism that will scan patterns from the whole order table (as it is now) and only up to song length and then pick up the pattern count that matches?

The update above includes some modifications for that. Let me know if you find it still has trouble with any files.

Moreover module mod.dragonx from Bad_Dudes.lha plays at speed 267! :)

But does it sound OK? :)

The Soundtracker BPM/speed value is translated to a ProTracker equivalent BPM. At least, that's the intention.

Also it would be cool if the General tab mentioned that a Soundtracker or Ultimate Soundtracker module is being played. 8)

I guess all 15 sample MODs would have been created with some version of Soundtracker, or were there other trackers that used that format too?

That D00 command is a probably a tracking mistake as blood money is a Soundtracker 2.0-2.2 Master Soundtracker song.

Since, in any Soundtracker, you cannot jump to a particular row with Dxx, notes after a Dxx command are never reachable, so there's no point to have them there. So, if there are notes after Dxx you can make a lucky guess that that command was not a pattern break after all. ;)
 
How did you do it, Ian? :)

I'm currently only eliminating UST (no other Soundtracker versions) when there are 10KB samples, so the Blood Money file is still eligible for the special Dxx/Exx processing. I did initially have D00 preclude the special processing (as a D00 volume slide would do nothing), but then that troublesome Blood Money file came up. But I have since noticed a bunch of other files that don't work properly because of that...

   http://files.exotica.org.uk/?file=exotica/media%2Faudio%2FUnExoticA%2FGame%2FUnknown%2FAventures_de_Moktar.lha

So I have switched it back to having D00 preclude the special Dxx/Exx processing in the update above. As you say, the Blood Money "D00" looks like a mistake by the composer, and I don't think we can base our format detections on that. It is possible to have all sorts of invalid effects in a MOD file if the composer wants to :)

saga

  • Posts: 2131
Re: Soundtracker mods won't play
« Reply #28 on: 14 Feb '13 - 15:40 »
http://files.exotica.org.uk/modland/?file=pub/modules/Protracker/-%20unknown/atmosfer%204.mod

This has a lot of silence in XMPlay, since the D00 commands are apparently not handled as pattern breaks. From a listener's perspective it's obvious that they are supposed to be pattern breaks, but patterns 14 and 15 contain D30 and D10 commands (looks like tracking mistake again) which are not supposed to be volume slides. I suppose they should just break to row 0 regardless of their value, but figuring that out when not knowing the exact version of Soundtracker that was being used is pointless. Basically, this is what I do...

Code: [Select]
if(m.param != 0 || minVersion < ST_IX)
{
// Dxy is volume slide in some Soundtracker versions, D00 is a pattern break in the latest versions.
m.command = 0x0A;
} else if(m.param == 0 && row == 0 && minVersion != ST2_00_with_Bxx)
{
// Fix a possible tracking mistake in Blood Money title - who wants to do a pattern break on the first row anyway?
m.command = m.param = 0;
}
It leaves the silence at the end, but at least the pattern breaks in pattern 2 work. ST2_00_with_Bxx is set when a Bxx command is found, so I can be fairly sure that Soundtracker 2.0 is used. A possible heuristic would be: If there is an Dxx command and all following rows are empty, assume it's a pattern break, not a volume slide. What do you think about this?
This is my current state for OpenMPT: http://sagagames.de/stuff/mptrack.exe

guest

  • Guest
Re: Soundtracker mods won't play
« Reply #29 on: 14 Feb '13 - 16:25 »
SoundTracker module rejected by XMPlay:
http://amp.dascene.net/downmod.php?index=91566

Ian @ un4seen

  • Administrator
  • Posts: 19987
Re: Soundtracker mods won't play
« Reply #30 on: 14 Feb '13 - 17:51 »
Oops! Here's an update to fix that...

   www.un4seen.com/stuff/xmplay.exe

This update also has another little tweak to the special Dxx/Exx processing: it will look for a series of Dxx/Exx before enabling that. The reasoning is that a lone Dxx is more likely to be a pattern break while a series of them is more likely to be a volume slide. Let me know if it trips up over anything.

Fraggie

  • Posts: 710
Re: Soundtracker mods won't play
« Reply #31 on: 15 Feb '13 - 09:17 »
Playing around with the famous echoing by banana, I noticed the hanging sample (sinecz) at the end. I wonder if there is a way to fix that, or if it's intended? There is also a 31-sample conversion of that tune floating around, and that one doesn't loop that sample at all.
I remember it sounding the same in some cracktro, so it was probably made this way. Too bad.

A possible heuristic would be: If there is an Dxx command and all following rows are empty, assume it's a pattern break, not a volume slide. What do you think about this?
Sounds reasonable.

jackdance.mod by Karsten Obarski has 0xy arpeggios, which is quite strange since you'd expect him to use his own tracker. Maybe this is just a bad conversion? Anyway, I'm going to interpret 0xy commands with xy > 0x03 as arpeggios as well for tunes like this one...
Especially if his tracker was hacked and cracked to make the other ST versions.  ;D But that's definitely not a UST song.

Moreover module mod.dragonx from Bad_Dudes.lha plays at speed 267! :)

But does it sound OK? :)

The Soundtracker BPM/speed value is translated to a ProTracker equivalent BPM. At least, that's the intention.
Yes, surprisingly it does! :)

But this one seems to fast (BPM 384):
http://files.exotica.org.uk/?file=exotica/media%2Faudio%2FUnExoticA%2FGame%2FKelly_Dave%2FDragon_Spirit.lha
(mod.drag 10)
compare:
https://www.youtube.com/watch?v=2zt62OLHBwQ

But it may be a PAL/NTSC thing...? Are your calculations based on NTSC clocks?

Also the sample 10 (asia) is looped incorrectly (you can hear it playing at positions 16..18). Sounds like the loop start value is loaded as a number of words. As far as I know it's always byte-based in 15 sample mods, so no fancy checks are needed for this. OpenMPT has the same issue.

Also it would be cool if the General tab mentioned that a Soundtracker or Ultimate Soundtracker module is being played. 8)

I guess all 15 sample MODs would have been created with some version of Soundtracker, or were there other trackers that used that format too?
No. I was just wondering if they still qualify as "Generic MODs". :)

This update also has another little tweak to the special Dxx/Exx processing: it will look for a series of Dxx/Exx before enabling that. The reasoning is that a lone Dxx is more likely to be a pattern break while a series of them is more likely to be a volume slide. Let me know if it trips up over anything.
That sounds logical, but Blood Money is broken again. ::) I would hate to do it myself, but I think you'll have to hardcode an exception for this song...


Anyways, thanks for looking into this Soundtracker stuff. It's going well. :)

saga

  • Posts: 2131
Re: Soundtracker mods won't play
« Reply #32 on: 15 Feb '13 - 13:14 »
Quote
I would hate to do it myself, but I think you'll have to hardcode an exception for this song...
I think my very arbitrary "reject D00 on first row of pattern" rule works quite well for this.

Quote
As far as I know it's always byte-based in 15 sample mods, so no fancy checks are needed for this. OpenMPT has the same issue.
Yep, OpenMPT uses the same "loop guessing" code as for ProTracker MODs - i.e. it first tries to interpret them as words, and if that's incorrect, tries again with bytes. I'll look into fixing this to always interpret them as bytes.

Quote
Anyways, thanks for looking into this Soundtracker stuff.
And thanks for all the invaluable hints!
« Last Edit: 15 Feb '13 - 13:34 by saga »

Ian @ un4seen

  • Administrator
  • Posts: 19987
Re: Soundtracker mods won't play
« Reply #33 on: 15 Feb '13 - 17:32 »
But this one seems to fast (BPM 384):
http://files.exotica.org.uk/?file=exotica/media%2Faudio%2FUnExoticA%2FGame%2FKelly_Dave%2FDragon_Spirit.lha
(mod.drag 10)
compare:
https://www.youtube.com/watch?v=2zt62OLHBwQ

They seem to be slightly different tunes, eg. the Youtube video needs more drum in pattern 3? :)

After doing a bunch of comparisons, it appears that different Soundtracker versions have slightly different default tempos: those with a speed control (eg. Ultimate Soundtracker 1.8-2.0 & SoundTracker IX) are around 121 BPM while those without are 125 BPM, but the file header contains 120 in both cases. I'm not sure there is any way to be sure what the intended rate is when it's set to 120, but it probably won't be too disastrous if a file that was intended for 121 BPM gets played at 125 BPM. Here's an update that will at least use the lower tempo when it isn't set to 120...

   www.un4seen.com/stuff/xmplay.exe

Also the sample 10 (asia) is looped incorrectly (you can hear it playing at positions 16..18). Sounds like the loop start value is loaded as a number of words. As far as I know it's always byte-based in 15 sample mods, so no fancy checks are needed for this. OpenMPT has the same issue.

Oops. The byte-based loop start now always applies to 15 sample MODs in the update above.

That sounds logical, but Blood Money is broken again. ::) I would hate to do it myself, but I think you'll have to hardcode an exception for this song...

Yep, I'd hate that too ;D ... I think Blood Money is unfortunately a lost cause. If someone wants to hear it played properly, they could load it into a tracker and remove the rogue "D00".

Anyways, thanks for looking into this Soundtracker stuff. It's going well. :)

And, to reiterate what saga said, thanks for the pointers!

Fraggie

  • Posts: 710
Re: Soundtracker mods won't play
« Reply #34 on: 20 Feb '13 - 16:17 »
After doing a bunch of comparisons, it appears that different Soundtracker versions have slightly different default tempos: those with a speed control (eg. Ultimate Soundtracker 1.8-2.0 & SoundTracker IX) are around 121 BPM while those without are 125 BPM, but the file header contains 120 in both cases. I'm not sure there is any way to be sure what the intended rate is when it's set to 120, but it probably won't be too disastrous if a file that was intended for 121 BPM gets played at 125 BPM. Here's an update that will at least use the lower tempo when it isn't set to 120...
You are correct! I've checked the playback code for some Soundtrackers and Ultimate Soundtracker 1.8 uses CIA timer for tempo and considers the tempo byte, but all others including Ultimate Soundtracker 1.21 (but excluding Soundtracker IX, since it was based on UST 1.8 ) use vertical blanking interrupt which is obviously not controllable.

For the record: since UST 1.8 and ST IX use the formula (240-tempo)*122 to feed the CIA timer register, for tempo byte of 120 it gives 14640, the equivalent of 709378,92Hz/14640 = ~ 48,45 Hz frames or ProTracker tempo ((709378,92Hz/50Hz)*125)/14640 = ~ 121,14. And all others have fixed tempo of 50Hz (ProTracker tempo 125).

Now I understand where do the insanely high BPM values shown by XMPlay come from.  8)

Yep, I'd hate that too ;D ... I think Blood Money is unfortunately a lost cause. If someone wants to hear it played properly, they could load it into a tracker and remove the rogue "D00".
Do you happen to know a modern tracker able to save 15-sample Soundtracker MODs?  ;D
« Last Edit: 20 Feb '13 - 16:35 by Fraggie »

saga

  • Posts: 2131
Re: Soundtracker mods won't play
« Reply #35 on: 20 Feb '13 - 17:18 »
Since you mentioned that you tweaked the tempo formula in XMPlay, what does the revised formula actuall look like, i.e. what was wrong about the *24/25 thing?

Quote
Do you happen to know a modern tracker able to save 15-sample Soundtracker MODs?
Use the hex, Luke! Or just ignore D00 on the first row, as said. :) I don't think anyone would seriously use that.

Fraggie

  • Posts: 710
Re: Soundtracker mods won't play
« Reply #36 on: 20 Feb '13 - 18:00 »
It seems Blood Money is the only broken file left... Not only because of the bloody D00 command. The composer is using Cxx effect with parameters above $40. It sounds like XMPlay is clipping the volume to $40. This is not correct as Soundtrackers write this value directly to the volume register. The Amiga sound hardware ignores the most significant bit of the volume byte and just then the volume is clipped to $40 if still above.

Here's pattern 4, beginning of channel 4 (with the squeaky sound):

D-5.13...CDD
E-5.13...CCC
F-5.13...CCC
G-5.13...CCC
A-5.13...CBB
B-5.13...CBB
C-6.13...CBB
D-6.13...CAA
E-6.13...CAA
F-6.13...CAA
G-6.13...C99
A-6.13...C99
B-6.13...C99

Should actually be played like this (the squeaky sound is a little bit nicer now):

D-5.13...C40
E-5.13...C40
F-5.13...C40
G-5.13...C40
A-5.13...C3B
B-5.13...C3B
C-6.13...C3B
D-6.13...C2A
E-6.13...C2A
F-6.13...C2A
G-6.13...C19
A-6.13...C19
B-6.13...C19

This applies to Soundtracker MODs only. ProTracker clips the value to $40 before writing to the register.

http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node0017.html
« Last Edit: 21 Feb '13 - 09:40 by Fraggie »

saga

  • Posts: 2131
Re: Soundtracker mods won't play
« Reply #37 on: 20 Feb '13 - 21:51 »
Does it apply to all (U)ST versions, so commands should always be ANDed with 0x7F?

Fraggie

  • Posts: 710
Re: Soundtracker mods won't play
« Reply #38 on: 21 Feb '13 - 09:39 »
Just the C command has no processing and its parameter is written directly to the AUDxVOL registers.

This applies to all Soundtracker versions up to version 2.4 (2.5 had NoiseTracker 1.0 effects with this issue fixed). Since Soundtracker moved to "M.K." 31-sample format in 2.3 it's safe to say that all 15-sample MODs with C command are to be played like this.
« Last Edit: 21 Feb '13 - 16:08 by Fraggie »

saga

  • Posts: 2131
Re: Soundtracker mods won't play
« Reply #39 on: 21 Feb '13 - 12:54 »
Alright. At least something that's consistent across versions. ;D

Ian @ un4seen

  • Administrator
  • Posts: 19987
Re: Soundtracker mods won't play
« Reply #40 on: 21 Feb '13 - 15:12 »
Yep, I'd hate that too ;D ... I think Blood Money is unfortunately a lost cause. If someone wants to hear it played properly, they could load it into a tracker and remove the rogue "D00".
Do you happen to know a modern tracker able to save 15-sample Soundtracker MODs?  ;D

I would've said that saving it as a 31-sample MOD would be fine as it doesn't appear to be reliant on any Soundtracker-specific stuff, until the Cxx thing came up :) ... I guess the next OpenMPT update will fix the Cxx though, so that could be used to do it then. Here's an XMPlay update for the Cxx thing...

   www.un4seen.com/stuff/xmplay.exe

Since you mentioned that you tweaked the tempo formula in XMPlay, what does the revised formula actuall look like, i.e. what was wrong about the *24/25 thing?

Multiplying by 25/24 will turn 120 into 125, which is good for the Soundtracker versions that don't have a speed control, but it isn't correct for those that do have a speed control. In those cases, the BPM calculation is like Fraggie described above...

   bpm = ((709378,92Hz/50Hz)*125) / ((240-tempo)*122)

saga

  • Posts: 2131
Re: Soundtracker mods won't play
« Reply #41 on: 21 Feb '13 - 15:25 »
I guess the next OpenMPT update will fix the Cxx though, so that could be used to do it then.
That's correct, here's a version that will import Cxx correctly. I've also added the Dxx heuristic I've talked about earlier. Tempo conversion will be fixed later.
« Last Edit: 21 Feb '13 - 15:30 by saga »