Line data Source code
1 : #pragma once 2 : 3 : #include <AH/Math/IncreaseBitDepth.hpp> 4 : #include <Control_Surface/Control_Surface_Class.hpp> 5 : 6 : BEGIN_CS_NAMESPACE 7 : 8 : template <uint8_t INPUT_PRECISION_BITS> 9 : class PitchBendSender { 10 : public: 11 9 : static void send(uint16_t value, MIDICNChannelAddress address) { 12 9 : value = 13 9 : AH::increaseBitDepth<14, INPUT_PRECISION_BITS, uint16_t, uint16_t>( 14 9 : value); 15 : // ignore address byte, just use channel and cable numbers 16 18 : MIDICNChannel channelCN = {address.getChannel(), 17 9 : address.getCableNumber()}; 18 9 : Control_Surface.MIDI().sendPB(channelCN, value); 19 9 : } 20 : 21 : constexpr static uint8_t precision() { return INPUT_PRECISION_BITS; } 22 : }; 23 : 24 : END_CS_NAMESPACE