Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
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.sendControlChange(address, value);
19 }
20
22 constexpr static uint8_t precision() { return 7; }
23};
24
36template <uint8_t INPUT_PRECISION_BITS>
38 public:
42 void send(uint16_t value, MIDIAddress address) {
44 Control_Surface.sendControlChange(address + 0x00, (value >> 7) & 0x7F);
45 Control_Surface.sendControlChange(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
Control_Surface_ & Control_Surface
A predefined instance of the Control Surface to use in the Arduino sketches.
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
A class for serial-in/parallel-out shift registers, like the 74HC595 that are connected to the SPI bu...
Class that sends continuous MIDI control change messages with a resolution of 14 bits.
static constexpr uint8_t precision()
Get this sender's precision.
void send(uint16_t value, MIDIAddress address)
Send a 14-bit CC message to the given address.
Class that sends continuous MIDI control change messages with a resolution of 7 bits.
static constexpr uint8_t precision()
Get the resolution of the sender in bits (always returns 7).
void send(uint8_t value, MIDIAddress address)
Send a 7-bit CC message to the given address.
A type-safe utility class for saving a MIDI address consisting of a 7-bit address,...
void sendControlChange(MIDIAddress address, uint8_t value)
Send a MIDI Control Change event.