Deluge Firmware 1.3.0
Build date: 2025.08.14
Loading...
Searching...
No Matches
velocity.h
1/*
2 * Copyright (c) 2023 Sean Ditny
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.h"
21
22// namespace deluge::gui::views::automation::editor_layout::note {
23
24class AutomationEditorLayoutNoteVelocity : public AutomationEditorLayoutNote {
25public:
26 AutomationEditorLayoutNoteVelocity() = default;
27
28 // edit pad action
29 void velocityEditPadAction(ModelStackWithNoteRow* modelStackWithNoteRow, NoteRow* noteRow, InstrumentClip* clip,
30 int32_t x, int32_t y, int32_t velocity, int32_t effectiveLength, SquareInfo& squareInfo);
31
32private:
33 int32_t getVelocityFromY(int32_t y);
34 int32_t getYFromVelocity(int32_t velocity);
35 void addNoteWithNewVelocity(int32_t x, int32_t velocity, int32_t newVelocity);
36 void adjustNoteVelocity(ModelStackWithNoteRow* modelStackWithNoteRow, NoteRow* noteRow, int32_t x, int32_t velocity,
37 int32_t newVelocity, uint8_t squareType);
38 void setVelocity(ModelStackWithNoteRow* modelStackWithNoteRow, NoteRow* noteRow, int32_t x, int32_t newVelocity);
39 void setVelocityRamp(ModelStackWithNoteRow* modelStackWithNoteRow, NoteRow* noteRow,
40 SquareInfo rowSquareInfo[kDisplayWidth], int32_t velocityIncrement);
41
42public:
43 // Automation View Render Functions
44 void renderNoteColumn(ModelStackWithNoteRow* modelStackWithNoteRow, InstrumentClip* clip,
45 RGB image[][kDisplayWidth + kSideBarWidth],
46 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay, int32_t xScroll,
47 int32_t xZoom, SquareInfo& squareInfo);
48
49private:
50 void renderNoteSquare(RGB image[][kDisplayWidth + kSideBarWidth],
51 uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay, int32_t yDisplay,
52 uint8_t squareType, int32_t value);
53
54public:
55 void displayParameterValueOLED(deluge::hid::display::oled_canvas::Canvas& canvas, int32_t yPos, int32_t knobPosLeft,
56 int32_t knobPosRight);
57};
58
59// }; // namespace deluge::gui::views::automation::editor_layout::note
60
61// extern deluge::gui::views::automation::editor_layout::AutomationEditorLayoutNoteVelocity
62// automationEditorLayoutNoteVelocity;
63
64extern AutomationEditorLayoutNoteVelocity automationEditorLayoutNoteVelocity;
Definition velocity.h:24
void renderNoteColumn(ModelStackWithNoteRow *modelStackWithNoteRow, InstrumentClip *clip, RGB image[][kDisplayWidth+kSideBarWidth], uint8_t occupancyMask[][kDisplayWidth+kSideBarWidth], int32_t xDisplay, int32_t xScroll, int32_t xZoom, SquareInfo &squareInfo)
render each square in each column of the note editor grid
Definition velocity.cpp:61
void renderNoteSquare(RGB image[][kDisplayWidth+kSideBarWidth], uint8_t occupancyMask[][kDisplayWidth+kSideBarWidth], int32_t xDisplay, int32_t yDisplay, uint8_t squareType, int32_t value)
render column for note parameter
Definition velocity.cpp:74
void displayParameterValueOLED(deluge::hid::display::oled_canvas::Canvas &canvas, int32_t yPos, int32_t knobPosLeft, int32_t knobPosRight)
updates OLED display to display the current velocity
Definition velocity.cpp:106
Definition instrument_clip.h:47
Definition model_stack.h:189
Definition note_row.h:98
This class represents the colour format most used by the Deluge globally.
Definition rgb.h:14
Definition note_row.h:58