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' 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   error (cleared on entry)
bit 3   set = from midi \
bit 4   set = from cli   >  these three are exclusive.
bit 5   set = from gui  /
bit 6   (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.
      value  type & 3   command    part
       200     0          0         240 {remainder all 255}

This would return 127 - the input value adusted to the maximium for master volume.

       any     3         255         0 {remainder all 255}

Min, max & default can be tested from the CLI as follows:

direct limit min 0 0:
  returns the minimum volume for parts

direct limit def 2 0 0 128
  retruns the default panning for parts addsyth voice

TODO

If an out of range setting is found part way along a command chain. 'value' will 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' will be returned as 2

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

Other numbers may be added later to give finer grading.
