jombo23 / N64-Tools

N64 Tools
The Unlicense
239 stars 113 forks source link

N64 MIDI Tool Request - Support For Space Invaders #20

Closed jdl96 closed 2 years ago

jdl96 commented 3 years ago

Hello! I was wondering if it would be possible to include support for Space Invaders in the N64 MIDI Tool since support for it has already been added to the N64 Sound Tool. It has some really great music in it, and since there's only low quality recordings of its soundtrack on YouTube (and no USF rips available) I was wanting to take a shot at using the MIDIs to make higher quality versions.

If it somehow helps, the game has also been released for PS1 and PC. I've made attempts at extracting the MIDIs from the PC version but I have not been able to find a tool that will work with it, so the N64 MIDI Tool seems to be the closest solution I've found.

I apologize if you are not taking requests.

Thanks!

SubDrag commented 3 years ago

I was unable to ever actually find the midi location. Maybe it's a new format since it's cross-platform? If you knew where it was in RAM/ROM I could take a deeper look, but I've not even found that.

jdl96 commented 3 years ago

Unfortunately I have no idea how to find something like that. If it helps, the PS1 and PC versions both have the sound sequences in .ZSD files. "sndseqpl.zsd" contains all the instruments that makes up Pluto's music, for example. When importing them RAW into Audacity, there's a bit of data at the beginning that's not a sound sample, and I assume that that's actually the MIDI data itself, but I'm not 100% sure. I don't know if the structure of the game is entirely different in N64 ROM form, but if you're somehow able to find the .ZSD files in the ROM, then that's probably where the MIDI data is located. The PC and PS1 ZSD files have "ZSNDWIN" and "ZSNDPSX" headers respectively. There also appears to be a recurring "ZTRK" header in the files as well. The game was developed by Z-Axis, so I assume the full names for the headers are something like Z-Axis Sound and Z-Axis Track.

SubDrag commented 2 years ago

Did you ever happen to find any more info on this format? You're right, ZTRK is the music, and it's always after the sound bank it corresponds. This article seems to indicate it's combining together slowed down sounds: https://tcrf.net/Space_Invaders_(PlayStation)

But I can't find any decoders...guessing you have not found any and no one has ever decoded this format? The N64 one sound is not a problem, it's all decoded perfectly, just music and stringing them together is the unknown.

SubDrag commented 2 years ago

Got some help, and started to work through this format. Not sounding right (maybe it's the sound), anyways if you're interested still take a look and let me know how to improve.

jdl96 commented 2 years ago

Hi - sorry for the late response. No, I haven't been able to find any other info about the format. As far as I know the N64 Midi Tool is the first attempt that anyone has ever made of decoding the format.

And yes, I still am interested in getting the midis from this game (although I don't quite have the time at the moment to try and make higher quality versions of them). I downloaded the latest release and ripped all 12 of the "spots" but unfortunately I can't identify any of the music tracks except for 00000001 and 00000002 which sound like the Alien Homeworld background music. Is there any way you could post a list of what track each "spot" is supposed to be? Also, I'm not sure what the "AdditionalPart" midis are.

SubDrag commented 2 years ago

Due to limitations in midi, it has to split up tracks because you can't play simultaneous notes... It makes it harder to troubleshoot too. You might want to check separate by instrument.

0x515BC0 SNDSEQEA.ZSD Earth 0x5491D0 SNDSEQJU.ZSD Jupiter 0x567FA0 SNDSEQMA.ZSD Mars 0x597FF0 SNDSEQNE.ZSD Neptune 0x5BD490 SNDSEQPL.ZSD Pluto 0x5FD2A0 SNDSEQSA.ZSD Saturn 0x63AD40 SNDSEQSU.ZSD Mercury? 0x66C1F0 SNDSEQUR.ZSD Uranus 0x690170 SNDSEQVE.ZSD Venus

I didn't know how to do tempo... It's just a value that's surely not right.

jdl96 commented 2 years ago

Thanks for the list. I'm not sure if this will help, but here are some BPMs I came up with for all the music tracks after having a listen on YouTube:

Pluto: 115 Neptune: 140 Uranus: 142 Saturn: 150 Jupiter: 125 Mars: 140 Venus: 132 Earth: 142 Mercury: 140 Alien Homeworld: 120

They will have to be converted into the proper values since the midi data is slowed down. Also, the music in this game has different layers that start playing under different conditions. It's kind of like the map screen music in Yoshi's Island for the SNES. Here is a list of when each layer gets added:

  1. On the Planet briefing screen.
  2. When exiting the Planet briefing screen/if there's more than 12 aliens on the screen.
  3. If the number of aliens on the screen is less than 12 but greater than 3.
  4. If there are 3 or less aliens left on the screen.
  5. If you're on a boss level.

I hope this helps!

SubDrag commented 2 years ago

Nothing huge to report, but I enable separate by instrument, which hopefully should make it more testable. There seem to be a lot of tracks that are like full on note. I think people will have to just export soundbank and midis and manipulate afterwards.

image

SubDrag commented 2 years ago

I doubt this will ever be perfect, but it's now splitting into the 8 separate set of tracks now per song (there is a table and a rate table). I don't think the rate is perfect, and there is also a separate like sfx repeated track that's separate and not included that plays infinitely...but it should be much better than it was. Mercury seems pretty decent.

SubDrag commented 2 years ago

I think it's as good as it's going to get, sounding pretty good now. I'll close this, but feel free to respond if you discover anything.