This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
PitchBendSender.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
7 
8 template <uint8_t INPUT_PRECISION_BITS>
10  public:
11  static void send(uint16_t value, MIDICNChannelAddress address) {
12  value = increaseBitDepth<14, INPUT_PRECISION_BITS, uint16_t, uint16_t>(
13  value);
14  // ignore address byte, just use channel and cable numbers
15  MIDICNChannel channelCN = {address.getChannel(),
16  address.getCableNumber()};
17  Control_Surface.MIDI().sendPB(channelCN, value);
18  }
19 
20  constexpr static uint8_t precision() { return INPUT_PRECISION_BITS; }
21 };
22 
MIDICNChannelAddress::getCableNumber
constexpr uint8_t getCableNumber() const
Get the cable number [0, 15].
Definition: MIDICNChannelAddress.hpp:151
MIDI_Interface::sendPB
void sendPB(MIDICNChannel address, uint16_t value)
Send a MIDI Pitch Bend event.
Definition: MIDI_Interface.cpp:95
IncreaseBitDepth.hpp
Control_Surface_::MIDI
MIDI_Interface & MIDI()
Get the MIDI interface of the Control Surface.
Definition: Control_Surface_Class.cpp:55
PitchBendSender
Definition: PitchBendSender.hpp:9
Control_Surface_Class.hpp
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: NamespaceSettings.hpp:9
MIDICNChannelAddress
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
Definition: MIDICNChannelAddress.hpp:82
Control_Surface
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
Definition: Control_Surface_Class.cpp:171
PitchBendSender::send
static void send(uint16_t value, MIDICNChannelAddress address)
Definition: PitchBendSender.hpp:11
MIDICNChannel
A class for saving a MIDI channel and cable number.
Definition: MIDICNChannelAddress.hpp:19
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: NamespaceSettings.hpp:10
PitchBendSender::precision
constexpr static uint8_t precision()
Definition: PitchBendSender.hpp:20
MIDICNChannelAddress::getChannel
constexpr Channel getChannel() const
Get the channel [CHANNEL_1, CHANNEL_16].
Definition: MIDICNChannelAddress.hpp:144