Jepael wrote:So essentially you have rewritten the playing routine and made it output VGM files?
Yes, with the help of SynaMax's amazing research. I wrote a set of tools that apply multiple transformation passes (song, track pre-parsing and generating of events including which 'tick' they were fired on) to get a better understanding of how HERAD works. Mostly for fun and to learn something, but I have some other things in mind.
Jepael wrote:I ran the original playback driver and made it log the writes into RDOS RAW files, so that leaves no room for errors in playback data or timing when playing it back on real hardware.
Though, while VGM timing is only accurate to 44100Hz timing, it's good enough for cross-platform playback and emulation, plus it supports looping.
You're absolutely right, though since we know the PIC rate and HERAD's divider we should be able to pretty accurately know at when the commands are being sent to the OPL chip. I'm familiar with the timings of the OPL2 chip itself (I have a project where I have one controlled over USB on a PCB), and you're right, I didn't account for those.
I did think about it but the delays are in the nanosecond ranges, not milliseconds, and I didn't consider that with a larger amount of writes the actual "write time" might spill over into the next millisecond.
I am a little confused though, isn't the resolution of the DOSBOX RAW format not 1ms? vs 1000/441000~=0.023ms resolution of VGM?. The playback rate of VGM can set in the header as well. For preservation purposes it should be just as good as DRO?
Jepael wrote:
Would not that depend on the player or chip emulation and how it is being used?
Yes, but if I play back the "original dosbox recording" from vgmrips.net against the same emulator, there are slight differences, which is what I was getting at. I probably should have clarified that.
Jepael wrote:
Also what most people don't seem to realize is that when a real program is sending data to OPL chip, it has to keep a certain delay between writes, while on many playback routines using emulation just send out all register writes with zero delay between them, so it can obviously sound different.
Indeed, although I do believe this is more of an issue with the OPL2 then it is with the OPL3 chips. My hardware board's firmware takes the timings into account, and no doubt it sounds different. The op-amps/filter stages used (different on each sound card back in the day as well) also greatly influence the outcome, and I don't know if most emulators emulate that (I'm using Nuked, and it doesn't sound like it does).
Besides that, I'm not 100% familiar with what the KGB music SHOULD sound like, so I better go find some actual recordings 😀
Jepael wrote:
The delay would be such that the rate at which registers can be written is about 38000 per second, for OPL2 chip.
So in theory, to get that approximately right for emulation purposes, it would either require the VGM file to have 1 sample delays between register writes, or the player to emulate this.
Ha, of course! Thanks! I'll try this, I'm very curious to see what happens. As for the player emulating it when writing to the emulated chip instead of the real one, I think that's a little beyond the scope of my little project (and currently the timings are dealt with in firmware).