Roland U-220 SysEx, memory addressing [solved]

Forum for D-50/550 and other D and U synthesizers from 1980-1990's
Post Reply
hugo_nl
Posts: 1
Joined: 09:16, 9 July 2020

Roland U-220 SysEx, memory addressing [solved]

Post by hugo_nl »

Good day.

I am working on a tool to easily export, import and manipulate settings on the U-220 unit. However, while trying to decode the Timbre and Patch settings, I think I have ran into some vagueness in the owner's manual regarding the SysEx message format and the addressing scheme that is used.

Either my interpretation, or the owner's manual is flawed. Over the recent days I have been searching long and hard to find any clues, but to no avail, and I'm hoping that some people in here may know the answer.

Some more background first.

To develop my tool, I have made a Bulk Dump of the actual device to a file. My tool then decodes the SysEx messages in that file into an internal memory buffer to reconstruct it, and then I decode from that memory area.

This works fine for the "Setup Parameter" area at the start, but not so great for other things.

For example, the Timbre area. The owner's manual describes this in the "Bulk Dump Area" contents. The Timbre area has a starting address of "0x02 00 00", that it is 0x4000 bytes long, and that it ends at "0x02 3F 7F".

Every individual Timbre setting itself is 0x20 bytes long. This would imply that I should find them the following offsets:
- 0x02 00 00
- 0x02 00 20
- 0x02 00 40
- 0x02 00 60
- ... and so on

However -- they do not. I find them at "0x02 00 00", "0x02 00 20" and then continues at "0x02 01 00", "0x02 01 20" and so on.

Similarly, the Patch area at "0x03 00 00" to "0x03 4F 7F", with individual Patch sizes of 0x50 bytes, I find at "0x03 00 00", "0x03 01 10", "0x03 02 20" and so on.

If I peak in the raw .SYX file, this does seem to make sense, as I see the DS1 messages that all have a payload size of 128 bytes. These 128 MIDI bytes decode to an actual buffer of 64 bytes actual data (0x40 bytes in hex).

This all seems to suggest that the addressing points to blocks of 64 bytes. That would all make sense.

But then, in the manual, the ending address of the Timbre area is what throws me off: it mentions "0x02 3F 7F" but that could then not at all be a valid address. Also, the 0x4000 bytes length seems incorrect -- there would be only (128 timbres at 64 bytes per timbre = 8192, which is 0x2000 bytes) in that area.

Does the addressing scheme that is used actually point to blocks of 64 bytes and not 128, and I should not let the 0x7F in the manual confuse me? Or am I doing something wrong?

Please note that English is not my main language, so I hope this all makes sense. :)

Thanks in advance for any replies!

Edited to add: After some more consideration, and importantly, having looked at the U-220 factory reset SysEx files I could find on the net (which also send 128 nibbles / 64 bytes and never address anything above an offset of 0x00), I have come to the conclusion that my interpretation must be correct and that these parameter values *are* mapped to blocks of 64 bytes.
ChrisWalloth
Posts: 1
Joined: 23:13, 30 April 2023

Re: Roland U-220 SysEx, memory addressing [solved]

Post by ChrisWalloth »

The situation is pretty complicated, but the manual is correct.

- the addresses are correct, considering that each MIDI Data Byte only encodes up to 128 values (MSB = 0 to indicate it's a Data Byte vs MSB = 1 for Status Bytes, cf. the MIDI specification); hence considering the U-220 patch is encoded as 160 MIDI data bytes (7-bit useable), an increment of 01 20H is correct.

- confusingly, the 160 data bytes are being addressed in pairs, i.e., there are only 80 address locations (as documented in " [Table 2] Patch Temporary " : 00H ... 24H (last address of Part1) + 6 Parts -> Part 6 starts at 46H and the last address is 4DH; add 4EH and 4FH to round up to 80 addresses); 80 equals the "Total size = 50H" as correctly written in the manual. For all 64 patches, the size is 64 patches * 80 addresses/patch = 5.120 addresses = 14 00H addresses, as written in the manual under [Table 6].
(n.b.: 80 addresses equal 80 bytes of 8-bit data which are sufficient to encode all the information of a patch in the U-220.)

- further confusingly, the "Size of Exclusive Memory Map" as provided in the [Bulk Dump Area] table in the manual is apparently the size of 4-bit nibbles (I have no other explanation), i.e., if hex-notation is used, one can imagine that each hex number is located in one "Exclusive Memory" location. So from 80 useful 8-bit Bytes (MSB LSB) encoding a Patch in U-220's memory, 160 bytes of MIDI Data are produced (80 pairs of 0000 LSB or 0000 MSB, respectively), which are made up of 320 data nibbles (80 quadrupels of 0000 LSB 0000 MSB). Hence the twice as large size of the Exclusive Memory Map as compared to the 160 data bytes (64 patches * 80 bytes/patch * 4 nibbles/byte = 20.480 nibbles = 00 50 00H nibbles – also this figure in the manual is correct). The address range provided in the manual is also correct (03 00 00 ... 4F 7F), with the address 4F 7F being the last address of Patch 64 (to calculate the address, one takes the integer of (PatchID-1)*160/128 for the first address byte, and the result of (PatchID-1)*160%128 (% = modulo) for the second address byte (as done for the edisyn patch editor: search for the modulo sign (%) in the source code, towards the end: https://github.com/eclab/edisyn/blob/ma ... Multi.java); for the last address of Patch 64 (i.e., patch 65 - 1 address) this would be INT((160*(65-1) - 1) / 128 ) = 79 = 4FH and ... % 128 = 127 = 7F).

Hope that helps.
Post Reply