40 PatchCable() =
default;
41 void setDefaultPolarity();
42 static bool hasPolarity(PatchSource source);
43 static Polarity getDefaultPolarity(PatchSource source);
44 void setup(PatchSource newFrom, uint8_t newTo, int32_t newAmount);
46 void initAmount(int32_t value);
52 if (from == PatchSource::AFTERTOUCH) {
53 if (polarity == Polarity::UNIPOLAR) {
56 return (value - (std::numeric_limits<int32_t>::max() / 2)) * 2;
59 if (from == PatchSource::Y || polarity == Polarity::BIPOLAR) {
62 return (value / 2) + (std::numeric_limits<int32_t>::max() / 2);
64 [[gnu::always_inline]] [[nodiscard]] int32_t applyRangeAdjustment(int32_t value)
const {
65 int32_t small = multiply_32x32_rshift32(value, *this->rangeAdjustmentPointer);
66 return signed_saturate<32 - 5>(small) << 3;
69 PatchSource from{PatchSource::NONE};
70 Polarity polarity{Polarity::BIPOLAR};
71 ParamDescriptor destinationParamDescriptor;
73 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:50