#include <MIDI_Senders/RelativeCCSender.hpp>
Class that sends relative/incremental MIDI control change messages.
This is often used for rotary encoders.
This requires explicit support from your DAW. You have to select relative MIDI CC mode in the MIDI learn settings.
This class supports multiple different modes, see relativeCCmode.
Definition at line 88 of file RelativeCCSender.hpp.
Static Public Member Functions | |
static uint8_t | toTwosComplement7bit (int8_t value) |
Convert an 8-bit two's complement integer to a 7-bit two's complement integer. | |
static uint8_t | toBinaryOffset7bit (int8_t value) |
Convert an 8-bit two's complement integer to a 7-bit integer with a binary offset of 64. | |
static uint8_t | toSignedMagnitude7bit (int8_t value) |
Convert an 8-bit two's complement integer to 7-bit sign-magnitude format. | |
static uint8_t | mapRelativeCC (int8_t value) |
Convert an 8-bit two's complement integer to a 7-bit value to send over MIDI. | |
static void | send (long delta, MIDIAddress address) |
Send a relative CC message. | |
static void | setMode (relativeCCmode mode) |
Set the relative CC mode that's used. | |
Static Private Attributes | |
static relativeCCmode | mode = TWOS_COMPLEMENT |
|
inlinestatic |
Convert an 8-bit two's complement integer to a 7-bit two's complement integer.
Definition at line 92 of file RelativeCCSender.hpp.
|
inlinestatic |
Convert an 8-bit two's complement integer to a 7-bit integer with a binary offset of 64.
In other words, a value of 0 corresponds to -64, a value of 64 corresponds to 0, and a value of 127 corresponds to 63.
Definition at line 96 of file RelativeCCSender.hpp.
|
inlinestatic |
Convert an 8-bit two's complement integer to 7-bit sign-magnitude format.
Definition at line 99 of file RelativeCCSender.hpp.
|
inlinestatic |
Convert an 8-bit two's complement integer to a 7-bit value to send over MIDI.
Definition at line 107 of file RelativeCCSender.hpp.
|
inlinestatic |
Send a relative CC message.
Definition at line 118 of file RelativeCCSender.hpp.
|
inlinestatic |
Set the relative CC mode that's used.
Requires the same setting on the receiving end, in your DAW, for example.
Definition at line 134 of file RelativeCCSender.hpp.
|
staticprivate |
Definition at line 137 of file RelativeCCSender.hpp.