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 adusted to the maximium for master volume.


TODO

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 2 will be set (otherwise it will be cleared.

Numbers are:
1   Control
2   Part
3   Kit
4   Engine
5   Insert
6   Parameter
7   Par2

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.
