Table of Contents

Serialized Envelope Y Coordinates

The envelope Y coordinates are values between 0 and 15, with 0 → 2-6, 6 → 1 and 15 → 29. The Y coordinates can be stored in different modes. A mode once chosen is used for all stored envelopes. Bands with 0 envelope points don't have any envelopes and thus no data stored.

Encoding Modes

0: Directly encoded

All Y coordinates are encoded directly as binary numbers (4 bits, obviously)

1 (on master channel): Variable length encoding using differences between points

The first Y coordinate of each envelope is encoded using envelope y tree, the following coordinates using delta y tree, applied to the previous y value in this envelope. Difference application wraps around after 15.

1 (on slave channel): Variable length encoding using difference to master channel

The Y values for the envelopes in the slave channel are stored as variable-length-encoded differences to the Y-values of the master channel. If an envelope in the slave channel has more points than the corresponding envelope in the master channel, the missing values are assumed as 7. Difference application wraps around at 15. The slave channel should not have more envelopes than the master channel.

2 (on master channel): Variable length encoding using difference between envelopes

The first envelope is stored as in mode 1. The later envelopes are stored as variable-length-encoded differences to the previous envelope. If an envelope has more points than the previous one, the missing Y coordinates of the previous one are assumed as 7. Difference application wraps around at 15.

2 (on slave channel): Either VLC with difference between points or clone from master

For each envelope, a bit is stored indicating loading like in master/mode1 or cloning like in slave/mode3.

3 (on master channel): Base/difference encoding

One base value (stored plain binary) is used for all coordinates in all bands. Every Y coordinate is obtained by adding a second number to the base value. This second number is also stored in plain binary, but with fewer bits (but the same bit count for all Y coordinates in one channel, it might even be 0 bits for constant 0). No wraparound happens, overflow makes the data invalid.

3 (on slave channel): Clone master values

The Y values for the envelopes in the slave channel are copied from the Y-values of the master channel. If an envelope in the slave channel has more points than the corresponding envelope in the master channel, the missing values are assumed as 7. The slave channel should not have more envelopes than the master channel.

Encoding

Envelope Y Coordinates

Encoding mode 0: direct encoding

Encoding mode 1 on master channel: variable length encoding; delta between points

Encoding mode 1 on slave channel: variable length encoding; delta to master

Encoding mode 2 on master channel: variable length encoding; delta between envelopes

Encoding mode 2 on slave channel: choose master/1 or slave/3

Encoding mode 3 on master channel: base/difference