Jump to content

Inserting .wav's?


Brendor
 Share

Recommended Posts

Hi all. I tried following the steps to inserting a wav file into fe7. I imported it into free space with sappy, changed the pointer at 0x69dab0 to the wav and made the priority 6 but when the sound is supposed to load. Am I missing something? is the frequency important in inserting? thanks

Link to comment
Share on other sites

when the sound is supposed to load... what?

you shouldn't be using .wavs as music anyway, you're better off using a MIDI since those are easier to troubleshoot; .wav's are better used as sfx

changing the pointer directly to the sound inserted won't do the trick since you're supposed to link it to a song header (not the raw sound data as you're doing)

Edited by CT075
Link to comment
Share on other sites

You need to put the wav onto an instrument map and make a midi that uses that wav. You can't just insert a wav sample, it's not a song thus won't work with the song table

Link to comment
Share on other sites

how do I do that? making the instrument map?

and I'm using them as sound effects I only made it load in battle to test it

Edited by Brendor the Brave
Link to comment
Share on other sites

step 1: insert AHIY.wav at 0x1003A80 (free space)

step 2: go to 0x69DAB0 and change the pointer there to 80 3A 00 09 and the priority from 0 to 6

step 3: change the values at 0xDB0004 and 0xDB0005 to 7A

step 4: go to 0x69F620 (7A's header) and change the first four bytes to 80 3A 00 09

there's also this weird side-effect where the enemies have generic PLAYER palettes.

Edited by Brendor the Brave
Link to comment
Share on other sites

Alright, this is clearly not working, so I'll explain.

First, this is just a sound effect, right? Right. So you want to make a MIDI that has the appropriate length for that sound effect, first of all. Open up something in Anvil or whatever and make a short MIDI that matches the length of your WAV. Make the instrument 124/125 - Telephone (just do it, okay?)

Next, we want to make a note that will correspond to your sound effect. This requires a fairly detailed explanation of the Sappy engine because you need to understand exactly what is going on. When you insert the Native Instrument Map into your ROM you are giving the game a list of offsets of WAV samples to get its instruments from. Go to where your map is in a hex editor. The first line should look something like this:

00 3C 00 00 5C A6 80 08 FF FA 00 CC

You're probably thinking "WHAT THE HELL IS THIS". Don't panic. This is what one entry on an instrument map looks like. It's 12 bytes long. How many instruments are there in a map? 128. What's 128 x 12? 1536, which is 0x600 in hexadecimal. What I want you to do is copy the next 0x600 bytes and put it into a new empty file. Assuming you're using HxD, in the top bar there should be a little box with "16" and a little arrow. Manually type in 12 there and press Enter. What you've just done is aligned the data so that each line represents one entry. You'll see a clear pattern now.

So what does all of that mean? Let's break each entry down.

You've got this:

00 3C 00 00 5C A6 80 08 FF FA 00 CC

The first four bytes are the "instrument type". The Sappy engine (aka the M4A engine) for GBA needs to know what kind of sound you're giving it. Is this a drumkit? Or a blank waveform ("8-bit" sound)? Or is it a sample? Does it need a key split? The list goes on. Basically 00 3C 00 00 means it's a sampled WAV to be used as a regular melodic instrument. This is NOT what we want. What you want is to head over to where 124 Telephone is. How do you figure that out? 124 x 12 = 1488 or 0x5D0.

That should be 80 00 00 00 A4 86 69 08 00 00 00 00. Oh look, it's different. This is because 80 00 00 00 denotes that it's an "every key split instrument". In simpler terms, it's a drumkit. The middle four values are the pointer to the drumkit map, which is another can of worms that you'll have to open now. So what do you do next? Head to 0x6986A4.

AHHH THERE'S MORE STUFF, right? Calm your farm! It's all actually very organised, you just can't see it at the moment. Each drumkit has 48 possible samples that it can contain. I am not sure how familiar you are with drumkits and MIDIs, but if you've ever made a MIDI before you might know that percussion has to match up to this list here. FE7's drumkit map is almost identical to that one, but some of the samples are switched around and also it's missing a few things. Actually, now I want you to do the same thing as you did before. Copy and paste the next 48 x 12 = 576 or 0x240 bytes and put it in a new file. Align it by 12 bytes per row again.

Hopefully things are starting to make a bit more sense. If you've ever tried to insert a MIDI and used a drumkit before, you'll have noticed you get these weird "boop" noises from time to time. This is because the note that plays corresponds to a note on this map here, but there's no sample in that place (you can see where these are when you see 01 3C 00 00 02 00 00 00 00 00 0F 00"--notice how there's no pointer?). Anyway, the map here doesn't correspond EXACTLY with Wikipedia's little list. For some reason the Snare Drum is close to the end of that list, and everything above that actually moves into the next drumkit map (so there is some overlap between each map). At any rate, the Snare Drum is on the line that has 08 3C 00 CA 5C 07 A4 08 FF 00 FF CC which is near the end.

Why am I telling you this, exactly? Right, back to your MIDI. Put one note on your MIDI that has a pitch of D3 (still on Telephone). Using Zahlman's song editor, insert that midi into the game and make it play. You should hear a snare drum noise. Great, we're on the right track. Now change that note into E3 and reinsert it. Now there should be a boop noise. This is good. Go back to the drumkit map and check the entry that corresponds to E3. It's two lines down from the line D3 was, which was 08 3C 00 CA 5C 07 A4 08 FF 00 FF CC. Oh look, it's 01 3C 00 00 02 00 00 00 00 00 0F 00. We're getting very close.

Finally, we need to edit that entry. Change the 01 3C to 08 3C--this tells the game that it's not a blank waveform, but an actual sample instead. The next 00 00 needs to be changed into 00 C0. I'm not sure what the 00 is for, but the C0 is the panning of the sound effect (as in, Left/Right balance) where C0 is in the middle, FF is extreme right and 80 is extreme left. The next four pointers need to be the pointer to your WAV sample. Just set them to FF 00 FF CC. (They are the Attack, Decay, Sustain and Release values. You don't need to know much about those since they are unimportant for this but if you want to know more watch

. If you want to see the effects of those on your samples, play around with them later.)

Now open up your ROM again and if you did everything right your sound effect should play.

Link to comment
Share on other sites

step 2: go to 0x69DAB0 and change the pointer there to 80 3A 00 09 and the priority from 0 to 6

don't do this

step 4: go to 0x69F620 (7A's header) and change the first four bytes to 80 3A 00 09

i am 95% sure that's not where the header is

Edited by CT075
Link to comment
Share on other sites

a) instrument map isn't the first pointer

b) now that i think about it, the offset you got from sappy is the one they use as a placeholder, changing the data there won't work

i would create a song from scratch (it isn't hard, look it up in the ultimate tut), set the instrument pointer like that and then change the pointer at 7A to that

Link to comment
Share on other sites

First of all you've set the ADSR values to effectively 0 so you're not going to hear anything at all. Change it to FF 00 FF CC like all of the other stuff.

Second, did you make the MIDI for it as well?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...