Jump to content
  • 0

Anyone successfully replaced music to higher quality?


Airikita
 Share

Question

I'm reading this topic:

https://www.the-gcn.com/topic/2352-how-to-create-custom-sound-effects-for-oot/?hl=aiff

 

So I found the accordion instrument, and thought I'd have a hand at making it higher quality. I got excited, downloaded a nice quality wav file, and converted it appropriately.

 

...it was garbled... but yes, I knew from swapping Navi's voice that there was a sample rate and speed to set it at.

 

Even at 32000 sample rate and 10% faster, the quality was good BUT NOT BETTER than the original instrument.

 

After attempting this, I have grown a strange appreciation for the original accordion sound file.

 

I know some old projects had custom music, but has anyone replaced an instrument before? There are still slight pops in the sound I port in that still ruins the quality, and I have tried various formats of sampling rates and speeds.

 

I guess I got lucky with Unicat's sound, but of course Unicat still doesn't sound like the actual wav file I have of a kitten mewing. But it still worked..

 

My frustration is that only once I got it at the ideal settings, and it wasn't better. It sounded good, but not good enough. It seems to me that the sound file converted has to be a sine tone before it can even sound clean enough for OoT.

 

If I add any depth to the sound, such as normalization or echo, the sound will sound like I'm strangling a frog when ported to OOT.

  • Like 1
Link to comment
Share on other sites

23 answers to this question

Recommended Posts

  • 0

OH! Sorry. I misunderstood. I have never dealt with sound that. I dont even know what the aifc sound file is....sooooooo... I need to excuse myself dont i? :)

Maybe not... I'm literally just replacing stuff like the ocarina flute sound, etc...

Link to comment
Share on other sites

  • 0

So the sound effects themselves? I know how to change the Ocarina notes themselves but not import custom sounds. I doubt this is what you are looking for but....

 

From: http://forums.zeldaspeedruns.com/index.php?topic=419.0

 

Changing the playback notes
 
--Open the Debug ROM in your hex editor and go to BA8120.  Alternatively, search for 02 00 00 12 56.
 
--The songs are stored in consecutive blocks of 160 bytes, in the following order
 
   Minuet of Forest:BA8120
   Bolero of Fire: BA81C0
   Serande of Water: BA8260
   Requiem of Spirit: BA8300
   Nocturne of Shadow: BA83A0
   Prelude to Light: BA8440
   Saria's Song: BA84E0
   Epona's Song: BA8580
   Zelda's Lullaby: BA8620
   Sun's Song: BA86C0
   Song of Time: BA8760
   Song of Storms: BA8800
 
--Each note consists of 8 bytes.  You can have up to 19 notes in the playback sequence, as the last note must be an end rest.
 
--Byte 1 controls the pitch of the note, as well as the note displayed.  It is simply the number of half-steps between the note and Middle-C.  The 5 default notes are listed below.  FF indicates a rest, ie, no note is played.
 
   02 A  (D)
   05 Cv (F)
   09 C> (A)
   0B C< (B)
   0E C^ (D)
   FF Rest
 
--Byte 2 is always 00 in game-defined songs.  It seems to have no purpose.  Odd.
 
--Bytes 3 and 4 are the duration of the note, in input frames.  A value of 60 (0x3C) will give a note that lasts exactly 1 second.  
 
--This is an unsigned short integer, so the maximum number of frames a note can last is 65535 (0xFFFF). Such a note would last over 18 minutes.
   --If you don't want to calculate your own note durations, the following are a good choice.
 
   06 Sixteenth note
   0C Eighth note
   18 Quarter note
   30 Half note
   48 Dotted Half note
   60 Whole Note
 
   --A rest of 00 duration signals the end of the song.
 
   --If you want to have two consecutive notes with the same first byte, put a 01 duration rest between them.  Otherwise, the song won't work.
 
--Bytes 5 and 6 are the volume, in the form of a short integer.  Most ocarina songs use volumes between 5000 and 6000.
 
--Byte 7 is the pitch adjustment from the control stick.  It is a signed byte.  7F is a whole step up, while 80 is a whole step down.  Fractional steps up and down can be achieved with smaller values.
 
--Byte 8 is the vibrato from the control stick.  Still investigating this.
 
--The playback sequence is what shows up when you learn the song and when the song plays on the start menu.  Keep in mind that if you use sharp or flat notes in the playback sequence, you will have to match them when learning the song and when playing it on the start menu.
Link to comment
Share on other sites

  • 0

Airikita, would you mind uploading a sample video of an instrument you tried replacing and the outcome of it? I'm very interested in at least seeing what you came up with. This is the same garbage I tried dealing with but with sound effects. I wanted to port over a few sound effects from MM such as Tatl's ding and some of the character voices with much fail. I know a lot of times you can take certain things from MM and just copy/paste but for some reason, this didn't really work out. In fact replacing some of OoT Link's grunts from MM Link's produced a few pops in the audio that just totally ruined the transfer. It was very annoying. So I took your route and tried a sample that was in wav format and doing the whole aifc conversion....and that was WORSE! Most of the time it was very deep and scratchy. You could at least make out what the sound would be, but it was terrible and definitely not worthy of keeping at all. But as far as instruments go, I've been a bit interested in that too. I'd like to replace or at least add a real flute into the mix, not just the piccolo along with a church organ, not just Ganondorf's organ (or just write over that anyway). I was a nut trying to transfer Twilight Princess music to OoT and some of it did come out good but sometimes you just needed the actual instruments in order for it to sound perfect.

Link to comment
Share on other sites

  • 0

You know if you're just taking a sound from MM to OOT, just use the raw binary instead of compressing it again.

 

Thing is the sounds are already compressed in OOT and MM, and re-compressing them doesn't work.

 

The tool allows you to get the raw binary...

 

But yeah, mine was with a raw wav file. I'll be looking around for a different audio tool (if anything else can make aiff files like Audacity)

Link to comment
Share on other sites

  • 0

Hey Airikita, I do use the raw format from the MM game, I don't recompress it. The only time I did was when I was using a fresh wav file.

 

I dunno if you're talking to me, haddockd, but I use Goldwave all the time, it's actually a very nice tool to use. I use it for all of my audio and even video needs. But it does handle aiff files, I thought it even handled aifc files, but not quite in the same way as the n64 compression tool fixes them up.

Link to comment
Share on other sites

  • 0

Well Navi's voice IS rather high-pitched, so yeah... I can imagine that then.

 

Btw, I was correct, OOT's instrument accordion takes a special sample rate:

SpecialOOTSampleRate_zpsule6rfwy.png

 

30464 Hz... such a specific number. Now, if I can figure out how to give the new audio a specific sample rate... Nevermind, found the "resampling" option.

 

=======================================

 

Btw:

-------

http://mp3.about.com/od/essentialsoftware/tp/bestaudioeditors.htm

 

"2.  Wavosaur"

 

"can handle MP3, WAV,OGG, aif, aiff, wavpack, au/snd, raw binary, Amiga 8svx & 16svx, ADPCM Dialogic vox, and Akai S1000 audio formats"

 

 

=================================================

 

OMG WIN! This is a thing of beauty:

-------------------------------------------------

InstrumentWavosaurEdit_zps7vty5hos.png

Link to comment
Share on other sites

  • 0

This is a fantastic finding! I'm sure the audiophiles of Zelda64 like me will be drooling as soon as you crack this wide open and figure out the secrets within. Even though it's not perfect, it's a work in progress and I think it's a great start.

Link to comment
Share on other sites

  • 0

It'd be even more perfect to change the sample rate in-game, and force it. Hell, now that we can SEE the sample rate the original audio has, I'm sure finding it will just be second-hand now.

 

==========================

 

EDIT:

Fun facts about N64 Audio: http://en.wikipedia.org/wiki/Nintendo_64_technical_specifications

 

"The RSP is theoretically capable of a maximum of 100 channels of PCM at a time, but only in a case where all system resources are devoted to audio. It has a maximum sampling rate of 48 kHz with 16-bit audio. In practice, however, storage limitations caused by the ROM cartridge format limit the audio size and thus quality."

 

Even at 48 kHz would improve the quality, but perhaps there might be a way to hack it to possibly be 64 kHz? I would imagine the likelihood of hardware limitations.

 

I am currently finding it difficult to find the sample rate in hex for the accordion... I would assume a preset value given that the sound can't just be enhanced without the game spewing out glitchy sounds.

Link to comment
Share on other sites

  • 0

I will allow everyone to download my notes on audio. It is missing some details, such as the buffer size at 0x8 at address 80171A0C for music sequences, but feel free to have a poke around and play with the values. It's difficult to get a fully rounded sound from the notes, but that's up to whoever is willing to have a poke around:

http://www.mediafire.com/view/enlmcd8tcei1xja/AudioHacking.txt

 

I also didn't list the other values I changed, but I did list a nice ASM hack for a nice smooth bass boost for the notes.

 

The snippet at 800E9108 did a stupid truncation, making the notes more like a sine tone. Very flat and blunt notes. The Ceil command adds a slight bass boost and calculates the full value instead of the partial fractions, which adds a roundness to the sound using the full peak of the frequency rather than trimming that nice fade at the edges.

 

If you don't truncate, however, the notes will have a lengthy fraction causing the sounds to drag out, which sounds like a mess when a sequence plays over itself.

 

Any overzealous value changes can cause an overcalculation for the echo, which uses the sample rate as part of the calculations. This will cause a buffer overflow in certain situations. Even the attack volume of a sequence can lower the overlapping of float sequences, making the size of the sounds less bulky in RAM.

 

You'll notice a significant clarity with the suggested sample rate, and a possible emulator crash. 48kHz is the limit for N64, so don't expect your audio plugin on your emulator to sustain a heavily orchestrated sequence such as Hyrule Field music or mini game music.

 

The value changed is what calculates the decompression of the AIFC audio sound files, so it's not using a higher sample rate file, but rounds the file up to a higher sample rate quality in-game.

 

In fact the decompression is clean and smooth, making the tones sound a hell of a lot smoother than a higher sample rate sound file due to the sound manipulation in the code itself.

 

YES, your audio plugin will crash the emulator if you're not editing the proper values.

 

-------------------------

 

Note: I will do more on finding the sample rates of individual sounds... but it might be that all instruments use the same sample rates.

  • Like 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.