I've just noticed something quite interesting about CSTMs. I've found that Pokémon Mystery Dungeon: Gates to Infinity's CSTMs use a different encoding than Pokémon Super Mystery Dungeon's CSTMs.
Pokémon Super Mystery Dungeon's CSTMs use ADPCM, where as Gates to Infinity's CSTMs use an original NW4C encoding. Probably because the developers of that said game were using a much earlier version of NW4C Soundmaker at the time of developing Gates to Infinity.
Here's two CSTMs of Ragged Mountain in which I can show you the difference and compare them with the Super Mystery Dungeon's version.
BGM_DUN_01 (Original NW4C/Gates to Infinity version):
BGM_DUN_01_OLD (ADPCM/Super Mystery Dungeon version):
The differences between the two are at 0x0A, 0x0C, 0x1C, 0x24, 0x30, 0x50-51, 0x54-57, 0x5C, 0xA4-A6, 0xA8-AA, 0xAC, 0xB1, 0xB4-B5, 0xB8-B9, 0xBC-BD, 0xC0-C1, 0xC4-C5, 0xC9, 0xCC, 0xD0-D2, 0xD4-D7, 0xD9-E0, 0xE2-EE, 0xF1-11C, 0x11E-135, 0x13C, 0x13E-145, 0x150, 0x152, 0x154, 0x156, 0x158-15C and 0x15E-163.
SEEK begins at 0x160 on the non-ADPCM one (Gates to Infinity), while SEEK begins at 0x140 in ADPCM encoded CSTMs (Super Mystery Dungeon. INFO is located at 0x40 in both versions. It seems the INFO section in the non-ADPCM ones are literally 30 bytes larger than ADPCM ones. And somehow, the program mistakes the non-ADPCM file for having more than one stream, which it clearly doesn't, therefore showing this text:
It's probably bringing up this error, because multistream is supported, but it just can't find the extra stream that it the program thinks that it has to initialise and convert to RSTM.
Perhaps one day in the future, the file responsible for encoding for RSTM can also have CSTM and FSTM variants.
Pokémon Super Mystery Dungeon's CSTMs use ADPCM, where as Gates to Infinity's CSTMs use an original NW4C encoding. Probably because the developers of that said game were using a much earlier version of NW4C Soundmaker at the time of developing Gates to Infinity.
Here's two CSTMs of Ragged Mountain in which I can show you the difference and compare them with the Super Mystery Dungeon's version.
BGM_DUN_01 (Original NW4C/Gates to Infinity version):
Code Select
43 53 54 4D FF FE 40 00 00 00 01 02 40 B2 1D 00
03 00 00 00 00 40 00 00 40 00 00 00 20 01 00 00
01 40 00 00 60 01 00 00 C0 03 00 00 02 40 00 00
20 05 00 00 20 AD 1D 00 00 00 00 00 00 00 00 00
49 4E 46 4F 20 01 00 00 00 41 00 00 18 00 00 00
01 01 00 00 5C 00 00 00 01 01 00 00 68 00 00 00
02 01 02 00 C0 5D 00 00 00 48 03 00 B4 F6 19 00
77 00 00 00 00 20 00 00 00 38 00 00 67 16 00 00
B4 26 00 00 80 16 00 00 04 00 00 00 00 38 00 00
00 1F 00 00 18 00 00 00 00 01 00 00 00 00 00 00
FF FF FF FF 01 00 00 00 01 41 00 00 20 00 00 00
02 00 00 00 02 41 00 00 28 00 00 00 02 41 00 00
30 00 00 00 7F 40 00 00 00 01 00 00 0C 00 00 00
02 00 00 00 00 01 00 00 00 03 00 00 10 00 00 00
00 03 00 00 36 00 00 00 E3 01 EB 00 2C 0A EC FA
00 07 CA FE F0 0C 31 FA F5 03 48 02 AE 0B C3 FA
2D 08 2B FF 33 0D 77 FA 00 00 00 00 00 00 28 00
19 EA 38 E9 00 00 0E 02 B1 00 FD 09 F4 FA 47 07
7F FE FE 0C 20 FA 47 04 AF 01 94 0B D6 FA 4D 08
02 FF 4C 0D 5D FA 00 00 00 00 00 00 78 00 8A D3
19 D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
53 45 45 4B
BGM_DUN_01_OLD (ADPCM/Super Mystery Dungeon version):
Code Select
43 53 54 4D FF FE 40 00 00 00 03 02 20 B2 1D 00
03 00 00 00 00 40 00 00 40 00 00 00 00 01 00 00
01 40 00 00 40 01 00 00 C0 03 00 00 02 40 00 00
00 05 00 00 20 AD 1D 00 00 00 00 00 00 00 00 00
49 4E 46 4F 00 01 00 00 00 41 00 00 18 00 00 00
00 00 00 00 FF FF FF FF 01 01 00 00 64 00 00 00
02 01 02 00 C0 5D 00 00 00 48 03 00 B4 F6 19 00
77 00 00 00 00 20 00 00 00 38 00 00 67 16 00 00
B4 26 00 00 80 16 00 00 04 00 00 00 00 38 00 00
00 1F 00 00 18 00 00 00 00 01 00 00 00 00 00 00
FF FF FF FF 3D 31 03 00 F1 DF 19 00 02 00 00 00
02 41 00 00 14 00 00 00 02 41 00 00 1C 00 00 00
00 03 00 00 10 00 00 00 00 03 00 00 36 00 00 00
E3 01 EB 00 2C 0A EC FA 00 07 CA FE F0 0C 31 FA
F5 03 48 02 AE 0B C3 FA 2D 08 2B FF 33 0D 77 FA
00 00 00 00 00 00 28 00 19 EA 38 E9 00 00 0E 02
B1 00 FD 09 F4 FA 47 07 7F FE FE 0C 20 FA 47 04
AF 01 94 0B D6 FA 4D 08 02 FF 4C 0D 5D FA 00 00
00 00 00 00 78 00 8A D3 19 D0 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
53 45 45 4B
The differences between the two are at 0x0A, 0x0C, 0x1C, 0x24, 0x30, 0x50-51, 0x54-57, 0x5C, 0xA4-A6, 0xA8-AA, 0xAC, 0xB1, 0xB4-B5, 0xB8-B9, 0xBC-BD, 0xC0-C1, 0xC4-C5, 0xC9, 0xCC, 0xD0-D2, 0xD4-D7, 0xD9-E0, 0xE2-EE, 0xF1-11C, 0x11E-135, 0x13C, 0x13E-145, 0x150, 0x152, 0x154, 0x156, 0x158-15C and 0x15E-163.
SEEK begins at 0x160 on the non-ADPCM one (Gates to Infinity), while SEEK begins at 0x140 in ADPCM encoded CSTMs (Super Mystery Dungeon. INFO is located at 0x40 in both versions. It seems the INFO section in the non-ADPCM ones are literally 30 bytes larger than ADPCM ones. And somehow, the program mistakes the non-ADPCM file for having more than one stream, which it clearly doesn't, therefore showing this text:
Code Select
System.Exception: BCSTM files with more than one track data section are not supported.
at BrawlLib.SSBBTypes.CSTMINFOHeader.get_ChannelInfoRefTable()
at BrawlLib.SSBBTypes.CSTMINFOHeader.get_ChannelInfoRefTableEnd()
at BrawlLib.SSBBTypes.CSTMINFOHeader.get_ChannelInfoEntries()
at BrawlLib.SSBBTypes.CSTMINFOHeader.Get_ChannelInfo(Int32 index)
at BrawlLib.Wii.Audio.CSTMConverter.ToRSTM(CSTMHeader* cstm)
at BrawlLib.SSBB.ResourceNodes.RSTMNode.OnInitialize()
at BrawlLib.SSBB.ResourceNodes.ResourceNode.Initialize(ResourceNode parent, DataSource origSource, DataSource uncompSource)
at BrawlLib.SSBB.ResourceNodes.NodeFactory.FromSource(ResourceNode parent, DataSource source)
at BrawlLib.SSBB.ResourceNodes.NodeFactory.FromFile(ResourceNode parent, String path, FileOptions options)
at BrawlBox.Program.Open(String path)It's probably bringing up this error, because multistream is supported, but it just can't find the extra stream that it the program thinks that it has to initialise and convert to RSTM.
Perhaps one day in the future, the file responsible for encoding for RSTM can also have CSTM and FSTM variants.
