Author Topic: Help with Music Opcodes  (Read 4786 times)

hotdog963al

  • *
  • Posts: 236
  • Horse
    • View Profile
    • Horse HQ
Help with Music Opcodes
« on: 2009-01-29 02:50:55 »
Hi there,

I've been messing about with opcodes (specifically for NMKIN_5.DAT), I would like to give the Guard Scorpion battle the standard boss fight music.
I'm understanding quite a few of the commands, I'm able to change the music to either "Bombing mission", "Battle theme", or "Reactor Theme", but I can't see where these 3 songs are being defined!
The wiki says that the appropriate music files are defined on the field, but I can't see where that's happening. I've read that the "AKAO" might have something to do with it, although altering these seems to have no effect what-so-ever.

Any ideas?

Cheers.

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: Help with Music Opcodes
« Reply #1 on: 2009-01-29 03:12:53 »
A while ago I started this topic on changing music.

If you look at uncompressed field files with a hex editor and search for the text string AKAO, you'll see 41 4b 41 4f followed by a hex byte that corresponds to a track on this list, with "NONE" indicated by 01 not 00. That is where the songs are defined, so if you change that byte, you'll change the set of defined songs for the field. A lot of files will have several AKAO texts strings. I presume that a 0 after the MUSIC/BMUSC/whatever OPCODE tells the game to play the track defined after the first AKAO, an 01 the track defined after the second and so on, but maybe not (I didn't really get very far).
« Last Edit: 2009-01-29 03:31:50 by Leighos Kudistos Megistos »

hotdog963al

  • *
  • Posts: 236
  • Horse
    • View Profile
    • Horse HQ
Re: Help with Music Opcodes
« Reply #2 on: 2009-01-29 13:50:10 »
Thanks for your reply, I'll check it out this evening!  :-)

hotdog963al

  • *
  • Posts: 236
  • Horse
    • View Profile
    • Horse HQ
Re: Help with Music Opcodes
« Reply #3 on: 2009-01-30 19:25:09 »
Just to mention, I'm doing this on the Playstation version.
I've decrypted their LZS format, found the values (it matches your research), but whenever I make a change nothing happens. The only thing I've been able to do is make the reactor theme restart (but not from the beginning) when you leave NMKIN_4 and go into NMKIN_5.

Will keep poking about...

41 4B 41 4F 03 00 D8 13 03 00 96 12 18 22 45 00 FF FF (Bombing)
41 4B 41 4F 07 00 0C 0B 01 00 96 12 18 22 45 04 FF FF (Mako)
41 4B 41 4F 08 00 70 12 03 00 96 12 18 22 45 05 FF FF (Battle)

Ok I've tried changing all the AKAOs to the same one which I think is the Boss Music. This just made everything the Reactor Theme! Gah!
« Last Edit: 2009-01-30 19:54:49 by hotdog963al »

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: Help with Music Opcodes
« Reply #4 on: 2009-01-30 20:42:47 »
That might be because the numbering is a little odd. I think that the boss music would be 0b, since it called CHU for some reason, although I haven't checked this. Try changing the first byte after each "41 4B 41 4F" to that or something random like 27 and see what happens.

hotdog963al

  • *
  • Posts: 236
  • Horse
    • View Profile
    • Horse HQ
Re: Help with Music Opcodes
« Reply #5 on: 2009-01-30 20:53:55 »
Each time I do this, illogically, the music doesn't change.
If I edit the Reactor theme to a new number (say 27), then play the game loading from the reactor savepoint, when I enter the scene I modded it will re-start the reactor theme from a few seconds in. So far I've managed to change things like that... but I've been unable to play anything other than the 3 songs the map appears to be stuck with.

I will try editing a later map in the game, since these ones are a bit funny. EDIT: no joy either.

I tried loading my save from the map I was editing, after removing all the AKAOs and I got silence, as expected! W00t, I guess? :P Progress...
« Last Edit: 2009-01-31 00:31:17 by hotdog963al »

ff7rules

  • *
  • Posts: 423
    • View Profile
Re: Help with Music Opcodes
« Reply #6 on: 2009-01-30 23:18:14 »
Each time I do this, illogically, the music doesn't change.
If I edit the Reactor theme to a new number (say 27), then play the game loading from the reactor savepoint, when I enter the scene I modded it will re-start the reactor theme from a few seconds in. So far I've managed to change things like that... but I've been unable to play anything other than the 3 songs the map appears to be stuck with.

I will try editing a later map in the game, since these ones are a bit funny.

I dunno if itll make a difference but have you tried starting the game from the start and working your way there, it prob won't work but its a suggestion.

hotdog963al

  • *
  • Posts: 236
  • Horse
    • View Profile
    • Horse HQ
Re: Help with Music Opcodes
« Reply #7 on: 2009-01-31 01:20:22 »
Ok, I've compared two maps using the same tune and it looks like the tracks are embedded into the files (?)
I copied out the bytes for the boss music and inserted them into the map (had to strip out literally every dialogue apart from the ones that are used in the scene with the bomb/guard scorpion).
I could hear the first two notes of the boss music in the right instrument, but then the emulator just dies. lame!

Right- I've managed to get the whole song playing (only when I replace the reactor theme, everything else crashes). But it's a bit off, I can merge it with the battle theme (by accident) and its sounds all 8-bit and weird, I can make it so it's playing normally but the bassline is a loud deep pulse, or I can make the bassline a weird loud noise.  Can't just get the tune to *work*.
If I replace the bytes for a song with another song (clipped) it will work but play weird... if I add bytes (and remove bytes from the dialogue etc) it will screw up completely.

Verdict: It's not possible to add/replace tracks on the Playstation version.
« Last Edit: 2009-01-31 15:32:25 by hotdog963al »

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: Help with Music Opcodes
« Reply #8 on: 2009-01-31 15:39:37 »
That's a pity. I've just got he Cosmo Canyon theme working perfectly in that file as well. I'll try some more things over the weekend.