Deluge Firmware
Loading...
Searching...
No Matches
soundeditor.h
Go to the documentation of this file.
1/*
2 * Copyright © 2014-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#ifndef SOUNDEDITOR_H
19#define SOUNDEDITOR_H
20
21#include "UI.h"
22#include "MenuItem.h"
23#include "Arpeggiator.h"
24
25#define SHORTCUTS_VERSION_1 0
26#define SHORTCUTS_VERSION_3 1
27#define NUM_SHORTCUTS_VERSIONS 2
28
29extern void enterEditor();
31
32class Drum;
33class Sound;
34class Source;
36class InstrumentClip;
37class Compressor;
38class Arpeggiator;
40class Clip;
41class SampleHolder;
42class SampleControls;
45class AudioFileHolder;
46class MIDIDevice;
47
48class SoundEditor final : public UI
49{
50public:
52 bool opened();
53 void focusRegained();
54 bool getGreyoutRowsAndCols(uint32_t* cols, uint32_t* rows);
68
69 int buttonAction(int x, int y, bool on, bool inCardRoutine);
70 int padAction(int x, int y, int velocity);
71 int verticalEncoderAction(int offset, bool inCardRoutine);
72 void modEncoderAction(int whichModEncoder, int offset);
73 int horizontalEncoderAction(int offset);
74 bool editingKit();
75
76 void setupShortcutBlink(int x, int y, int frequency);
77
78 int32_t currentValue;
80
89
91
95
97
99
101
103
104 bool midiCCReceived(MIDIDevice* fromDevice, uint8_t channel, uint8_t ccNumber, uint8_t value);
105 bool pitchBendReceived(MIDIDevice* fromDevice, uint8_t channel, uint8_t data1, uint8_t data2);
106 void selectEncoderAction(int8_t offset);
107 bool canSeeViewUnderneath() { return true; }
108 bool setup(Clip* clip = NULL, const MenuItem* item = NULL, int sourceIndex = 0);
109 void blinkShortcut();
110 int potentialShortcutPadAction(int x, int y, bool on);
113 bool inSettingsMenu();
114 void exitCompletely();
115 void goUpOneLevel();
116 bool noteOnReceivedForMidiLearn(MIDIDevice* fromDevice, int channel, int note, int velocity);
118 bool editingCVOrMIDIClip();
119 bool isUntransposedNoteWithinRange(int noteCode);
120 void setCurrentMultiRange(int i);
122 int checkPermissionToBeginSessionForRangeSpecificParam(Sound* sound, int whichThing, bool automaticallySelectIfOnlyOne, MultiRange** previouslySelectedRange);
123 void setupExclusiveShortcutBlink(int x, int y);
124 void setShortcutsVersion(int newVersion);
126
127 void cutSound();
130
131
132#if HAVE_OLED
133 void renderOLED(uint8_t image[][OLED_MAIN_WIDTH_PIXELS]);
134#endif
135
136private:
137
138 bool beginScreen(MenuItem* oldMenuItem = NULL);
139 uint8_t getActualParamFromScreen(uint8_t screen);
140 void setLedStates();
141
142};
143
145
146#endif // SOUNDEDITOR_H
Definition: Arpeggiator.h:111
Definition: Arpeggiator.h:28
Definition: AudioFileHolder.h:31
Definition: Clip.h:41
Definition: compressor.h:26
Definition: drum.h:45
Definition: InstrumentClip.h:54
Definition: MIDIDevice.h:74
Definition: MenuItem.h:34
Definition: ModControllableAudio.h:46
Definition: ModelStack.h:243
Definition: MultiRange.h:25
Definition: MultisampleRange.h:30
Definition: ParamManager.h:166
Definition: SampleControls.h:23
Definition: SampleHolder.h:32
Definition: soundeditor.h:49
Compressor * currentCompressor
Definition: soundeditor.h:60
int checkPermissionToBeginSessionForRangeSpecificParam(Sound *sound, int whichThing, bool automaticallySelectIfOnlyOne, MultiRange **previouslySelectedRange)
Definition: soundeditor.cpp:3811
uint8_t paramShortcutBlinkFrequency
Definition: soundeditor.h:85
uint8_t sourceShortcutBlinkColours[2][displayHeight]
Definition: soundeditor.h:87
uint8_t navigationDepth
Definition: soundeditor.h:81
MIDIDevice * currentMIDIDevice
Definition: soundeditor.h:66
uint8_t shortcutsVersion
Definition: soundeditor.h:96
uint32_t shortcutBlinkCounter
Definition: soundeditor.h:88
int32_t currentValue
Definition: soundeditor.h:78
uint8_t editingRangeEdge
Definition: soundeditor.h:67
void blinkShortcut()
Definition: soundeditor.cpp:3267
bool setup(Clip *clip=NULL, const MenuItem *item=NULL, int sourceIndex=0)
Definition: soundeditor.cpp:3624
uint32_t timeLastAttemptedAutomatedParamEdit
Definition: soundeditor.h:90
ModControllableAudio * currentModControllable
Definition: soundeditor.h:56
MenuItem * menuItemNavigationRecord[16]
Definition: soundeditor.h:98
bool isUntransposedNoteWithinRange(int noteCode)
Definition: soundeditor.cpp:3800
MultiRange * currentMultiRange
Definition: soundeditor.h:62
void exitCompletely()
Definition: soundeditor.cpp:3082
bool editingKit()
Definition: soundeditor.cpp:2848
void modEncoderAction(int whichModEncoder, int offset)
Definition: soundeditor.cpp:3598
MenuItem ** currentSubmenuItem
Definition: soundeditor.h:100
void goUpOneLevel()
Definition: soundeditor.cpp:3066
AudioFileHolder * getCurrentAudioFileHolder()
Definition: soundeditor.cpp:3841
int8_t numberEditPos
Definition: soundeditor.h:94
bool editingReverbCompressor()
Definition: soundeditor.cpp:3304
int verticalEncoderAction(int offset, bool inCardRoutine)
Definition: soundeditor.cpp:3566
ModelStackWithThreeMainThings * getCurrentModelStack(void *memory)
Definition: soundeditor.cpp:3851
void mpeZonesPotentiallyUpdated()
Definition: soundeditor.cpp:3865
uint32_t numberEditSize
Definition: soundeditor.h:93
void setShortcutsVersion(int newVersion)
Definition: soundeditor.cpp:1769
uint8_t currentParamShorcutY
Definition: soundeditor.h:84
MenuItem * getCurrentMenuItem()
Definition: soundeditor.cpp:3791
void setupShortcutBlink(int x, int y, int frequency)
Definition: soundeditor.cpp:3250
uint8_t patchingParamSelected
Definition: soundeditor.h:82
uint8_t * currentPriority
Definition: soundeditor.h:64
Source * currentSource
Definition: soundeditor.h:58
SampleControls * currentSampleControls
Definition: soundeditor.h:63
bool shouldGoUpOneLevelOnBegin
Definition: soundeditor.h:102
void setupExclusiveShortcutBlink(int x, int y)
Definition: soundeditor.cpp:3260
int16_t currentMultiRangeIndex
Definition: soundeditor.h:65
ParamManagerForTimeline * currentParamManager
Definition: soundeditor.h:59
bool canSeeViewUnderneath()
Definition: soundeditor.h:107
int menuCurrentScroll
Definition: soundeditor.h:79
uint8_t currentParamShorcutX
Definition: soundeditor.h:83
void possibleChangeToCurrentRangeDisplay()
Definition: soundeditor.cpp:3245
bool editingCVOrMIDIClip()
Definition: soundeditor.cpp:2852
bool opened()
Definition: soundeditor.cpp:2869
int padAction(int x, int y, int velocity)
Definition: soundeditor.cpp:3518
bool pitchBendReceived(MIDIDevice *fromDevice, uint8_t channel, uint8_t data1, uint8_t data2)
Definition: soundeditor.cpp:3587
Sound * currentSound
Definition: soundeditor.h:55
ArpeggiatorSettings * currentArpSettings
Definition: soundeditor.h:61
SoundEditor()
Definition: soundeditor.cpp:2327
void focusRegained()
Definition: soundeditor.cpp:2879
int8_t numberScrollAmount
Definition: soundeditor.h:92
void selectEncoderAction(int8_t offset)
Definition: soundeditor.cpp:3319
int buttonAction(int x, int y, bool on, bool inCardRoutine)
Definition: soundeditor.cpp:2915
void setCurrentMultiRange(int i)
Definition: soundeditor.cpp:3805
int horizontalEncoderAction(int offset)
Definition: soundeditor.cpp:3308
void markInstrumentAsEdited()
Definition: soundeditor.cpp:3356
bool getGreyoutRowsAndCols(uint32_t *cols, uint32_t *rows)
Definition: soundeditor.cpp:2858
bool midiCCReceived(MIDIDevice *fromDevice, uint8_t channel, uint8_t ccNumber, uint8_t value)
Definition: soundeditor.cpp:3576
int8_t currentSourceIndex
Definition: soundeditor.h:57
int potentialShortcutPadAction(int x, int y, bool on)
Definition: soundeditor.cpp:3365
void cutSound()
Definition: soundeditor.cpp:3831
bool inSettingsMenu()
Definition: soundeditor.cpp:3795
uint8_t sourceShortcutBlinkFrequencies[2][displayHeight]
Definition: soundeditor.h:86
bool noteOnReceivedForMidiLearn(MIDIDevice *fromDevice, int channel, int note, int velocity)
Definition: soundeditor.cpp:3571
Definition: sound.h:66
Definition: source.h:31
Definition: UI.h:82
#define displayHeight
Definition: definitions.h:174
#define OLED_MAIN_WIDTH_PIXELS
Definition: definitions.h:937
void enterEditor()
SoundEditor soundEditor
Definition: soundeditor.cpp:95
void enterSaveSynthPresetUI()