| 
    Control Surface
     
   1.1.0
   MIDI Control Surface library for Arduino 
   | 
 
Mathematics helper functions. Min/max functions, functions to uniformly increase the effective bid depth, etc. More...
Functions | |
| template<size_t Bits_out, size_t Bits_in, class T_out , class T_in > | |
| T_out | AH::increaseBitDepth (T_in in) | 
Increase the bit depth of the given value from Bits_in bits wide to Bits_out bits wide, evenly distributing the error across the entire range, such that the error for each element is between -0.5 and +0.5.  More... | |
| template<class T , class U > | |
| constexpr auto | AH::min (const T &a, const U &b) -> decltype(b< a ? b :a) | 
| Return the smaller of two numbers/objects.  More... | |
| template<class T , class U > | |
| constexpr auto | AH::max (const T &a, const U &b) -> decltype(a< b ? b :a) | 
| Return the larger of two numbers/objects.  More... | |
Mathematics helper functions. Min/max functions, functions to uniformly increase the effective bid depth, etc.
| T_out AH::increaseBitDepth | ( | T_in | in | ) | 
Increase the bit depth of the given value from Bits_in bits wide to Bits_out bits wide, evenly distributing the error across the entire range, such that the error for each element is between -0.5 and +0.5. 
For example, converting 3-bit numbers to 7-bit numbers would result in the following:
| in (dec) | in (bin) | out (bin) | out (dec) | exact | error | 
|---|---|---|---|---|---|
| 0 | 000 | 000'0000 | 0 | 0.00 | +0.00 | 
| 1 | 001 | 001'0010 | 18 | 18.14 | +0.14 | 
| 2 | 010 | 010'0100 | 36 | 36.29 | +0.29 | 
| 3 | 011 | 011'0110 | 54 | 54.43 | +0.43 | 
| 4 | 100 | 100'1001 | 73 | 72.57 | -0.43 | 
| 5 | 101 | 101'1011 | 91 | 90.71 | -0.29 | 
| 6 | 110 | 110'1101 | 109 | 108.86 | -0.14 | 
| 7 | 111 | 111'1111 | 127 | 127.00 | +0.00 | 
| Bits_out | The number of bits of the output range. | 
| Bits_in | The number of bits of the input range. | 
| T_out | The type of the output (return type). | 
| T_in | The type of the input. | 
| in | The value to scale up. | 
Definition at line 68 of file IncreaseBitDepth.hpp.
      
  | 
  constexpr | 
Return the smaller of two numbers/objects.
Definition at line 15 of file MinMaxFix.hpp.
      
  | 
  constexpr | 
Return the larger of two numbers/objects.
Definition at line 22 of file MinMaxFix.hpp.
 1.8.16