Honestly i still don't see how to handle all that efficiently. As soon you have variable pitch you have to potentially adjust bank register at any time (and so lost ~90 cycles in you loop)... I guess the final output rate cannot be higher than 11 / 12 Khz with 3 channels in this case, and even 11/12 Khz would be difficult to obtain.To do it right, you clearly need to do something akin to Stef's four channel mixer - mixing into a buffer. Otherwise, you're stuck with the 32K limit. You're going to use more Z80 time mixing different pitches, so you won't be able to reach as high a sample rate as fixed pitch. The work comes in trying different methods to see what is powerful enough to be useful while not slowing the sample so much as to be useless. One thought is to have tables for each pitch, where the entries are what you add to the sample pointer for each sample period.
It didn't sound too bad for AF2 because we expect voices to be somewhat distorted in this environment but in another context really the quality is not good enough to work with. For acceptable quality you have to uses DAC.
I though about another way : uses FM channel as DAC by setting very high frequency and playing with 7 bits TL (log) volume, i never tested it but i'm not sure it would really work.
Yeah, only one channel with variable pitch is a bit limitating for MOD player Anyway maybe we can't do more on Z80.Another possibility in the case of mixing to the YM DAC alone might be limiting it to a single variable-pitch channel with additional channels being fixed rate to minimize overhead and SRAM buffer space needed. (doing a single PCM channel only would obviously be much easier in general since you could just change the playback rate to control pitch, but that's limited to 1 channel -unless you use the PSG; even so, it seems very few games even attempted to do a single channel MOD player like that)
See it as DPCM as i'm using a fixed delta table, though as i'm using high playback rate (22 khz) the delta table is adjusted to take that in account and the resulting quality is pretty good compared to original sample.What ADPCM format did you use for your player?