Page 1 of 1

Ramping up the volume on the PSG causes artifacts

Posted: Sat Sep 08, 2012 10:45 am
by BigEvilCorporation
Hi all,

I'm implementing a volume fader on the PSG (gearing up to writing software envelopes) but with only 16 possible attenuation values there's noticeable "stepping" when ramping it up over 1 second or so. Is there any way to avoid this? Any tricks?

Cheers

Posted: Sat Sep 08, 2012 11:35 am
by TmEE co.(TM)
It is logarithmic so you're lucky that you can change volumes in uniform manner by just using adds and subs, with linear you need more elaborate setup.
Only problem with the PSG is that the volume step is 2db and it is quite a noticable change in volume. On AY you get 3db so that's even bigger.

To keep good FM, PCM and PSG balance you'd rarely want go fo above 4 steps to max.

Posted: Mon Sep 10, 2012 12:13 pm
by BigEvilCorporation
TmEE co.(TM) wrote:It is logarithmic
Yeah, there's that too. Is this a lost cause? I'd like to be able to create "softer" notes but so far this chip doesn't really allow for it.

Posted: Mon Sep 10, 2012 5:25 pm
by TmEE co.(TM)
Just don't go too high volume. In my MD sound engine the PSG volume is rarely above -8db, otherwise it drowns out FM and PCM.

Posted: Tue Sep 11, 2012 11:40 am
by BigEvilCorporation
Cheers, I'll have a play about and see if this helps

Posted: Thu Sep 13, 2012 11:42 am
by BigEvilCorporation
Yes, this works a treat! I've limited the ramp-up range to between 0xC and 0x5, and it sounds very soft.

I take it any PSG values get applied immediately, instead of waiting for the next polarity flip? Would it be possible to time a change so that it coincides with a flip, or could we not achieve timing that accurate on the Z80?

I've also had a dithering solution recommended, I might look into that too.