Author Topic: "Music.xml" offsets and XMPlay sub-songs correlation?  (Read 3862 times)

Rich Nagel

  • Posts: 297
I was wondering if anyone knew the correlation of PopCap Games' "Music.xml" "Offset" entries for their various games' music, and the sub-songs info that is displayed within XMPlay's "General" info window?

An example, the files "Bejeweled3_suite.mo3" and "music.xml", extracted from Bejeweled 3's "Main.pak" game resource file:

XMPlay displays this info in the "General" info window for the "Bejeweled3_suite.mo3" music file:

-=-=-=-=-=-=-=-=-=-
Code: [Select]
Sub songs:
1. 0:26 - 1 orders
2. 0:24 - 1 orders - looped
3. 1:36 - 7 orders
4. 2:18 - 9 orders - looped
5. 1:54 (1:53 trimmed) - 4 orders
6. 1:42 - 6 orders - looped
7. 1:42 - 6 orders - looped
8. 0:40 (0:08 trimmed) - 1 orders
9. 1:13 (0:07 trimmed) - 1 orders
10. 9:36 - 38 orders - looped
11. 11:05 - 29 orders - looped
12. 1:43 - 5 orders
13. 0:24 (0:24 trimmed) - 1 orders
14. 2:20 - 10 orders - looped
15. 3:00 - 9 orders - looped
16. 0:53 (0:06 trimmed) - 1 orders
17. 0:49 - 1 orders - looped
18. 0:15 - 1 orders - looped
19. 2:55 - 11 orders - looped
20. 0:48 (0:11 trimmed) - 1 orders
21. 2:51 - 10 orders - looped
22. 1:19 (0:10 trimmed) - 1 orders
23. 2:50 - 7 orders - looped
24. 0:51 (0:06 trimmed) - 1 orders
25. 0:43 (0:03 trimmed) - 1 orders
26. 2:17 - 8 orders - looped
27. 0:42 (0:05 trimmed) - 1 orders
28. 0:40 (0:05 trimmed) - 1 orders
29. 2:42 - 9 orders - looped
30. 0:31 (0:07 trimmed) - 1 orders
31. 1:00 (0:10 trimmed) - 1 orders
-=-=-=-=-=-=-=-=-=-


The "Music.xml" file contains the following entries:

-=-=-=-=-=-=-=-=-=-
Code: [Select]
<Music>

<!-- These events are always processed first -->

  <DefaultEvents>
    <Event Name="FadeOut" Volume="b+0,1,0.01,1,~###         ~#########" />
    <Event Name="FadeIn" Volume="b+0,1,0.015,1,####         ~~###" />
    <Event Name="Wait" Volume="b+0,1,0.001667,1,~###        y~### (####" />
  </DefaultEvents>

<!-- NOTE: Offset 00 = silent / mute loop. All fanfares jump to it after end.  -->

<!-- Menu musics -->

  <Song Name="LoadingScreen" File="music\Bejeweled3_suite.mo3" Offset="02" >
    <Event Name="Switch" RowSync="0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124" Offset="04" />
  </Song>
 
  <Song Name="MainMenu" File="music\Bejeweled3_suite.mo3" Offset="04" >
  </Song>

  <Song Name="SecretMenu" File="music\Bejeweled3_suite.mo3" Offset="147" >
  </Song>

  <Song Name="QuestMenu" File="music\Bejeweled3_suite.mo3" Offset="147" >     
  </Song>

  <Song Name="QuestMenu_unlock" File="music\Bejeweled3_suite.mo3" Offset="00" >
  </Song>

  <Song Name="QuestMenu_fanfare" File="music\Bejeweled3_suite.mo3" Offset="120" Sfx >
    <Event Name="FadeOut" Volume="b+0,1,0.002857,1,~###         ~#########" />
  </Song>

<!-- Turn Based Quest songs -->


  <Song Name="QuestTurnBased" File="music\Bejeweled3_suite.mo3" Offset="188" >
      <Event Name="Break" RowSync="0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124" />
  </Song>

  <Song Name="QuestTurnBased_lose" File="music\Bejeweled3_suite.mo3" Offset="199" >
  </Song>

  <Song Name="QuestTurnBased_win" File="music\Bejeweled3_suite.mo3" Offset="197" >
  </Song>

<!-- Time Based Quest songs -->

  <Song Name="QuestTimeBased" File="music\Bejeweled3_suite.mo3" Offset="133" >
    <Event Name="Break" RowSync="0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124" />
  </Song>

  <Song Name="QuestTimeBased_lose" File="music\Bejeweled3_suite.mo3" Offset="145" >
  </Song>

  <Song Name="QuestTimeBased_win" File="music\Bejeweled3_suite.mo3" Offset="143" >
  </Song>

<!-- Bomb puzzle -->

  <Song Name="QuestBomb" File="music\Bejeweled3_suite.mo3" Offset="34" >
  </Song>

  <Song Name="QuestBomb_win" File="music\Bejeweled3_suite.mo3" Offset="43" >
  </Song>

  <Song Name="QuestBomb_lose" File="music\Bejeweled3_suite.mo3" Offset="41" >
  </Song>

<!-- Classic Mode -->

  <Song Name="Classic" File="music\Bejeweled3_suite.mo3" Offset="45" >
    <Event Name="Break" RowSync="0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124" />
  </Song>

  <Song Name="Classic_lose" File="music\Bejeweled3_suite.mo3" Offset="22" >
  </Song>

<!-- Zen Mode -->

  <Song Name="Zen" File="music\Bejeweled3_suite.mo3" Offset="84" >
  </Song>

<!-- Icestorm Mode -->
<!-- Panic Layer in channels 17, 18, 19, 20 -->

  <Song Name="Icestorm" File="music\Bejeweled3_suite.mo3" Offset="149" >
    <Event Name="Play" Volume="b+0,1,0,1,#### 9####     g~###   $~###" Tracks="17,18,19,20" />
  </Song>

  <Song Name="Icestorm_win" File="music\Bejeweled3_suite.mo3" Offset="43" >
  </Song>
 
  <Song Name="Icestorm_lose" File="music\Bejeweled3_suite.mo3" Offset="161" >
  </Song>

<!-- Butterflies Mode -->

  <Song Name="Butterflies" File="music\Bejeweled3_suite.mo3" Offset="163" >
  </Song>

  <Song Name="Butterflies_win" File="music\Bejeweled3_suite.mo3" Offset="43" >
  </Song>

  <Song Name="Butterflies_lose" File="music\Bejeweled3_suite.mo3" Offset="174" >
  </Song>

<!-- Poker Mode -->

  <Song Name="Poker" File="music\Bejeweled3_suite.mo3" Offset="176" >
  </Song>

  <Song Name="Poker_win" File="music\Bejeweled3_suite.mo3" Offset="186" >
  </Song>

  <Song Name="Poker_lose" File="music\Bejeweled3_suite.mo3" Offset="184" >
  </Song>

<!-- Buried Treasure mode -->

  <Song Name="BuriedTreasure" File="music\Bejeweled3_suite.mo3" Offset="201" >
  </Song>

  <Song Name="BuriedTreasure_win" File="music\Bejeweled3_suite.mo3" Offset="213" >
  </Song>

  <Song Name="BuriedTreasure_lose" File="music\Bejeweled3_suite.mo3" Offset="211" >
  </Song>

<!-- Speed / Lightning Mode --> 
<!-- Panic Layer: scale the volume up for tracks 17 to 20 -->


  <Song Name="Speed" File="music\Bejeweled3_suite.mo3" Offset="12" >   
    <Event Name="Play" Volume="b+0,1,0,1,####       4####  &~###j~###" Tracks="17,18,19,20" />
    <Event Name="Break" RowSync="1,5,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124" />
  </Song>

  <Song Name="Speed_lose" File="music\Bejeweled3_suite.mo3" Offset="22" > 
  </Song>

</Music>
-=-=-=-=-=-=-=-=-=-


Anyone have any idea how to correlate the "Offset" entries in the above file with the number of the sub-song as displayed within XMPlay?
« Last Edit: 15 Jan '11 - 01:16 by Rich Nagel »

saga

  • Posts: 2179
Anyone have any idea how to correlate the "Offset" entries in the above file with the number of the sub-song as displayed within XMPlay?
They are order list items, f.e. the Zen Mode music starts at order item 84.

Rich Nagel

  • Posts: 297
They are order list items, f.e. the Zen Mode music starts at order item 84.

Thanks for the info, but I'm a bit confused. I'm figuring that the number isn't the pattern number (as seen in OpenMPt), and the orders that you refer to are the ones displayed within XMPlay?

If so, what are "orders", and can/do they get displayed within OpenMPT (in other words, within OpenMPT, how do I figure out what is what; based upon the "orders" offset)?

BTW, thanks for the help :)

wrkq

  • Posts: 82
Erm?
I *think* that order is a list of pattern numbers, that decides what patterns in what... well, order... are played.
Remember that your module can re-use the same pattern many times.
In OpenMPT, it should be a horizontal row of boxes above on the pattern editor tab, above the pattern itself.

If it goes
[6][1][8][3][2][5][6][8][0][12]
it'll play these patterns in this order.
And "Offset = 2" would "seek the playhead" to that specific instance of pattern 8 (or 1, I don't know if it's 0-based or 1-based), and start playing from there... but, depending on what other patterns and jump commands are further down, it won't be equivalent to any other instance of that pattern.

saga

  • Posts: 2179
Pretty much what wrkq said. The order list is a list of patterns, and thus an "order" is the zero-based index of pattern. Order 0 is the first pattern item, Order 1 is the second, etc...

Rich Nagel

  • Posts: 297
Thanks for the info guys, makes perfect sense to me now :)

BTW, after poking around in OpenMPT for while: the dropdown headers on the left side of the screen; the "Sequence" entries seem to be the number of the "orders". IOW, I can look up the offset in the Music.xml file, and the offset is the actual number displayed under the "Sequence" section of OpenMPT :)

saga

  • Posts: 2179
That is one out of countless way to access the sequence, yes. The order item number is also displayed in the status bar when working in the order list.