Control Surface  1.2.0
MIDI Control Surface library for Arduino
ContinuousCCSender.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
7 
15  public:
17  void send(uint8_t value, MIDIAddress address) {
18  Control_Surface.sendCC(address, value);
19  }
20 
22  constexpr static uint8_t precision() { return 7; }
23 };
24 
36 template <uint8_t INPUT_PRECISION_BITS>
38  public:
42  void send(uint16_t value, MIDIAddress address) {
43  value = AH::increaseBitDepth<14, precision(), uint16_t>(value);
44  Control_Surface.sendCC(address + 0x00, (value >> 7) & 0x7f);
45  Control_Surface.sendCC(address + 0x20, (value >> 0) & 0x7F);
46  }
47 
49  constexpr static uint8_t precision() {
50  static_assert(INPUT_PRECISION_BITS <= 14,
51  "Maximum resolution is 14 bits");
52  return INPUT_PRECISION_BITS;
53  }
54 };
55 
MIDIAddress
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
Definition: MIDIAddress.hpp:91
ContinuousCCSender::precision
constexpr static uint8_t precision()
Get the resolution of the sender in bits (always returns 7).
Definition: ContinuousCCSender.hpp:22
ContinuousCCSender::send
void send(uint8_t value, MIDIAddress address)
Send a 7-bit CC message to the given address.
Definition: ContinuousCCSender.hpp:17
ContinuousCCSender14::precision
constexpr static uint8_t precision()
Get this sender's precision.
Definition: ContinuousCCSender.hpp:49
IncreaseBitDepth.hpp
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:9
ContinuousCCSender14::send
void send(uint16_t value, MIDIAddress address)
Send a 14-bit CC message to the given address.
Definition: ContinuousCCSender.hpp:42
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:10
Control_Surface_Class.hpp
Control_Surface
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
Definition: Control_Surface_Class.cpp:203
ContinuousCCSender14
Class that sends continuous MIDI control change messages with a resolution of 14 bits.
Definition: ContinuousCCSender.hpp:37
MIDI_Sender::sendCC
void sendCC(MIDIAddress address, uint8_t value)
Send a MIDI Control Change event.
Definition: MIDI_Interface.ipp:67
ContinuousCCSender
Class that sends continuous MIDI control change messages with a resolution of 7 bits.
Definition: ContinuousCCSender.hpp:14