Specifically, I'm interested in knowing what these byte ranges are for:
- CHNM 0, CHDT 0x00:0x1b
- CHNM 0, CHDT 0x20:0x23
- CHNM 0, CHDT 0xf4:0xfb (see below for example)
- CHNM 0, CHDT 0x100:0x103
- CHNM 0, CHDT 0x17b:0x183
- CHNM for each sample, CHDT 0x11:0x27
So far, I've had pretty good results taking a .sunvox file, loading it into Python structures using radiant-voices, then writing those back out to a new .sunvox file that accurately contains the original project. I've written a comparison tool that renders the output differences, and typically they have to do with randomized velocity or notes.
However, I've run into an issue with the Sampler where there are certain parts of the file format that I can't figure out how to manipulate using SunVox itself.
Here is an example, taken from the "Violoncello" sampler module in the song "Boba77 - A nos Amachi.sunvox" which was included in the 2015.10 compo. The project properties indicate it was based on SunVox 1.9.0.5.
This is from the CHDT block of CHNM 0, the global settings and maps for the Sampler module. The top line is from the original file (violin-orig.sunvox), the bottom line is from the rewritten file (violin-rv.sunvox).
Code: Select all
000000F0: FF 00 80 00 40 F3 80 08 00 00 00 00 50 4D 41 53 ....@.......PMAS
^^ ^^
000000F0: FF 00 80 00 40 00 80 00 00 00 00 00 50 4D 41 53 ....@.......PMAS
However obviously these do something in SunVox, because not writing out the correct values causes the pitch of the sample to drift downward by a large amount. Again this is despite no visible changes in the SunVox UI as far as relative note, fine tune, etc. either in the sampler's editor, or the generic module parameters editor.
When I hex edit the 0xf3 and 0x08 back in, but make no other changes (see violin-fixed.sunvox) then it sounds correct.
For now I'm going to read those values in to some "unknown" values so that they can be written back out correctly, but of course I'd love to have proper naming, and to know which are bytes/shorts/longs, etc.
I appreciate any assistance you can provide. We're getting close to having complete support for creating and manipulating SunVox modules using Python code!