very good thanks!
I have discovered a bug in replay of OPL4 tracks for some systems (f.e. Fuuki) - which was introduced in version 1.3 while version 1.2 plays nicely. Sounds like it tries playing with ROM samples instead of playing with user loaded samples. Sounds quite a cacophony :) Tracks from MSX plays well with both versions, though
I have discovered a bug in replay of OPL4 tracks for some systems (f.e. Fuuki) - which was introduced in version 1.3 while version 1.2 plays nicely. Sounds like it tries playing with ROM samples instead of playing with user loaded samples. Sounds quite a cacophony :) Tracks from MSX plays well with both versions, though
There does not seem to be an issue open for this yet on the issuetracker. I would suggest adding it there so it does not get lost.
BTW Which OPL4 cartridge did you use? I will try it out later today with DalSoRi R2 (only OPL4 cart I have).
Finally I've been able to test the RC4 built and I found something interesting: the 2 bugs I encountered before (GR8NET SCC+ detection and DalSoRi R2 issue) seem to be correlated!
When I insert my DalSoRi (in a primary or seconday slot), VGMPlay isn't able to detect the SCC+ in my GR8NET (firmware 0.8). With DalSoRi not inserted, SCC detection functions like it should.
I hope this helps solving the last issues for the final release! If I can help you test some more, just let me know!
A small question for @Grauw: does VGMPlay use dual PSG when emulating DCSG (say, if you have a Carnivore 2 or a MFRSCC+SD)?
No, there is just one instance of the emulation. So if you want to play dual DCSG you need at least one real one. However you can modify the source to add a 2nd emulation instance with relative ease if you want it.
Thanks for the quick reply! That's not what I had in mind but it's good to know, anyway. I was actually thinking about emulating all four DCSG channels (using one PSG for the tone channels and the other PSG for the noise channel, for example). Normally, how do you prioritize which channels are being emulated?
Ah, I see what you mean.
Noise always plays on channel 3, the DCSG noise frequency is partially tied to the 3rd channel so DCSG music will often already try to avoid playing noise and tone 3 at the same time. E.g. the MegaDrive SMPS music driver never plays tones on the 3rd channel. When both noise and tone play, it uses the highest volume of the two.
The PSG on DCSG emulation currently has the following imperfections:
- Noise volume can not be separately controlled from tone channel 3 volume.
- When channel 3 plays both tone and noise, they OR rather than sum, which sounds a bit different.
- The volume scaling is different so the volume control is mapped and does not match exactly.
- The noise uses a different LFSR so the colour of the noise is different.
- The DCSG’s “periodic noise” waveform is not supported.
- The noise frequency is sometimes different.
The first two are fixable by borrowing a channel off a second PSG, but it could introduce balance issues. But the real problem is that it makes the emulation code more complex, I would have to introduce a second code path depending on whether a 2nd PSG is available. Wrenching that into a single implementation is different, worst case I would need to make a 2nd.
Since even then the emulation is not going to be perfect, and the current approach does the job pretty well for most of the music I’ve tried, I’m quite happy with the current approach. Although I do try to make a good effort (e.g. I did improve the volume scaling), there’s a limit to how complex I want to make it.
If there were no DCSG cartridges for MSX it would be a different matter, but you can just get a real one if accuracy is really important. In the end it’s really meant as a better-than-nothing alternative so that people who don’t own a DCSG (or don’t have a free slot) can still listen to MegaDrive music, and if you own one DCSG you can listen to dual-DCSG music.
Note I don’t mean to dismiss any future suggestions for improving the DCSG emulation, just this particular thing seems too much trouble to be worth it. Similarly I choose not to attempt to dynamically pick a channel for the noise based on whether it was not used by a tone or had a similar volume, that would’ve just gotten too tricky.
I wasn't aware of the connection between tone channel 3 and noise channel on DCSG. Very interesting. And all things considered I think your approach is as good as it gets. I'm already amazed by the DCSG emulation as it is, it's great to have it (I'm a big fan of Mega Drive music).
I appreciate you taking the time to explain. I'm not exaggerating when I say that VGMPlay is easily one of my favorite pieces of software on MSX right now. I'm really happy to have the opportunity to better understand its workings. Thanks!
Specifically regarding that link between tone and noise, the DCSG noise has two modes of specifying the frequency: either one of three fixed frequencies, or using the frequency of the 3rd tone channel. In the latter case DCSG music will generally mute the 3rd tone while noise sounds, which is convenient for us.
As for the noise frequency range (no. 6), the PSG can reproduce the first two fixed frequencies more or less correctly, but the third is clamped and plays higher than it should. When the noise frequency is taken from the tone channel, the DCSG can specify 10 frequency bits while the PSG specifies 5, so it’s again clamped when the frequency gets too low for the PSG.