Line data Source code
1 : #pragma once 2 : 3 : #include <Control_Surface/Control_Surface_Class.hpp> 4 : #include <Helpers/IncreaseBitDepth.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 = increaseBitDepth<14, INPUT_PRECISION_BITS, uint16_t, uint16_t>( 13 9 : value); 14 : // ignore address byte, just use channel and cable numbers 15 18 : MIDICNChannel channelCN = {address.getChannel(), 16 9 : address.getCableNumber()}; 17 9 : Control_Surface.MIDI().sendPB(channelCN, value); 18 9 : } 19 : 20 : constexpr static uint8_t precision() { return INPUT_PRECISION_BITS; } 21 : }; 22 : 23 : END_CS_NAMESPACE