Author Topic: Soundtracker mods won't play  (Read 19158 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: 2654
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: 25275
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: 25275
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: 2654
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: 25275
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: 2654
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: 713
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: 2654
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: 25275
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: 2654
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: 2654
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: 713
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: 713
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: 2654
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: 713
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: 2654
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: 25275
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: 2654
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: 713
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: 2654
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...