Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /storage/content/49/145849/famitracker.com/public_html/forum/classes/dbHandler.php on line 29 FamiTracker
Login:
Menu:
Post: Author:
FamiTracker > General > FamiTracker Talk > DPCM import settings vs. effective loudness Owner: Necrophageon New post
Page 1 of 1 Sort:  
DPCM import settings vs. effective loudness Posted: 2011-12-03 06:40 Reply | Quote
Necrophageon

Avatar

Member for: 3965 days
Location: Minnesota
Status: Offline

#26959
So I've been noticing for a while now that when importing .wav samples for DPCM, any volume level higher than 7 results in noticeable clipping (which might just be the samples I'm using).

Recently, though, I noticed that while using an import volume level of 6 or 7 will eliminate a lot of noise, importing at ~3 or 4 actually ends up being louder than a higher value.

Is there a DPCM thread I've managed to overlook? Is this normal? Is it a bug?

_______________________
The only things certain in life are death and uncertainty.
Posted: 2011-12-03 07:19 Reply | Quote
Dwedit

Avatar

Member for: 4972 days
Location: Chicago
Status: Offline

#26961
DPCM is one bit data, it makes the wave go up or down depending on whether it's a 1 or 0. So if it is able to travel through the full range, then it's louder.
So lower volumes can make a louder sound.

Posted: 2011-12-03 07:41 Reply | Quote
Necrophageon

Avatar

Member for: 3965 days
Location: Minnesota
Status: Offline

#26963
I sort of follow you, but what's the deciding factor in whether or not the source sample and the import volume setting will give you maximum range?

I just want to know if anyone has tamed this beast so I don't have to waste energy doing dozens of experiments to figure it out.

_______________________
The only things certain in life are death and uncertainty.
Posted: 2011-12-03 14:08  (Last Edited: 2011-12-03 14:09) Reply | Quote
Rushjet1
Moderator

Avatar

Member for: 5012 days
Location: Atlanta, GA
Status: Offline

#26967
kind of the frequency of the wave. if you have lots of high frequency data, the lower the volume of the wave is, the more accurate it is (but quieter). The thing is, if you have a bass sound that's loud and then a quieter sound on top of that, if the bass sound is louder, it might have issues reproducing the other sound as quickly (the dpcm counter will be in a different position, etc). Also the actual position of the wave determines volume, so if your wave looks like it's riding the bottom of the frame then it's essentially setting the APU2 volume lower (tri/noise/dpcm).

[url=http://4x86.com/RJDMCv1.03.zip] try this, it makes it a lot less ambiguous if you can see the wave while importing (in my opinion) :P

Posted: 2011-12-03 16:25  (Last Edited: 2011-12-03 16:54) Reply | Quote
Necrophageon

Avatar

Member for: 3965 days
Location: Minnesota
Status: Offline

#26969
Oh WOW THANK YOU! :D This is fabulous! I have been searching for just such a program to no avail! Did you write this?

As for the technical explanation, it's still a bit beyond me. What I got out of it is that wavelength and amplitude have a direct relationship, which I'm having a hard time grasping. Am I even close? XD

The last bit made perfect sense, though. Is there a method for controlling the position of the wave or is it a case-by-case deal you just have to play around with?

[b]Edit:[/b] Oh I see now, you can set the delta counter's starting position, and that will place it where you want it for the most part, making triangle/noise quieter or louder. DUH! ...but then what happens if you throw it a Zxx command? Does FT just alter the sample on the fly the same way this program does?

Forgive me, I'm still a DPCM noob! :P

_______________________
The only things certain in life are death and uncertainty.
Posted: 2011-12-03 17:03  (Last Edited: 2011-12-03 17:04) Reply | Quote
Dwedit

Avatar

Member for: 4972 days
Location: Chicago
Status: Offline

#26970
A Zxx command moves the DMC counter, and the sample continues playing, and it still processes those bits of DMC making the wave go up and down, except it starts from your Zxx command value. If you use a Zxx command while a wave is playing, you probably hear a pop or click.

Posted: 2011-12-03 17:16  (Last Edited: 2011-12-03 17:29) Reply | Quote
Necrophageon

Avatar

Member for: 3965 days
Location: Minnesota
Status: Offline

#26971
So here's what I'm getting:
A .dmc contains a starting position for the delta counter, and then a series of 1's and 0's telling it to move up or down. The higher the counter value, the higher the volume. You can change the starting position by starting with a Zxx command (which I knew, but didn't fully comprehend). You can also change the counter value mid-sample and it will just continue from that point, but the jump will cause a pop.

Am I learning yet? :\

_______________________
The only things certain in life are death and uncertainty.
Posted: 2011-12-03 20:27 Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#26978
There's no starting position in the DMC data; it is entirely 1/0 deltas. The counter isn't volume, it's just the shape of the waveform/signal. (Volume is how much that signal changes up and down.)

The counter is reset to a value when you use Zxx, and also ---- has an implicit Z00. (You can use === to halt your sample without the Z00 pop.) At all other times it just floats, ending up wherever the last played sample left it.

Every Zxx causes a pop, even at the start of a sample. I don't recommend using Zxx at all unless you specifically want a pop. Just let the counter float. Samples more or less automatically produce their own headroom, you don't need to worry where they started.

Posted: 2011-12-03 22:31  (Last Edited: 2011-12-03 22:32) Reply | Quote
MovieMovies1

Avatar

Member for: 4373 days
Location: Norway
Status: Offline

#26986
[quote=rainwarrior]I don't recommend using Zxx at all unless you specifically want a pop. [/quote]

That is true, but in some cases, the sample needs a Zxx to keep a high volume. I have attached an example file with two songs in it, one without Zxx, one with


Attachments:
example.ftm (1 Kb)
Posted: 2011-12-03 23:09  (Last Edited: 2011-12-03 23:43) Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#26987
Yeah, there is also a volume difference between when the counter is low vs when it is high. I forgot about that. (The amplifier for the DPCM + Triangle channel is nonlinear.) Though this example isn't a very good way to show that, since you've overshadowed it with those huge pops.

If you look at the snare sample, it only uses about 20% of the counter range, and also it returns to its own natural centre. So, after setting Zxx once, it will keep the counter at a stable position anyway, no need to do it again. Even if you could do a Zxx without the pop, after the first quarter wave of the snare it will already be back to equilibrium.

I've revised your example to demonstrate this. Note that the volume is stable with only one Zxx. Setting it again won't change the volume. It just makes a pop.

Now, your other sample, the bass drum thingie, is a different story. It actually finishes with a huge upward delta. It doesn't have an equilibrium, and it will always leave the counter higher than it started. The only place to play it at a stable volume without pops is smashed against the high end of the counter, which is where it'll end up after two playings anyway.


A few things to note:

1. The primary thing that determines the sample volume is it's total up-down range. This mostly overrides the amplifier nonlinearity because they automatically make their own space. So, the louder the sample is by range, the less you can do with Zxx; really you can only use it if you have a centred sample that does not use the whole range (like your snare).

2. The way your sample behaves at its end is very important. A centred sample will naturally keep itself at the proper range to prevent a little clipping at the beginning.

In contrast, a sample that doesn't centre can deliberately leave the counter in a low or high position. If you make sure a sample goes low at the end, you can drive the counter back to 0 smoothly and not have to pop it back with Z00. This would get you back in the louder range of the nonlinearity, but avoid that nasty pop.

My own preference is to use samples with a centre, since they will naturally seek equilibrium and keep a stable volume, rather than trying to fight it with Zxx, but a lot of people seem pretty cool with the pop noise. (Especially at Konami.)


I guess my main point is, if you want to keep a high volume, Z00 may not be the best way to do this. You can make a sample with a large range (which makes Zxx irrelevant), or make a sample that drives the counter back to 0 at the end (this is what FamiTracker's "tilt" function is for). Both of those will get you higher volume without the pop.


Attachments:
example2.ftm (1 Kb)
Posted: 2011-12-03 23:22  (Last Edited: 2011-12-03 23:28) Reply | Quote
Necrophageon

Avatar

Member for: 3965 days
Location: Minnesota
Status: Offline

#26989
[quote=rainwarrior]The counter isn't volume, it's just the shape of the waveform/signal. (Volume is how much that signal changes up and down.)[/quote]

OK! THIS makes intuitive sense!

So basically the counter start position in Rush's program just simulates playing the sample with a Zxx command and changes nothing in the "sample" itself?

Well I think I'm starting to understand this a little better, but I still don't get how sometimes using a lower import volume in FamiTracker results in a higher perceived volume if the higher volumes aren't getting clipped (at least they don't appear to in the edit window).

Edit - Nevermind. You posted that last one as I was typing this. I'm pretty sure I understand this better now. Is my issue just FT's arbitrary management of the waveform when I import it with a different volume setting?

Thanks guys!

_______________________
The only things certain in life are death and uncertainty.
Posted: 2011-12-03 23:33 Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#26990
This could be a bug in FamiTracker. Could you post the WAV you are using that gives this problem?

Posted: 2011-12-04 01:42 Reply | Quote
Rushjet1
Moderator

Avatar

Member for: 5012 days
Location: Atlanta, GA
Status: Offline

#27001
[quote=Necrophageon]So basically the counter start position in Rush's program just simulates playing the sample with a Zxx command and changes nothing in the "sample" itself?[/quote]

Correct - this is basically "look at what your wave looks like when set to this counter position at the beginning." In some cases this will change the waveform entirely, in others it has almost no effect.

Also the "Tilt" function in FT can be used to push waves back to the bottom of the spectrum - just highlight the 2nd half of the wave and tilt, repeat. That's useful if you have one wave that leaves it in the middle and you want it back at the top.

Posted: 2011-12-04 06:27 Reply | Quote
Necrophageon

Avatar

Member for: 3965 days
Location: Minnesota
Status: Offline

#27011
WOW! After all this, it turns out I just wasn't paying enough attention. I was looking for clipping at the top, but it turns out any volume setting beyond 3 or 4 ends up pushing the waveform DOWN and clipping occurs at the BOTTOM. It also causes the sample to finish low which, if I understood everything well enough, means that it will also start low the next time it plays making it perpetually quiet.

[url=http://www.mediafire.com/?magh0cfptjw8alu]Here are the samples I'm using, you can see for yourself if you like.

OK. So my new understanding is that the volume of the source sample is of little consequence, provided you import it at an appropriate volume in FT, but a lower volume will allow for more flexibility as far as delta counter (Zxx) settings are concerned. I should also try to be sure that my samples find the average center of the whole waveform at the end to ensure a stable overall sound.

Does that sound right?

I may not totally comprehend all of this information right now, but I find it extraordinarily fascinating nonetheless. I've sought out DPCM info before, but I always end up finding generalized delta modulation information. Do any of you have some kind of technical documentation more specific to the 2A03? I'd really like to learn more about this.

This has been somewhat enlightening, and you guys have been incredibly helpful! I really appreciate it! Thanks again!

_______________________
The only things certain in life are death and uncertainty.
Posted: 2011-12-04 06:57  (Last Edited: 2011-12-04 07:01) Reply | Quote
rainwarrior

Avatar

Member for: 4150 days
Location: Canada
Status: Offline

#27014
Testing it out on your samples I would just say that you generally should not use volumes over 4. 4 is getting you maximum range without clipping, and anything above that is basically trying to make a waveform that is too wide for the hardware to play back properly. (I'm not sure if I'd call this a bug, as it's doing this deliberately; it would be fine to use high volume values for WAV files that are quiet.)

No, the fact that the >4 waveforms end with the counter high does not mean they will play at lower volume. Samples that use the full range will always play at the same volume; Zxx will not change this.

Technical document here: [url=http://www.slack.net/~ant/nes-emu/apu_ref.txt]http://www.slack.net/~ant/nes-emu/apu_ref.txt

Page 1 of 1 Sort: