Deluge Firmware 1.3.0
Build date: 2026.11.28
Loading...
Searching...
No Matches
velocity_fold.h
1/*
2 * Copyright © 2026 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 "gui/views/automation/editor_layout/note/velocity_edit.h"
21
26class VelocityFold : public AutomationEditorLayout {
27public:
28 bool isFolded();
31
32 void render(InstrumentClip* clip, RGB image[][kDisplayWidth + kSideBarWidth],
33 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth]);
34 void padAction(InstrumentClip* clip, int32_t x, int32_t y, int32_t velocity);
35
36 bool anyPadPresses() const { return numPadPresses > 0; }
38 void adjustHeldVelocity(InstrumentClip* clip, int32_t offset);
39 void endPadPresses();
40
41private:
42 struct PadPress {
43 bool isActive;
44 int32_t xDisplay;
45 int32_t yDisplay;
46 int32_t startPos;
47 int32_t endPos;
48 };
49
50 void padRelease(int32_t x, int32_t y);
51 void setStepVelocity(InstrumentClip* clip, Action* action, int32_t x, int32_t targetVelocity);
52
53 bool foldedNonKit{false};
54 PadPress padPresses[kEditPadPressBufferSize]{};
55 int32_t numPadPresses{0};
56 velocity_edit::Ramp ramp;
57};
Definition action.h:78
Definition instrument_clip.h:52
This class represents the colour format most used by the Deluge globally.
Definition rgb.h:14
Definition velocity_fold.h:26
void render(InstrumentClip *clip, RGB image[][kDisplayWidth+kSideBarWidth], uint8_t occupancyMask[][kDisplayWidth+kSideBarWidth])
Definition velocity_fold.cpp:99
void affectEntireChanged()
call after affect entire was pressed in the note editor (and the kit's affect entire toggled)
Definition velocity_fold.cpp:83
void adjustHeldVelocity(InstrumentClip *clip, int32_t offset)
fine tune the velocity of every note on the held steps with the horizontal encoder
Definition velocity_fold.cpp:261
void setStepVelocity(InstrumentClip *clip, Action *action, int32_t x, int32_t targetVelocity)
scale every note starting on step x in every note row so the highest one becomes targetVelocity
Definition velocity_fold.cpp:178
Definition performance_view.h:33
Definition velocity_fold.h:42