vampirefrog wrote:
So far it seems:
- Starts at 0x176ab
- 2 bytes: sample number
- 1 byte: key min
- 1 byte: key max
- 2 bytes: pitch offset
- 1 byte: tone_attenuate
- 1 byte: reg_attack_decay1
- 1 byte: reg_release_correction
- Total: 9 bytes
I have some more information about the pitch offset.
The two bytes of the pitch offset actually have two separate meanings:
1st byte: Note number offset (range 31-109).
2nd byte: Detune offset (range 0-99). A positive pitch offset in cents.
To get the pitch offset to C-4 in semitones, use the formula 60 - n + c / 100.
The pitch offsets are for the TG100’s 9400000 Hz clock (41964 Hz sample rate).
To convert to a 9878400 Hz clock (44100 Hz sample rate), add 12 * (log2(9400000) - log2(9878400)).
vampirefrog wrote:
I've also shifted the pitch_offset value 2 bits to the right, it seems that particular structure is made from bit fields, not just bytes. The struct in the opl4 driver code was expanded to bytes cause it's easier to use that way.
Should use the unshifted value. I’ve attached a dump of the regions in JSON format.
vampirefrog wrote:
I've setup a git. Please request access if you want to add something.
https://github.com/vampirefrog/tg100The tg100smpl.bin file in the Git repository is two bytes too long. I’ve recombined the two parts and attached it, it’s exactly 2 MB now.