Updated 29/7/2018

This structure is intended to enable you to traverse the controls structure testing/adjusting at each level on the tree.

The function is called via the new 'readAllData' function with a command block 'value' and 'type' and 'action' set appropriately - see 'Reading_Values'. It returns a float representing the wanted element.

'type' is used to determine the operation.

values (& 3) {these will not be changed}
0   return 'value' input adjusted between max and min.
1   return min
2   return max
3   return default

flags
bit 2   set defines this as a limits test
bit 3   (returns) set = error seen

bit 5   (returns) set = MIDI-learnable
bit 7   (returns) set = regard as integer

Normal byte structure is used to determine how far down the tree to go for a value.

e.g. on entry
      value  type & 3   source   command     part    {remainder all 255}
       200     0         (any)      0         240

This would return 127 - the input value adjusted to the maximum for master volume.


TODO - still not extended in 2022 :(

If an out of range setting is found part way along a command chain. 'value' should be set to the byte number where the error was encountered and 'type' bit 4 should be set, otherwise it should be cleared.

Numbers are:
1   control
2   part
3   kit
4   engine
5   insert
6   parameter
7   offset
8   miscmsg (unlikely to see an error here)

e.g
'part' was set to 70 (invalid part number)
'value' should be returned as 2

'part' set to 3 (valid) but control set to 200 (no such control at this level)
'value' should be returned as 1

Other numbers may be added later to give finer grading.
