Author Topic: Music table? Or what sets the music  (Read 6272 times)

Tenko Kuugen

  • Public Enemy
  • *
  • Posts: 1416
    • View Profile
    • Twitter
Music table? Or what sets the music
« on: 2012-08-30 20:40:52 »
I tried various things with DLTP yesterday and at least I think that somewhere has to be a table the game pulls IDs from
essentially it would look like this

to the left, a row of MAP ID ( has to be a 16 bit )
above, a row of Music ID ( the number called when Play Music # ) is used ot CMUSC forces a different music ( should be 8 bit )
where the two meet, the ID of the actual track ( there are less than 256, so it should only 8 bit )

opcode CMUSC can be used to force different music in places but apparently nothing that is not already pre-loaded on the map.
Most maps only have Play Music #0 ( BGM ) and Play Music #1 ( Normal Battle ) as music, so most maps have only loaded two tracks at a time
Since Music #1 is almost always the same track, the entry for that ID should be nearly the same for all fields where enemies can be encountered.


trying to mess around with AKAOs did absolutely nothing, regardless of what was done. so I can say for sure that AKAO does not set music.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Music table? Or what sets the music
« Reply #1 on: 2012-08-30 20:45:50 »
AKAO was the music programming with PSX... and we know for sure that PC port uses midi...

so obviously they've worked a way around it.  Perhaps the table is in the exe?  Or hardcoded data there.  I found nothing in flevel, and the tables that are there, luksy assures me are not related.
« Last Edit: 2012-08-30 20:47:25 by DLPB »

Tenko Kuugen

  • Public Enemy
  • *
  • Posts: 1416
    • View Profile
    • Twitter
Re: Music table? Or what sets the music
« Reply #2 on: 2012-08-30 21:34:18 »
it could be in the .exe but it could be somewhere else entirely

I really have no clue beyond what I posted above
if someone else could take a look at it, that would be great
I'm stunned that this hasn't been traced down yet

myst6re

  • *
  • Posts: 643
  • Light King of the Savegame - Field Master - FF8.fr
    • View Profile
    • FF8.fr
Re: Music table? Or what sets the music
« Reply #3 on: 2012-09-01 22:20:14 »
I did some tests, and the music is played by AKAO, if there is a bug, it is in Makou Reactor. I'm sorry I have to fix it :-[. So I tried to swap AKAO 2 and 4 in blackbg2, and it works, the played music change.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Music table? Or what sets the music
« Reply #4 on: 2012-09-01 22:21:24 »
yeah but some of the maps don't even have Akao and still play music....

Tenko Kuugen

  • Public Enemy
  • *
  • Posts: 1416
    • View Profile
    • Twitter
Re: Music table? Or what sets the music
« Reply #5 on: 2012-09-01 22:46:51 »
A lot of maps don't have AKAOs, most in fact don't, and still have a regular opcode "play music #0" in the group 0, s0 int, set.
you should try to swap out the music in a non-debug field

Tenko Kuugen

  • Public Enemy
  • *
  • Posts: 1416
    • View Profile
    • Twitter
Re: Music table? Or what sets the music
« Reply #6 on: 2012-09-02 02:07:45 »
Aali said there are AKAO blocks that arent inside the field script but the files
maybe you'll want to look into that, Myst6re

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Music table? Or what sets the music
« Reply #7 on: 2012-09-02 03:08:11 »
Luksy pointed me to this http://forums.qhimm.com/index.php?PHPSESSID=062673c9ab8bc696cb85c0b1f9c913d3&topic=13358.msg186033#msg186033

And he was right.  The music is set in the field files (not part of script though as Aali said).  After the AKAO text there are 2 bytes for the ID.  The ID sets the music for the map (it is the music ID, see Data\Music\music.idx).  For example gldgate has 4 musics set.  The 4th music has an ID of 56. See music.idx, this is Gold1 (Gold Saucer music).  You can see in script that normally Music #3 (the 4th music, given 0 is 1st) is set to play this.  If you take 1 to be line 1 in the index, the actual music is ID+1. (See code section below).  Make a note of that.

Hopefully Mystere will undertake creating a tool to set the musics? or add ability to Makou?  :-P  It is really simple.

1.  Find akao blocks and look at the ID which is the first entry (the entry straight after the AKAO text).  The ID is a 2 byte value (even though there are nowhere near 65535 musics!  So really just take the 1st byte.)

2. Cross reference this value with the entry list in music.idx to get the name of the music set for this akao block.  The music in the first block is played in script with "play music #0".

3.  Update makou to tell user the music that is being played rather than "play music #0".  It may be possible to set the music here too in makou.

Code: [Select]
oa
ob
dun2
guitar2
fanfare
makoro
bat
fiddle
kurai
chu
ketc

Example.
The first entries in music.idx.  As you can see fanfare is the 5th music
Therefore the ID in field file will be 6. 


« Last Edit: 2012-09-02 03:54:09 by DLPB »

myst6re

  • *
  • Posts: 643
  • Light King of the Savegame - Field Master - FF8.fr
    • View Profile
    • FF8.fr
Re: Music table? Or what sets the music
« Reply #8 on: 2012-09-02 15:31:42 »
I did the editor, and it works, great job DLPB! But KuugenTheFox spoke of music that were played when there is no AKAO in the field, and I found that the music was not always played.

Tenko Kuugen

  • Public Enemy
  • *
  • Posts: 1416
    • View Profile
    • Twitter
Re: Music table? Or what sets the music
« Reply #9 on: 2012-09-02 15:42:23 »
I'm no expert on this so if this is the solution, I must have done something wrong.
any chance we'll see the ability to change which music is loaded into a level into MR?

myst6re

  • *
  • Posts: 643
  • Light King of the Savegame - Field Master - FF8.fr
    • View Profile
    • FF8.fr
Re: Music table? Or what sets the music
« Reply #10 on: 2012-09-02 16:41:35 »
any chance we'll see the ability to change which music is loaded into a level into MR?

Sure.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Music table? Or what sets the music
« Reply #11 on: 2012-09-02 19:11:47 »
I did the editor, and it works, great job DLPB! But KuugenTheFox spoke of music that were played when there is no AKAO in the field, and I found that the music was not always played.

Luksy and vehek deserves more credit than me for pointing out that it may be the solution and Luksy explaining akao to me.  Good to see this is solved!  8)

Tenko Kuugen

  • Public Enemy
  • *
  • Posts: 1416
    • View Profile
    • Twitter
Re: Music table? Or what sets the music
« Reply #12 on: 2012-09-02 19:12:45 »
And we're one step closer to mapping all of FF7.