Skip to content

Commit

Permalink
envelopes 3 & 4
Browse files Browse the repository at this point in the history
- pressing any of the envelope 1 or 2 segments while the same
  segment is already active opens the corresponding env 3 or 4
  segment
  • Loading branch information
nikodemus committed Jan 5, 2025
1 parent 03041c1 commit 33679ce
Show file tree
Hide file tree
Showing 16 changed files with 165 additions and 36 deletions.
4 changes: 3 additions & 1 deletion src/definitions_cxx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ constexpr int32_t kFlangerMinTime = (3 << 16);
constexpr int32_t kFlangerAmplitude = (kModFXMaxDelay - kFlangerMinTime);
constexpr int32_t kFlangerOffset = ((kModFXMaxDelay + kFlangerMinTime) >> 1);

constexpr int32_t kNumEnvelopes = 2;
constexpr int32_t kNumEnvelopes = 4;
constexpr int32_t kNumLFOs = 2;
constexpr int32_t kNumModulators = 2;

Expand Down Expand Up @@ -307,6 +307,8 @@ enum class PatchSource : uint8_t {
SIDECHAIN,
ENVELOPE_0,
ENVELOPE_1,
ENVELOPE_2,
ENVELOPE_3,
LFO_LOCAL,
X,
Y,
Expand Down
14 changes: 14 additions & 0 deletions src/deluge/gui/l10n/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"STRING_FOR_PATCH_SOURCE_LFO_LOCAL": "LFO2",
"STRING_FOR_PATCH_SOURCE_ENVELOPE_0": "Envelope 1",
"STRING_FOR_PATCH_SOURCE_ENVELOPE_1": "Envelope 2",
"STRING_FOR_PATCH_SOURCE_ENVELOPE_2": "Envelope 3",
"STRING_FOR_PATCH_SOURCE_ENVELOPE_3": "Envelope 4",
"STRING_FOR_PATCH_SOURCE_VELOCITY": "Velocity",
"STRING_FOR_PATCH_SOURCE_NOTE": "Note",
"STRING_FOR_PATCH_SOURCE_SIDECHAIN": "Sidechain",
Expand Down Expand Up @@ -91,6 +93,16 @@
"STRING_FOR_PARAM_LOCAL_ENV_1_SUSTAIN": "Env2 sustain",
"STRING_FOR_PARAM_LOCAL_ENV_1_RELEASE": "Env2 release",

"STRING_FOR_PARAM_LOCAL_ENV_2_ATTACK": "Env3 attack",
"STRING_FOR_PARAM_LOCAL_ENV_2_DECAY": "Env3 decay",
"STRING_FOR_PARAM_LOCAL_ENV_2_SUSTAIN": "Env3 sustain",
"STRING_FOR_PARAM_LOCAL_ENV_2_RELEASE": "Env3 release",

"STRING_FOR_PARAM_LOCAL_ENV_3_ATTACK": "Env4 attack",
"STRING_FOR_PARAM_LOCAL_ENV_3_DECAY": "Env4 decay",
"STRING_FOR_PARAM_LOCAL_ENV_3_SUSTAIN": "Env4 sustain",
"STRING_FOR_PARAM_LOCAL_ENV_3_RELEASE": "Env4 release",

"STRING_FOR_PARAM_GLOBAL_LFO_FREQ": "LFO1 rate",
"STRING_FOR_PARAM_LOCAL_LFO_LOCAL_FREQ": "LFO2 rate",

Expand Down Expand Up @@ -393,6 +405,8 @@
"STRING_FOR_DEV_MENU_G": "Dev Menu G",
"STRING_FOR_ENVELOPE_1": "Envelope 1",
"STRING_FOR_ENVELOPE_2": "Envelope 2",
"STRING_FOR_ENVELOPE_3": "Envelope 3",
"STRING_FOR_ENVELOPE_4": "Envelope 4",
"STRING_FOR_VOLUME_LEVEL": "Volume",
"STRING_FOR_AMOUNT_LEVEL": "Level",
"STRING_FOR_REPEAT_MODE": "Repeat mode",
Expand Down
12 changes: 12 additions & 0 deletions src/deluge/gui/l10n/g_english.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ PLACE_SDRAM_DATA Language english{
{STRING_FOR_PATCH_SOURCE_LFO_LOCAL, "LFO2"},
{STRING_FOR_PATCH_SOURCE_ENVELOPE_0, "Envelope 1"},
{STRING_FOR_PATCH_SOURCE_ENVELOPE_1, "Envelope 2"},
{STRING_FOR_PATCH_SOURCE_ENVELOPE_2, "Envelope 3"},
{STRING_FOR_PATCH_SOURCE_ENVELOPE_3, "Envelope 4"},
{STRING_FOR_PATCH_SOURCE_VELOCITY, "Velocity"},
{STRING_FOR_PATCH_SOURCE_NOTE, "Note"},
{STRING_FOR_PATCH_SOURCE_SIDECHAIN, "Sidechain"},
Expand Down Expand Up @@ -89,6 +91,14 @@ PLACE_SDRAM_DATA Language english{
{STRING_FOR_PARAM_LOCAL_ENV_1_DECAY, "Env2 decay"},
{STRING_FOR_PARAM_LOCAL_ENV_1_SUSTAIN, "Env2 sustain"},
{STRING_FOR_PARAM_LOCAL_ENV_1_RELEASE, "Env2 release"},
{STRING_FOR_PARAM_LOCAL_ENV_2_ATTACK, "Env3 attack"},
{STRING_FOR_PARAM_LOCAL_ENV_2_DECAY, "Env3 decay"},
{STRING_FOR_PARAM_LOCAL_ENV_2_SUSTAIN, "Env3 sustain"},
{STRING_FOR_PARAM_LOCAL_ENV_2_RELEASE, "Env3 release"},
{STRING_FOR_PARAM_LOCAL_ENV_3_ATTACK, "Env4 attack"},
{STRING_FOR_PARAM_LOCAL_ENV_3_DECAY, "Env4 decay"},
{STRING_FOR_PARAM_LOCAL_ENV_3_SUSTAIN, "Env4 sustain"},
{STRING_FOR_PARAM_LOCAL_ENV_3_RELEASE, "Env4 release"},
{STRING_FOR_PARAM_GLOBAL_LFO_FREQ, "LFO1 rate"},
{STRING_FOR_PARAM_LOCAL_LFO_LOCAL_FREQ, "LFO2 rate"},
{STRING_FOR_PARAM_GLOBAL_MOD_FX_DEPTH, "Mod-FX depth"},
Expand Down Expand Up @@ -352,6 +362,8 @@ PLACE_SDRAM_DATA Language english{
{STRING_FOR_DEV_MENU_G, "Dev Menu G"},
{STRING_FOR_ENVELOPE_1, "Envelope 1"},
{STRING_FOR_ENVELOPE_2, "Envelope 2"},
{STRING_FOR_ENVELOPE_3, "Envelope 3"},
{STRING_FOR_ENVELOPE_4, "Envelope 4"},
{STRING_FOR_VOLUME_LEVEL, "Volume"},
{STRING_FOR_AMOUNT_LEVEL, "Level"},
{STRING_FOR_REPEAT_MODE, "Repeat mode"},
Expand Down
2 changes: 2 additions & 0 deletions src/deluge/gui/l10n/g_seven_segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ PLACE_SDRAM_DATA Language seven_segment{
{STRING_FOR_PATCH_SOURCE_LFO_LOCAL, "LFO2"},
{STRING_FOR_PATCH_SOURCE_ENVELOPE_0, "ENV1"},
{STRING_FOR_PATCH_SOURCE_ENVELOPE_1, "ENV2"},
{STRING_FOR_PATCH_SOURCE_ENVELOPE_2, "ENV3"},
{STRING_FOR_PATCH_SOURCE_ENVELOPE_3, "ENV4"},
{STRING_FOR_PATCH_SOURCE_VELOCITY, "VELOCITY"},
{STRING_FOR_PATCH_SOURCE_NOTE, "NOTE"},
{STRING_FOR_PATCH_SOURCE_SIDECHAIN, "SIDE"},
Expand Down
2 changes: 2 additions & 0 deletions src/deluge/gui/l10n/seven_segment.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
"STRING_FOR_PATCH_SOURCE_LFO_LOCAL": "LFO2",
"STRING_FOR_PATCH_SOURCE_ENVELOPE_0": "ENV1",
"STRING_FOR_PATCH_SOURCE_ENVELOPE_1": "ENV2",
"STRING_FOR_PATCH_SOURCE_ENVELOPE_2": "ENV3",
"STRING_FOR_PATCH_SOURCE_ENVELOPE_3": "ENV4",
"STRING_FOR_PATCH_SOURCE_VELOCITY": "VELOCITY",
"STRING_FOR_PATCH_SOURCE_NOTE": "NOTE",
"STRING_FOR_PATCH_SOURCE_SIDECHAIN": "SIDE",
Expand Down
12 changes: 12 additions & 0 deletions src/deluge/gui/l10n/strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ enum class String : size_t {
STRING_FOR_PATCH_SOURCE_LFO_LOCAL,
STRING_FOR_PATCH_SOURCE_ENVELOPE_0,
STRING_FOR_PATCH_SOURCE_ENVELOPE_1,
STRING_FOR_PATCH_SOURCE_ENVELOPE_2,
STRING_FOR_PATCH_SOURCE_ENVELOPE_3,
STRING_FOR_PATCH_SOURCE_VELOCITY,
STRING_FOR_PATCH_SOURCE_NOTE,
STRING_FOR_PATCH_SOURCE_SIDECHAIN,
Expand Down Expand Up @@ -78,6 +80,14 @@ enum class String : size_t {
STRING_FOR_PARAM_LOCAL_ENV_1_DECAY,
STRING_FOR_PARAM_LOCAL_ENV_1_SUSTAIN,
STRING_FOR_PARAM_LOCAL_ENV_1_RELEASE,
STRING_FOR_PARAM_LOCAL_ENV_2_ATTACK,
STRING_FOR_PARAM_LOCAL_ENV_2_DECAY,
STRING_FOR_PARAM_LOCAL_ENV_2_SUSTAIN,
STRING_FOR_PARAM_LOCAL_ENV_2_RELEASE,
STRING_FOR_PARAM_LOCAL_ENV_3_ATTACK,
STRING_FOR_PARAM_LOCAL_ENV_3_DECAY,
STRING_FOR_PARAM_LOCAL_ENV_3_SUSTAIN,
STRING_FOR_PARAM_LOCAL_ENV_3_RELEASE,
STRING_FOR_PARAM_GLOBAL_LFO_FREQ,
STRING_FOR_PARAM_GLOBAL_VOLUME_POST_FX,
STRING_FOR_PARAM_GLOBAL_VOLUME_POST_REVERB_SEND,
Expand Down Expand Up @@ -375,6 +385,8 @@ enum class String : size_t {
STRING_FOR_DEV_MENU_G,
STRING_FOR_ENVELOPE_1,
STRING_FOR_ENVELOPE_2,
STRING_FOR_ENVELOPE_3,
STRING_FOR_ENVELOPE_4,
STRING_FOR_VOLUME_LEVEL,
STRING_FOR_AMOUNT_LEVEL,
STRING_FOR_REPEAT_MODE,
Expand Down
2 changes: 1 addition & 1 deletion src/deluge/gui/menu_item/generate/dmenus/envelopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@
[attack, decay, sustain, release],
name=f"STRING_FOR_ENVELOPE_{i+1}",
)
for i in range(2)
for i in range(4)
]
2 changes: 2 additions & 0 deletions src/deluge/gui/menu_item/generate/g_menus.inc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ std::array<MenuItem*, 4> child5 = {
};
submenu::Envelope env0Menu{STRING_FOR_ENVELOPE_1, child5, 0};
submenu::Envelope env1Menu{STRING_FOR_ENVELOPE_2, child5, 1};
submenu::Envelope env2Menu{STRING_FOR_ENVELOPE_3, child5, 2};
submenu::Envelope env3Menu{STRING_FOR_ENVELOPE_4, child5, 3};
osc::Type oscTypeMenu{STRING_FOR_TYPE, STRING_FOR_OSC_TYPE_MENU_TITLE};
osc::source::Volume sourceVolumeMenu{STRING_FOR_VOLUME_LEVEL, STRING_FOR_OSC_LEVEL_MENU_TITLE, params::LOCAL_OSC_A_VOLUME};
osc::source::WaveIndex sourceWaveIndexMenu{STRING_FOR_WAVE_INDEX, STRING_FOR_OSC_WAVE_IND_MENU_TITLE, params::LOCAL_OSC_A_WAVE_INDEX};
Expand Down
15 changes: 12 additions & 3 deletions src/deluge/gui/menu_item/source_selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@

namespace deluge::gui::menu_item {
const PatchSource sourceMenuContents[] = {
PatchSource::ENVELOPE_0, PatchSource::ENVELOPE_1, PatchSource::LFO_GLOBAL, PatchSource::LFO_LOCAL,
PatchSource::VELOCITY, PatchSource::NOTE, PatchSource::SIDECHAIN, PatchSource::RANDOM,
PatchSource::X, PatchSource::Y, PatchSource::AFTERTOUCH,
PatchSource::ENVELOPE_0, PatchSource::ENVELOPE_1, PatchSource::ENVELOPE_2, PatchSource::ENVELOPE_3,
PatchSource::LFO_GLOBAL, PatchSource::LFO_LOCAL, PatchSource::VELOCITY, PatchSource::NOTE,
PatchSource::SIDECHAIN, PatchSource::RANDOM, PatchSource::X, PatchSource::Y,
PatchSource::AFTERTOUCH,
};

uint8_t SourceSelection::shouldDrawDotOnValue() {
Expand Down Expand Up @@ -96,6 +97,14 @@ void SourceSelection::drawValue() {
text = STRING_FOR_PATCH_SOURCE_ENVELOPE_1;
break;

case PatchSource::ENVELOPE_2:
text = STRING_FOR_PATCH_SOURCE_ENVELOPE_2;
break;

case PatchSource::ENVELOPE_3:
text = STRING_FOR_PATCH_SOURCE_ENVELOPE_3;
break;

case PatchSource::SIDECHAIN:
text = STRING_FOR_PATCH_SOURCE_SIDECHAIN;
break;
Expand Down
28 changes: 20 additions & 8 deletions src/deluge/gui/ui/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,8 @@ menu_item::Submenu soundEditorRootMenu{
&modulator1Menu,
&env0Menu,
&env1Menu,
&env2Menu,
&env3Menu,
&lfo1Menu,
&lfo2Menu,
&voiceMenu,
Expand All @@ -1289,6 +1291,16 @@ menu_item::Submenu soundEditorRootMenu{
},
};

LayeredShortcut envMenuA{{&env0Menu, &env2Menu}};
LayeredShortcut envMenuB{{&env1Menu, &env3Menu}};

// These look funny since they contain the same item twice, but they work through the virtue of
// patchIndex, the same way vanilla envelope menus work.
LayeredShortcut envReleaseMenus{{&envReleaseMenu, &envReleaseMenu}};
LayeredShortcut envSustainMenus{{&envSustainMenu, &envSustainMenu}};
LayeredShortcut envDecayMenus{{&envDecayMenu, &envDecayMenu}};
LayeredShortcut envAttackMenus{{&envAttackMenu, &envAttackMenu}};

menu_item::note::IteranceDivisor noteCustomIteranceDivisor{STRING_FOR_ITERANCE_DIVISOR};
menu_item::note::IteranceStepToggle noteCustomIteranceStep1{STRING_FOR_ITERATION_STEP_1, STRING_FOR_ITERATION_STEP_1,
0};
Expand Down Expand Up @@ -1555,16 +1567,16 @@ MenuItem* paramShortcutsForSounds[][kDisplayHeight] = {
{&modulatorVolume, &modulatorTransposeMenu, comingSoonMenu, comingSoonMenu, &modulatorPhaseMenu, &modulatorFeedbackMenu, &modulatorDestMenu, nullptr },
{&volumeMenu, &masterTransposeMenu, &vibratoMenu, &panMenu, &synthModeMenu, &srrMenu, &bitcrushMenu, &clippingMenu },
{&portaMenu, &polyphonyMenu, &priorityMenu, &unisonDetuneMenu, &numUnisonToStereoSpreadMenu, nullptr, nullptr, &foldMenu },
{&envReleaseMenu, &envSustainMenu, &envDecayMenu, &envAttackMenu, &lpfMorphMenu, &lpfModeMenu, &lpfResMenu, &lpfFreqMenu },
{&envReleaseMenu, &envSustainMenu, &envDecayMenu, &envAttackMenu, &hpfMorphMenu, &hpfModeMenu, &hpfResMenu, &hpfFreqMenu },
{&envReleaseMenus, &envSustainMenus, &envDecayMenus, &envAttackMenus, &lpfMorphMenu, &lpfModeMenu, &lpfResMenu, &lpfFreqMenu },
{&envReleaseMenus, &envSustainMenus, &envDecayMenus, &envAttackMenus, &hpfMorphMenu, &hpfModeMenu, &hpfResMenu, &hpfFreqMenu },
{&sidechainReleaseMenu, &sidechainSyncMenu, &sidechainVolumeShortcutMenu, &sidechainAttackMenu, &sidechainShapeMenu, &sidechainSendMenu, &bassMenu, &bassFreqMenu },
{&arpRateMenu, &arpSyncMenu, &arpGateMenu, &arpOctavesMenu, &arpPresetModeMenu, &nameEditMenu, &trebleMenu, &trebleFreqMenu },
{&lfo1RateMenu, &lfo1SyncMenu, &lfo1TypeMenu, &modFXTypeMenu, &modFXOffsetMenu, &modFXFeedbackMenu, &modFXDepthMenu, &modFXRateMenu },
{&lfo2RateMenu, &lfo2SyncMenu, &lfo2TypeMenu, &reverbAmountMenu, &reverbPanMenu, &reverbWidthMenu, &reverbDampingMenu, &reverbRoomSizeMenu },
{&delayRateMenu, &delaySyncMenu, &delayAnalogMenu, &delayFeedbackMenu, &delayPingPongMenu, nullptr, nullptr, nullptr },
{nullptr, &arpSpreadVelocityMenu, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr },
};
Submenu* parentsForSoundShortcuts[][kDisplayHeight] = {
MenuItem* parentsForSoundShortcuts[][kDisplayHeight] = {
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
Expand All @@ -1573,8 +1585,8 @@ Submenu* parentsForSoundShortcuts[][kDisplayHeight] = {
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{&env0Menu, &env0Menu, &env0Menu, &env0Menu, &lpfMenu, &lpfMenu, &lpfMenu, &lpfMenu, },
{&env1Menu, &env1Menu, &env1Menu, &env1Menu, &hpfMenu, &hpfMenu, &hpfMenu, &hpfMenu, },
{&envMenuA, &envMenuA, &envMenuA, &envMenuA, &lpfMenu, &lpfMenu, &lpfMenu, &lpfMenu, },
{&envMenuB, &envMenuB, &envMenuB, &envMenuB, &hpfMenu, &hpfMenu, &hpfMenu, &hpfMenu, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
Expand All @@ -1601,7 +1613,7 @@ MenuItem* paramShortcutsForAudioClips[][kDisplayHeight] = {
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
};
Submenu* parentsForAudioShortcuts[][kDisplayHeight] = {
MenuItem* parentsForAudioShortcuts[][kDisplayHeight] = {
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
Expand Down Expand Up @@ -1638,7 +1650,7 @@ MenuItem* paramShortcutsForSongView[][kDisplayHeight] = {
{&globalDelayRateMenu, &delaySyncMenu, &delayAnalogMenu, &globalDelayFeedbackMenu, &delayPingPongMenu, nullptr, nullptr, nullptr },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr },
};
Submenu* parentsForSongShortcuts[][kDisplayHeight] = {
MenuItem* parentsForSongShortcuts[][kDisplayHeight] = {
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
Expand Down Expand Up @@ -1675,7 +1687,7 @@ MenuItem* paramShortcutsForKitGlobalFX[][kDisplayHeight] = {
{&globalDelayRateMenu, &delaySyncMenu, &delayAnalogMenu, &globalDelayFeedbackMenu, &delayPingPongMenu, nullptr, nullptr, nullptr },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr },
};
Submenu* parentsForKitGlobalFXShortcuts[][kDisplayHeight] = {
MenuItem* parentsForKitGlobalFXShortcuts[][kDisplayHeight] = {
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
{nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, },
Expand Down
Loading

0 comments on commit 33679ce

Please sign in to comment.