Questions about Sampler CHDT chunks

Multi-platform modular music creation studio
Post Reply
User avatar
queries
Posts: 316
Joined: Tue May 10, 2016 9:51 pm

Questions about Sampler CHDT chunks

Post by queries »

NightRadio, could you fill in some blanks for me as I learn about the structure of the metadata chunks for the Sampler module?

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
See https://gist.github.com/gldnspud/dde920 ... 08bf74235a for full notes of what I've been able to discover to this point.

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
Because I could not determine where in the SunVox UI to modify these values, I have been treating them as "magic" values and writing out 0x40, 0x00, 0x80, 0x00 in positions 0xf4 through 0xf7.

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! :D
Attachments
violin.7z
(30.82 KiB) Downloaded 238 times
Post Reply