Quote:
I clearly heard it when watching the video. I didn't look at any code.
Good ear
I'm completely re-writing the audio emulation code.
ccovell wrote:
Okay, since you posted on your blog about this too, Tomaitheous: Is there any way to eliminate the nasty popping on real PCE hardware when you write new waveforms into WSG RAM? The only thing that doesn't cause popping are waveforms that are 32 bytes of value $10. Even changing the volume registers on the PCE causes popping.
Depends. There are two audible clicks. One is caused by changing of the volume of the channel. The larger the difference, the large the 'pop'. The 'direction' of the pop is directly related to the direction of the volume change, if that makes sense. On the 6280a, this pop (at full volume change) is super tiny and shouldn't be audible unless nothing was playing and all you did was volume changes to channels (and even at that, it's hard to hear). I made a test rom that used a single channel on the 6280a as a 32byte buffer, and using the 7khz timer was able to play 50+khz sample playback without artifacts. But on the original 6280 there was a horrible buzzing sound from the popping of the volume reg. IIRC, clearing both the control bits in $804 also has the same effect as writing 0 to the volume bits. But changing to 10b or 01b or 11b does *not* do this. Thus you can immediately silence a channel by ORing #$c0 with the current volume level without popping artifact (and vice versa). Most 'instruments' start off with a fairly high attack rate in PCE games, so the pop isn't as noticeable since waveform output is accompanying it at the same time.
But changing a waveform mid 'note', gives both a pop related to the volume (assuming non 6280a revision) and a click like artifact because the waveform being updated it almost always out of sync (especially if you're trying to change the timbre over time. Changing the duty cycle of a square waves seem to have the least amount of audible click, for obvious reasons).
So anyway, to get away from the annoying volume pop issue of the original 6280 output - you need a pop in the opposite direction to cancel it out. Thus use two channels. Only one plays at a time, and you always update the alternate channel non playing channel. Turning off one channel cancels out turning on the other channel, though you need to do this part fairly close to each other (even though the volume state of a channel is only updated every 7khz or so). Of course this won't help any for the waveform 'morphing' and such, and is really only practical for outputting samples. But, you can gain back that additional channel for dual channel sample playback by interleaving the sample data in the 32byte buffer (or more, if you want more channels) - but that does have the effect of halving/dividing your sample playback rate.
The SuperGrafx has the 6280a (all of them do AFAIK). And it's been reported that all Core Grafx model 1's have the 6280a as well (makes sense, they were released at the same time). But AFAIK no other models of the PCE/TG/Duo have this chip (not the original Duo nor the later model R/RX). Can't say for the different model handhelds though.