Ramping up the volume on the PSG causes artifacts

For anything related to sound (YM2612, PSG, Z80, PCM...)

Moderator: BigEvilCorporation

Post Reply
BigEvilCorporation
Very interested
Posts: 209
Joined: Sat Sep 08, 2012 10:41 am
Contact:

Ramping up the volume on the PSG causes artifacts

Post by BigEvilCorporation » Sat Sep 08, 2012 10:45 am

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
A blog of my Megadrive programming adventures: http://www.bigevilcorporation.co.uk

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sat Sep 08, 2012 11:35 am

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.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

BigEvilCorporation
Very interested
Posts: 209
Joined: Sat Sep 08, 2012 10:41 am
Contact:

Post by BigEvilCorporation » Mon Sep 10, 2012 12:13 pm

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.
A blog of my Megadrive programming adventures: http://www.bigevilcorporation.co.uk

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Mon Sep 10, 2012 5:25 pm

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.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

BigEvilCorporation
Very interested
Posts: 209
Joined: Sat Sep 08, 2012 10:41 am
Contact:

Post by BigEvilCorporation » Tue Sep 11, 2012 11:40 am

Cheers, I'll have a play about and see if this helps
A blog of my Megadrive programming adventures: http://www.bigevilcorporation.co.uk

BigEvilCorporation
Very interested
Posts: 209
Joined: Sat Sep 08, 2012 10:41 am
Contact:

Post by BigEvilCorporation » Thu Sep 13, 2012 11:42 am

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.
A blog of my Megadrive programming adventures: http://www.bigevilcorporation.co.uk

Post Reply