Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
patch_cable.h
1/*
2 * Copyright © 2016-2023 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20#include "modulation/automation/auto_param.h"
21#include "modulation/params/param_descriptor.h"
22#include "util/fixedpoint.h"
23#include <cstdint>
24
25class Sound;
27class InstrumentClip;
28
29class PatchCable {
30public:
31 PatchCable() = default;
32 void setup(PatchSource newFrom, uint8_t newTo, int32_t newAmount);
33 bool isActive();
34 void initAmount(int32_t value);
35 void makeUnusable();
36
37 [[gnu::always_inline]] [[nodiscard]] int32_t applyRangeAdjustment(int32_t value) const {
38 int32_t small = multiply_32x32_rshift32(value, *this->rangeAdjustmentPointer);
39 return signed_saturate<32 - 5>(small) << 3; // Not sure if these limits are as wide as they could be...
40 }
41
42 PatchSource from;
43 ParamDescriptor destinationParamDescriptor;
44 AutoParam param; // Amounts have to be within +1073741824 and -1073741824
45 int32_t const* rangeAdjustmentPointer = nullptr;
46};
Definition auto_param.h:44
Definition instrument_clip.h:48
Definition param_descriptor.h:27
Definition param_manager.h:174
Definition sound.h:71