Page 1 of 1

Inconsistent DPCM volume - ramps up and down

Posted: Sat Jan 14, 2017 6:30 pm
by El_Infame
I'm trying to use melodic samples in my project, but while DPCM doesn't allow volume control, it automatically ramps down and up in volume. Now, I could understand this if I was using two samples of differing volumes, but this happens while playing the same sample! Is this a properly-emulated limitation of the DPCM channel, or an issue with the FTM itself, or what?
Attached you'll find a ZIP, containing the FTM file (I know it sounds like crap, don't remind me!) and a WAV with the isolated DPCM channel, showcasing the volume ramping.

Re: Inconsistent DPCM volume - ramps up and down

Posted: Sun Jan 15, 2017 3:41 am
by Stratelier
Keep in mind that the Triangle, Noise, and DPCM channels are all output from the same pin of the 2A03 chip, so whatever's playing on one channel can affect the perceived volume of the others. (This also happens with Pulse 1 and Pulse 2.)

Re: Inconsistent DPCM volume - ramps up and down

Posted: Sun Jan 15, 2017 2:07 pm
by HertzDevil
If you play a new sample without resetting the delta value (by Zxx commands or the initial values on the instrument's assignments), it will just start from whatever value is last played from the existing sample. It could be greater than the initial value of the first sample, or less; in general this is non-determistic, so you should put something for your DPCM sample's initial delta value unless it is guaranteed to clip, in which case it will use up the whole dynamic range of the channel regardless.

None of the OP talks about the volume of the triangle or noise channel. Whether linear mixing occurs is irrelevant to this discussion since the output of the DPCM channel itself must ramp up and down nonetheless. So maybe stop spitting out templated responses next time? (While we are at it, the DPCM channel always resets its delta value to 0 on stopping, so this critical bug does not apply, i.e. playing the same song twice will not give different initial delta values on the first sample.)