Deluge Firmware
1.3.0
Build date: 2026.11.28
Toggle main menu visibility
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
#include "gui/views/automation/editor_layout/note/velocity_fold.h"
22
23
// namespace deluge::gui::views::automation::editor_layout::note {
24
25
class
AutomationEditorLayoutNoteVelocity :
public
AutomationEditorLayoutNote {
26
public
:
27
AutomationEditorLayoutNoteVelocity() =
default
;
28
29
// edit pad action
30
void
velocityEditPadAction(
ModelStackWithNoteRow
* modelStackWithNoteRow,
NoteRow
* noteRow,
InstrumentClip
* clip,
31
int32_t x, int32_t y, int32_t velocity, int32_t effectiveLength,
SquareInfo
& squareInfo);
32
33
// folded velocity editor, toggled with affect entire
34
VelocityFold
fold;
35
36
private
:
37
void
addNoteWithNewVelocity(int32_t x, int32_t velocity, int32_t newVelocity);
38
void
adjustNoteVelocity(
ModelStackWithNoteRow
* modelStackWithNoteRow,
NoteRow
* noteRow, int32_t x, int32_t velocity,
39
int32_t newVelocity, uint8_t squareType);
40
void
setVelocity(
ModelStackWithNoteRow
* modelStackWithNoteRow,
NoteRow
* noteRow, int32_t x, int32_t newVelocity);
41
void
setVelocityRamp(
ModelStackWithNoteRow
* modelStackWithNoteRow,
NoteRow
* noteRow,
42
SquareInfo
rowSquareInfo[kDisplayWidth]);
43
44
velocity_edit::Ramp
ramp;
45
46
public
:
47
// Automation View Render Functions
48
void
renderNoteColumn
(
ModelStackWithNoteRow
* modelStackWithNoteRow,
InstrumentClip
* clip,
49
RGB
image[][kDisplayWidth + kSideBarWidth],
50
uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay, int32_t xScroll,
51
int32_t xZoom,
SquareInfo
& squareInfo);
52
53
private
:
54
void
renderNoteSquare
(
RGB
image[][kDisplayWidth + kSideBarWidth],
55
uint8_t occupancyMask[][kDisplayWidth + kSideBarWidth], int32_t xDisplay, int32_t yDisplay,
56
uint8_t squareType, int32_t value);
57
58
public
:
59
void
displayParameterValueOLED
(
deluge::hid::display::oled_canvas::Canvas
& canvas, int32_t yPos, int32_t knobPosLeft,
60
int32_t knobPosRight);
61
};
62
63
// }; // namespace deluge::gui::views::automation::editor_layout::note
64
65
// extern deluge::gui::views::automation::editor_layout::AutomationEditorLayoutNoteVelocity
66
// automationEditorLayoutNoteVelocity;
67
68
extern
AutomationEditorLayoutNoteVelocity
automationEditorLayoutNoteVelocity;
AutomationEditorLayoutNoteVelocity
Definition
velocity.h:25
AutomationEditorLayoutNoteVelocity::renderNoteColumn
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:71
AutomationEditorLayoutNoteVelocity::renderNoteSquare
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:84
AutomationEditorLayoutNoteVelocity::displayParameterValueOLED
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:116
InstrumentClip
Definition
instrument_clip.h:52
ModelStackWithNoteRow
Definition
model_stack.h:187
NoteRow
Definition
note_row.h:106
RGB
This class represents the colour format most used by the Deluge globally.
Definition
rgb.h:14
VelocityFold
Definition
velocity_fold.h:26
deluge::hid::display::oled_canvas::Canvas
Definition
canvas.h:52
velocity_edit::Ramp
Definition
velocity_edit.h:84
SquareInfo
Definition
note_row.h:61