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

maep

  • Posts: 15
Soundtracker mods won't play
« on: 5 Feb '13 - 22:25 »
BASS won't load old Ultimate Soundtracker mods like this one: http://files.exotica.org.uk/modland/?file=pub/modules/Protracker/Diz/unit5.mod Ignore the Protracker path, according to my sources it's Soundtracker.

saga

  • Posts: 2111
Re: Soundtracker mods won't play
« Reply #1 on: 5 Feb '13 - 23:44 »
I know that support for 15-sample mods has been asked for several times before, but I wonder, what are the actual reason not to support them? After all, you have two different methods for creating streams and modules, so the fact that 15-sample mods don't have any real magic bytes shouldn't be too disturbing. In XMPlay, 15-sample mods could be tried to be loaded after all internal loaders and external plugins have given up on the file. libmikmod's load_m15.c may give some nice hints on how you can improve heuristics for rejecting invalid 15-sample mod files. Once that is done, these modules can be treated almost identically to ProTracker MODs.

maep

  • Posts: 15
Re: Soundtracker mods won't play
« Reply #2 on: 7 Feb '13 - 15:24 »
Does that mean no support any time soon?

Out of the many module libs which one has the best support for those old Sountracker files?

Ian @ un4seen

  • Administrator
  • Posts: 19812
Re: Soundtracker mods won't play
« Reply #3 on: 7 Feb '13 - 16:59 »
Here's an update for you to try...

   www.un4seen.com/stuff/bass.dll

As 15 sample MOD files don't have a simple signature to look for, this update has to do some other validity checks to detect them, which will hopefully be good enough to avoid false-positives. Let me know if you encounter any problems with it.

maep

  • Posts: 15
Re: Soundtracker mods won't play
« Reply #4 on: 7 Feb '13 - 21:33 »
Hi Ian,

many thanks for your impressively fast fix. I've tested with a few UST mods and the detection seems to work very well. I also threw some random data at it and didn't get any false positives.  ;D

Will this fix make it into the next Bass release? Btw, we're using it on Nectarine Radio for module playback, and it works like a charm (except those pesky ancient mods). Thanks for your awesome work!

Ian @ un4seen

  • Administrator
  • Posts: 19812
Re: Soundtracker mods won't play
« Reply #5 on: 8 Feb '13 - 14:34 »
Yep, it's just in time for the next release. Anyway, good to hear that it's working well for you so far. Let me know if that changes :)

saga

  • Posts: 2111
Re: Soundtracker mods won't play
« Reply #6 on: 8 Feb '13 - 18:45 »
I noticed that Soundtracker support has also been added to XMPlay, but there are still a few details to tackle, which should be easy with mikmod's load_m15.c, as pointed out before. For example, MODs created with Ultimate SoundTracker (the very first version) have a different effect table than later versions of Soundtracker. This can be noticed in SLL7, where a lot of "147" commands can be noticed that are supposed to be arpeggios (so "047" in ProTracker effect notation). load_m15.c has some heuristic detection if a 15-sample MOD is supposed to be played like in Ultimate Soundtracker or just Soundtracker. Check for things like "if(ust_loader)".
« Last Edit: 8 Feb '13 - 18:47 by saga »

Ian @ un4seen

  • Administrator
  • Posts: 19812
Re: Soundtracker mods won't play
« Reply #7 on: 11 Feb '13 - 15:28 »
Yep, the BASS update above just attempts to detect any 15 sample MOD file, and doesn't do anything in particular for Ultimate Soundtracker. It's easier to test these things with XMPlay rather than BASS, so here's an XMPlay update to try, with some additional processing for Ultimate Soundtracker...

   www.un4seen.com/stuff/xmplay.exe

I gather that Ultimate Soundtracker only had 1xx and 2xx effects, so the presence of only those effects in a 15 sample MOD file is taken to mean that it was created with Ultimate Soundtracker (and it is then processed accordingly). It seems to work successfully with the Ultimate Soundtracker files that I could find, except for the SLL7 example above, as it includes an apparently rogue 0xx effect? Let me know if you find any other files that it doesn't handle correctly.

saga

  • Posts: 2111
Re: Soundtracker mods won't play
« Reply #8 on: 11 Feb '13 - 16:06 »
I don't think that checking if there are only 1xx/2xx effects is enough to justify UST mode. I'm still experimenting with heuristic parameters and will let you know of my findings that I'm going to use in OpenMPT, but here are some suggestions that I can come up with right now:
- This is from mikmod: If a 1xx parameter is greater than 1F, assume it's an UST mod. Makes sense, because such a big parameter might indicate that it's an arpeggio command.
- Also from mikmod: If a 1xx parameter is less than 03, assume it's not an UST mod. Also makes sense, because that would be a very weird sounding arpeggio.
- Any effect numbers greater than 3 should of course rule out UST. I'm not sure about these 0xx effects in SLL7, so ignoring them seems best.
- Fxx should always be treated as speed, not tempo (so pretty much like your heuristic check for ProTracker mods to detect VBlank timing).
- In UST mode, any sample data before the loop point should be ignored.

Some of the heuristics in mikmod are too strict or too weak I think, so I'll do some further research (read: listen to 15-sample mods).
« Last Edit: 11 Feb '13 - 16:16 by saga »

Fraggie

  • Posts: 710
Re: Soundtracker mods won't play
« Reply #9 on: 11 Feb '13 - 17:15 »
Wow. This is cool! Thanks for the efforts to bring Soundtracker to XMPlay.

Saga, I'm afraid there's more to the game. I had this stuff figured out once. I'll go check...

saga

  • Posts: 2111
Re: Soundtracker mods won't play
« Reply #10 on: 11 Feb '13 - 17:44 »
Sure, any hints would be appreciated (also by Ian, I bet). Mikmod seems to have some useful heuristics to get started, but they are definitely not perfect. Too bad that you can't really do dedicated searched for 15-sample mods on most sites, ModLand simply tags them as "ProTracker"... Right now my heuristics work well enough for Karsten Obarski's and SLL's (Ultimate) SoundTracker modules.

guest

  • Guest
Re: Soundtracker mods won't play
« Reply #11 on: 11 Feb '13 - 19:52 »
XMPlay rejects SoundTracker module:
http://amp.dascene.net/downmod.php?index=49742

Ian @ un4seen

  • Administrator
  • Posts: 19812
Re: Soundtracker mods won't play
« Reply #12 on: 12 Feb '13 - 17:33 »
I'm not sure about these 0xx effects in SLL7, so ignoring them seems best.

Here's an update with tweaked 0xy checking (it'll only eliminate UST if both x and y aren't 0)...

   www.un4seen.com/stuff/xmplay.exe

This update also uses the BPM from the file's header (multiplied by 25/24).

- In UST mode, any sample data before the loop point should be ignored.

I found one example (pretend.mod) that noticably suffers from that, but I'm not sure it has anything to definitively distinguish it as a UST file rather than some other 15 sample MOD format. It does have a byte-based (rather than word-based) sample loop start position, but I have seen non-UST files that have that too, so I don't think that's a reliable UST indicator.

XMPlay rejects SoundTracker module:
http://amp.dascene.net/downmod.php?index=49742

The problem is that file has an invalid instrument number (20) in pattern 37, and XMPlay was using the instrument number in its "15 sample MOD" validity checks, ie. if an instrument number over 15 is used then it's rejected as an invalid file. The update above ignores invalid instrument numbers; hopefully it doesn't weaken the validity checks too much!

saga

  • Posts: 2111
Re: Soundtracker mods won't play
« Reply #13 on: 12 Feb '13 - 18:01 »
Yep, pretend.mod was the only case where the loop handling was really obvious so far. As far as I understand (from the MikMod code and from example files I've gone through so far), sample names in Soundtracker should always begin with ST-, st- or a number, so that could help for identification too. It sounds pretty arbitrary, though, so I'm not sure how reliable it is. Having both UST-style loops and sample names that don't start with "st-" seems to be a rather well-working check, though.

Quote
This update also uses the BPM from the file's header (multiplied by 25/24).
Do you mean the field that is usually the restart position in ProTracker-type MODs? Somehow I thought that all Soundtracker MODs use VBlank timing...
Edit: xmp suggests (in st_load.c) that UST uses this field for tempo, ST uses it for the restart position. So if ithe value of this field is very small, one can assume it's not an UST module, but it won't work the other way around (there are even ProTracker MODs with 0x78 as a restart pos...)
« Last Edit: 12 Feb '13 - 18:25 by saga »

guest

  • Guest
Re: Soundtracker mods won't play
« Reply #14 on: 12 Feb '13 - 19:10 »
http://amp.dascene.net/downmod.php?index=60836
Duration:
0:02 (XMPlay)
2:27 (DeliPlayer)

saga

  • Posts: 2111
Re: Soundtracker mods won't play
« Reply #15 on: 12 Feb '13 - 19:19 »
Seems like the D0F events in this file should be interpreted as A0F instead. I've also seen files with lots of E0F effects, maybe those are supposed to volume slides as well? I'd love to check this in WinUAE, but I can't get Soundtracker to run...
« Last Edit: 12 Feb '13 - 19:40 by saga »

Fraggie

  • Posts: 710
Re: Soundtracker mods won't play
« Reply #16 on: 13 Feb '13 - 07:58 »
I see you have figured out most of the stuff! :)


Here are the 15-sample SoundTrackers revisions with their features listed (underlined changes) and below my old notes.
[there were also 31-sample SoundTrackers, but that's another story...]

Ultimate Soundtracker 1.0-1.21 (K. Obarski)
-----------------------------------------------
Tempo: constant 120
Samples size: up to 9998 bytes
Sample names: no disk name (i.e. no colon in sample name possible)
Effects:
1: Arpeggio (1xy)
2: Portamento (2xy)

Ultimate Soundtracker 1.8-2.0 (K. Obarski)
-----------------------------------------------
Tempo: variable
Sample size: up to 9998 bytes
Sample name: disk name st-xx: always present
Effects:
1: Arpeggio (1xy)
2: Portamento (2xy)

SoundTracker 2.0 (The Exterminator)
D.O.C. Sountracker II (Unknown/D.O.C.)

-----------------------------------------------
Tempo: constant 120
Sample size: up to 9998 bytes
Effects:
0: Arpeggio (1xy)
1: Portamento Down (1xx)
2: Portamento Up (2xx)
c: Set Volume (Cxx)
d: Volume Slide (Dxy)
e: Volume Auto-Slide (Exy)


Defjam Soundtracker III (Il Scuro/Defjam)
Alpha Flight SoundTracker IV (Alpha Flight)
D.O.C. SoundTracker IV (Unknown/D.O.C.)
D.O.C. SoundTracker VI (Unknown/D.O.C.)

-----------------------------------------------
Tempo: constant 120
Sample size: up to 9998 bytes
Effects:
0: Arpeggio (1xy)
1: Portamento Down (1xx)
2: Portamento Up (2xx)
c: Set Volume (Cxx)
d: Volume Slide (Dxy)
e: Volume Auto-Slide (Exy)
f: Set Speed (F0x)

D.O.C. SoundTracker IX (Unknown/D.O.C.)
-----------------------------------------------
Tempo: variable
Sample size: up to 9998 bytes
Sample name: disk name st-xx always present
Effects:
0: Arpeggio (1xy)
1: Portamento Down (1xx)
2: Portamento Up (2xx)
c: Set Volume (Cxx)
e: Set Filter (E00/E01)
f: Set Speed (F0x)

Master Soundtracker 1.0 (Tip/The New Masters)
-----------------------------------------------
Sample size: up to 32 KB
Tempo: always 120
Effects:
0: Arpeggio (1xy)
1: Portamento Down (1xx)
2: Portamento Up (2xx)
c: Set Volume (Cxx)
e: Set Filter (E00/E01)
f: Set Speed (F0x)

SoundTracker 2.0, 2.1, 2.2 (Unknown/D.O.C.)
-----------------------------------------------
Sample size: up to 32 KB
Tempo: always 120
Effects:
0: Arpeggio (1xy)
1: Portamento Down (1xx)
2: Portamento Up (2xx)
b: Position Jump (Bxx)
c: Set Volume (Cxx)
d: Pattern Break (D00)
e: Set Filter (E00/E01)
f: Set Speed (F0x)


Based on effects these can be sorted into 3 groups:
1. Ultimate Soundtracker 1.0-1.21 and Ultimate Soundtracker 1.8-2.0 have compatible effects.
- Arpeggio is 1xy (not 0xy)
- Portamento is 2xy (not 1xx and 2yy), works as 10y and 20x in Protracker.

2. Soundtracker 2.0, II, III, IV, IV, V, VI have compatible effects.
- Arpeggio and Portamento as in ProTracker
- Set Speed F0x ingores high nibble (i.e. only speed 1..F are possible).
- Volume Slide Dxy works as Axy in Protracker.
- Auto-Slide sets volume slide that will be executed together with following Arpeggios and Portamentos until x00 command is seen.

3. Soundtracker IX, Master Soundtracker and later Soundtracker 2.0-2.2 have compatible effects.
- Set Speed F0x ingores high nibble (i.e. only speed 1..F are possible).
- Volume Slide Dxx and Auto-Slide Exx removed, Position Jump Bxx and Pattern Break D00 introduced.
- Pattern break D00 ignores parameter (i.e. always jumps to begining of next pattern).

Common for all:
- Byte at 0x1D7 is always initial tempo (most commonly 120, not 125 as in Protracker)
- Only looped part of a sample is played.
- Loop start is stored in bytes not in words.
- Finetune byte is always 0.

By taking into account effects, their parameters, sample sizes, sample names, tempo byte at least lowest common denominator can be found (if not the correct format).

Edit: Obviously start of the loop is in bytes, not loop length.
« Last Edit: 15 Feb '13 - 08:41 by Fraggie »

Fraggie

  • Posts: 710
Re: Soundtracker mods won't play
« Reply #17 on: 13 Feb '13 - 09:20 »
http://amp.dascene.net/downmod.php?index=60836
Duration:
0:02 (XMPlay)
2:27 (DeliPlayer)

Seems like the D0F events in this file should be interpreted as A0F instead. I've also seen files with lots of E0F effects, maybe those are supposed to volume slides as well? I'd love to check this in WinUAE, but I can't get Soundtracker to run...

Yup, this is a Soundtracker III-VIII file with Dxx effect meaning volume slide not pattern break. Like these two:
http://files.exotica.org.uk/?file=exotica/media%2Faudio%2FUnExoticA%2FGame%2FNorrish_Ray%2FBlood_Money.lha
http://files.exotica.org.uk/?file=exotica/media%2Faudio%2FUnExoticA%2FGame%2FMindach_Olaf%2FTech.lha

Also, to run Soundtracker under WinUAE you'll need Kickstart 1.2.

saga

  • Posts: 2111
Re: Soundtracker mods won't play
« Reply #18 on: 13 Feb '13 - 13:13 »
Oh man, what a great post, thanks for this valuable information!

Quote
Set Speed F0x ingores high nibble (i.e. only speed 1..F are possible).
So the effect parameter should be ANDed with 0x0F?

Quote
e: Volume Auto-Slide (Exy)
What's the difference between slides and "auto slides"?

Another thing... MikMod mentions something like that calling e.g. 100 directly after a non-zero 1xx effect (same with 2xx/200) would enable portamento memory. Now we all know that ProTracker doesn't have portamento up/down memory. Is this simply an error in MikMod or is there indeed some kind of "previous row effect memory" for portamento in Soundtracker?

Fraggie

  • Posts: 710
Re: Soundtracker mods won't play
« Reply #19 on: 13 Feb '13 - 15:13 »
Quote
Set Speed F0x ingores high nibble (i.e. only speed 1..F are possible).
So the effect parameter should be ANDed with 0x0F?
Correct.

Quote
e: Volume Auto-Slide (Exy)
What's the difference between slides and "auto slides"?
Exy slides as Dxy and continues to slide with any other effect together until a command with parameter 00 is entered. E.g.
Code: [Select]
D-3 1 E01  // D01, autoslide set to D01: slide down
--- - 001  // 001 + D01: arpeggio + slide down
--- - 001  // 001 + D01: arpeggio + slide down
--- - 000  // no effect, autoslide cancelled
--- - 001  // 001: arpeggio only
--- - C20
--- - E10  // D10, autoslide set to D10: slide up
--- - 101  // 101 + D10: porta up + slide up
--- - 101  // 101 + D10: porta up + slide up
--- - F04  // F04 + D10: set speed to 4 + slide up
--- - 100  // no effect, autoslide cancelled
Autoslide appears to have no effect on Cxx. C00 cancels it though.

Another thing... MikMod mentions something like that calling e.g. 100 directly after a non-zero 1xx effect (same with 2xx/200) would enable portamento memory. Now we all know that ProTracker doesn't have portamento up/down memory. Is this simply an error in MikMod or is there indeed some kind of "previous row effect memory" for portamento in Soundtracker?
That doesn't seem to be true (just checked a few Soundtrackers ;D).

(Edited: autoslide actually works with any command not just arpeggio and portamento.)
« Last Edit: 13 Feb '13 - 15:37 by Fraggie »

saga

  • Posts: 2111
Re: Soundtracker mods won't play
« Reply #20 on: 13 Feb '13 - 15:33 »
Thanks. This auto-slide stuff seems to be pretty hard to integrate into a ProTracker-like player. Damn!

Edit: So the E0F effects in sll17.3 are all useless, right?
Edit: And automatically detecting the correct interpretation for the D00 effects in Blood Money might also involve black magic...
« Last Edit: 13 Feb '13 - 15:52 by saga »

Ian @ un4seen

  • Administrator
  • Posts: 19812
Re: Soundtracker mods won't play
« Reply #21 on: 13 Feb '13 - 15:58 »
Here are the 15-sample SoundTrackers revisions with their features listed (underlined changes) and below my old notes...

Good stuff :)

Here's an update that should detect/support Dxx volume slides...

   www.un4seen.com/stuff/xmplay.exe

It doesn't include support for the Exx "auto-slide" effect (they will be ignored), but I don't think I've seen any files use that yet anyway. This update also applies the "skip data before loop start" thing to all 15 sample MODs, as having tried a few different Soundtracker versions (via WinUAE), it looks like that doesn't only apply to Ultimate Soundtracker. The BPM calculation has also been tweaked slightly; let me know if anyone finds that some files are playing too fast/slow.

I'd love to check this in WinUAE, but I can't get Soundtracker to run...

I was able to get some Soundtracker versions to work (and some not) with WinUAE. Here's Ultimate Soundtracker 2.0, which is working...

   ftp.amigascne.org/pub/amiga/Sound/UltimateSoundtracker2.adf

You can find a bunch of other Soundtracker versions in that FTP directory too. Even when it isn't possible to run a particular Soundtracker version, it can be useful to see its docs for its features/effects.
« Last Edit: 13 Feb '13 - 17:16 by Ian @ un4seen »

saga

  • Posts: 2111
Re: Soundtracker mods won't play
« Reply #22 on: 13 Feb '13 - 16:11 »
You may want to fix that first link (un4see -> un4seen). :)

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.

Fraggie

  • Posts: 710
Re: Soundtracker mods won't play
« Reply #23 on: 13 Feb '13 - 16:33 »
Thanks. This auto-slide stuff seems to be pretty hard to integrate into a ProTracker-like player. Damn!
Well, it is similar to 5xx and 6xx in ProTracker. Just opposite way. :)

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.)

Edit: And automatically detecting the correct interpretation for the D00 effects in Blood Money might also involve black magic...
Behold black magic! :)

It doesn't include support for the Exx "auto-slide" effect (they will be ignored), but I don't think I've seen any files use that yet anyway.
sll17.3

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?

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

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

saga

  • Posts: 2111
Re: Soundtracker mods won't play
« Reply #24 on: 13 Feb '13 - 17:23 »
Well, it is similar to 5xx and 6xx in ProTracker. Just opposite way. :)
Yeah, but there are no compatible PT commands that could replace the auto-slide, that's what I meant.

Why? They seem legit. (I've updated the post, Exy also slides by itself.)
Ah right, then it makes sense to at least import the Exy effects as Axy, I guess.

Regarding blood money... It has samples > 10kb, so the only trackers that qualify are ST2.0 and MST 1.0 (the last two ones in your list). MST doesnt' have Bxx/Dxx effects. So interpreting the Dxx effects in blood money as pattern breaks is the only heuristic that can actually work. And sadly it's a wrong heuristic in this case...
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...

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: 2111
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: 19812
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: 2111
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: 19812
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: 2111
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: 19812
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: 2111
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: 2111
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: 2111
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: 19812
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: 2111
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 »