mungewell / uno-drum-utils

Scripts for controlling the IK UNO Drum
11 stars 2 forks source link

Last byte of some encodedd samples are changed when bebuilding DFU. #3

Closed mungewell closed 3 years ago

mungewell commented 3 years ago

The format is apparently a little odd, in that each sample's block of encoded data is prefixed by 2 bytes. I have attempted to account for this allowing the structure to 'add-up', however may be wrong with my understanding....

When rebuilding the encoded sample (2x 12bit packed into 24bit/3bytes) sometime the last byte does not match the original.

For example (Factory.DFU):

00006d40  ff ff ff ff f7 1f ff f4  0f ff f0 ff fe ed ef fe  |................|
00006d40  ff ff ff 00 f7 1f ff f4  0f ff f0 ff fe ed ef fe  |................|
                   ^^

This is just before the 4th sample data...

        Container:
            unknown = 8183
 ---->      data = b'\xff\xf4\x0f\xff\xf0\xff\xfe\xed\xef\xfe\xeb\xaf\xfe\xe7o\xfe'... (truncated, total 10101)
mungewell commented 3 years ago

Found that I had the format of the packing wrong.

This didn't stop this issue, but it look like the encoder samples in Factory pack are cropped from longer set. Meaning that last byte(s) contain data from a sample after the crop point. Think that this is a non-issue.