Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,484,145
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-26-24 12:22 AM
Guest: Register | Login

0 users currently in ROM Hacking | 2 guests | 1 bot

Main - ROM Hacking - General Sound help (avoiding noise) New thread | New reply


Kejardon
Posted on 04-22-07 03:34 AM (rev. 2 of 04-22-07 09:32 AM) Link | Quote | ID: 28643


Red Koopa
Level: 28

Posts: 73/139
EXP: 129803
Next: 1535

Since: 02-21-07

Last post: 6086 days
Last view: 5994 days
... I'm really not sure where to ask this, but since it's for a rom hack, I figured I'd put it here.

I'm trying to convert an instrument sample to a format I can use for the SNES. The first step is converting from AIFF to wav... which seems simple and straightforward, but is causing a problem.

The AIFF file is nice and clean, but when I convert it to wav there's suddenly a ton of noise. I decided to simplify my testing of it, but I have no idea where the noise is coming from still.

Right now, I'm loading the AIFF file, combining two channels (stereo) into one. That done, it still sounds just fine in Audicity. I export it to wav, same sampling rate, and then reload the wav in Audicity, and suddenly there's noise. It's not particularly bad (I hardly even noticed it while converting it the first time), but all of the music in the game originally is clean of noise and so it still stands out really bad.

Any suggestions?

::EDIT::
k, I got the noise out... now I have a different problem.
There's a clicking noise everytime the sample loops (BRR sample, loaded and looping via SNES hardware). I can't seem to pinpoint what's causing the clicking, though. I've tried a number of things, but nothing seems to get rid of it. It's less noticable the lower the notes are though.

Erika
Posted on 04-22-07 10:34 PM Link | Quote | ID: 28931


Paratroopa
Level: 29

Posts: 19/150
EXP: 145535
Next: 2350

Since: 02-19-07
From: Shibuya

Last post: 5926 days
Last view: 5536 days
Garbage at the end of the wave. The loop always goes to the end of the wave. Just chop it off.

blackhole89
Posted on 04-23-07 12:06 AM Link | Quote | ID: 28957


The Guardian
Moloch whose eyes are a thousand blind windows!
Level: 124

Posts: 150/4196
EXP: 21532189
Next: 304412

Since: 02-19-07
From: Ithaca, NY, US

Last post: 471 days
Last view: 83 days



To express it in a slightly more clear way, you need to pay attention to the looping of the sample. Assuming you want your sample to loop to begin with, you have to ensure that the last sample (by sample, here, I mean a single gain value in the data) and the sample the loop pointer points at have nearly the same value and, if you want it to sound right, the derivative for the last sample and the loop point to be nearly the same as well. Just keep in mind what the DSP does is ultimately simply sticking a copy of the sample beginning with the loop point at the end until the sample's playing time has elapsed.

____________________



MathOnNapkins
Posted on 04-23-07 02:51 AM Link | Quote | ID: 29028


Super Koopa
Level: 62

Posts: 89/842
EXP: 1935441
Next: 49245

Since: 02-19-07
From: durff

Last post: 4488 days
Last view: 4011 days
I was talking to Disch the other day and he noticed that the beginning of many samples in SNES games begin with 9 zero bytes (yes, all zero). Perhaps this helps reset the filter and eliminate the need for "derivatives" to match up correctly on loop. Just FYI, the loop flag is totally ignored if the end bit is not set. It will go to the next BRR block.

____________________
Zelda Hacking Forum
hobbies: delectatio morosa

Rich
Posted on 04-23-07 02:33 PM (rev. 3 of 04-23-07 02:56 PM) Link | Quote | ID: 29160


Snifit
Level: 39

Posts: 75/296
EXP: 403426
Next: 1345

Since: 02-19-07
From: UK

Last post: 6076 days
Last view: 6075 days
The clicking is because the cut of the loop isnt 'clean'. I dont know how to explain that better, but when I create instrument samples, I have to make sure the end of the wave is as similar to that at the loop start point as possible, so the sound loops without a clicking sound at the end.

That probably made no sense.

____________________
Who needs a signature, anyway?

MathOnNapkins
Posted on 04-23-07 02:54 PM Link | Quote | ID: 29163


Super Koopa
Level: 62

Posts: 92/842
EXP: 1935441
Next: 49245

Since: 02-19-07
From: durff

Last post: 4488 days
Last view: 4011 days
In mathematical terms, it means the periodic curve must be continuous. (Since it's digital sound, as close to continuous as possible.)

____________________
Zelda Hacking Forum
hobbies: delectatio morosa

HyperHacker
Posted on 04-24-07 06:57 AM Link | Quote | ID: 29434

...
Level: 73

Posts: 488/1220
EXP: 3366667
Next: 119201

Since: 03-25-07
From: no

Last post: 6091 days
Last view: 6074 days
It's easy to visualize: imagine a square, with a line that moves from the left to right egde and goes up and down as it does. The program is going to copy this square and tile it horizontally. You have to ensure the line is at the same height at the left and right edge, or else there'll be a big jump where it tiles. Same as making tiling backgrounds. The line's height is the sound's frequency.

Kejardon
Posted on 04-28-07 07:48 PM (rev. 3 of 04-29-07 04:50 AM) Link | Quote | ID: 30919


Red Koopa
Level: 28

Posts: 80/139
EXP: 129803
Next: 1535

Since: 02-21-07

Last post: 6086 days
Last view: 5994 days
I just doublechecked, and assuming I did the math right and I understand the BRR format correctly, it's a (surprisingly perfect) match. Amplitude at the end of the sample is ~6144 and leveled off (derivative = 0). The loop sample starts with *two* 6144's, no filter.

I managed to follow the waveform in both the brr and the original wav file, the amplitudes look like they're matching up correctly.
I checked the end of the samples... the brr actually looks like it has a few extra samples at the end the wav doesn't have - I'm going to guess that the brr encoder I used stuck them in to match up with the loop start. (snesbrr.exe by DMV27)

I have a few ideas to try, I guess.

::edit:: On the second check, the last brr block looks *way* different than the actual wav sample. I'll tweak that and see if it helps.

::edit again:: Finally got it sounding nice. I ended up deleting the last brr block and picking a different loop point. Guess I'll be looping brr samples by hand from now on.

Main - ROM Hacking - General Sound help (avoiding noise) New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.022 seconds. (339KB of memory used)
MySQL - queries: 62, rows: 90/90, time: 0.016 seconds.