38 PatchCable() =
default;
39 void setup(PatchSource newFrom, uint8_t newTo, int32_t newAmount);
41 void initAmount(int32_t value);
47 if (from == PatchSource::AFTERTOUCH) {
48 if (polarity == Polarity::UNIPOLAR) {
51 return (value - (std::numeric_limits<int32_t>::max() / 2)) * 2;
54 if (from == PatchSource::Y || polarity == Polarity::BIPOLAR) {
57 return (value / 2) + (std::numeric_limits<int32_t>::max() / 2);
59 [[gnu::always_inline]] [[nodiscard]] int32_t applyRangeAdjustment(int32_t value)
const {
60 int32_t small = multiply_32x32_rshift32(value, *this->rangeAdjustmentPointer);
61 return signed_saturate<32 - 5>(small) << 3;
64 PatchSource from{PatchSource::NONE};
65 Polarity polarity{Polarity::BIPOLAR};
66 ParamDescriptor destinationParamDescriptor;
68 int32_t
const* rangeAdjustmentPointer =
nullptr;
int32_t toPolarity(int32_t value)
Converts a patch cable source to the correct polarity. The source is required because some sources ar...
Definition patch_cable.h:45