Skip to content

Commit

Permalink
Merge branch 'release/1.0' into community
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulFreund committed Nov 6, 2023
2 parents 4c6996f + 5a9c21d commit ffa39ad
Show file tree
Hide file tree
Showing 17 changed files with 129 additions and 19 deletions.
16 changes: 16 additions & 0 deletions docs/community_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ Here is a list of general improvements that have been made, ordered from newest
- The value range displayed is 0-50 for non-MIDI parameters and 0-127 for MIDI parameters.
- Note: In the Menu, if you wish to scroll through the parameter value range faster at an accelerated rate of +/- 5, hold Shift while turning the Select Encoder.

#### 3.9 - Adjust Metronome Volume
- ([#683]) The Metronome's volume now respects the song's volume and will increase and decrease in volume together with the Gold Volume Encoder.
- In addition, a Default menu was created titled "Metronome" which enables you to set a value between 22 and 27 to further adjust the volume of the Metronome. 22 being the lowest metronome volume that can be heard when the Song's volume is at its maximum and 27 being the loudest metronome volume.

## 4. New Features Added

Here is a list of features that have been added to the firmware as a list, grouped by category:
Expand Down Expand Up @@ -212,6 +216,10 @@ Synchronization modes accessible through the "LFO SYNC" shortcut.
- ([#360]) Fixed interpolation bugs, added fine tuning for long presses, and added pad selection mode
- ([#636]) Updated Parameter Values displayed in Automation View to match Parameter Value Ranges displayed in the Menu's. E.g. instead of 0 - 128, it now displays 0 - 50 (except for Pan which now displays -25 to +25 and MIDI instrument clips which now display 0 - 127).
- ([#658]) Added Stutter Rate Parameter to Automation View. There is no grid shortcut for this parameter so you will not see a pad on the Automation Overview that indicates whether Stutter has been automated. This parameter can be selected and automated using the Select Encoder to scroll the available list of Automatable Parameters.
- ([#681]) Added new automation community feature menu to re-instate audition pad shortcuts in the Automation Instrument Clip View.
- Currently in the Instrument Clip View if you hold down an audition pad and press a shortcut pad on the grid, it will open the menu corresponding to that shortcut pad.
- By default in the Automation Instrument Clip View that same behaviour of holding an audition pad and pressing a shortcut pad is disabled in favour of you being able to hold down an audition pad and adjust the automation lane values so that you can audible hear the changes to the sound while adjusting automation settings.
- Through the community features menu, you can disable this change and re-instate the audition pad shortcuts by setting the community feature to "Off."

#### 4.3.6 - Set Probability By Row

Expand Down Expand Up @@ -322,6 +330,12 @@ In the main menu of the deluge (accessed by pressing "SHIFT" + the "SELECT" knob
* Shift Note (SHIF)
* When On, shifting notes horizontally in the regular Instrument Clip View will shift the Notes and MPE, but not the Automation.
* When On, to shift Non-MPE Automation horizontally you will need to enter the Automation Instrument Clip View.
* Disable Audition Pad Shortcuts (SCUT)
* When On, audition pad shortcuts are disabled. Holding an audition pad and pressing a shortcut pad will not activate the shortcut and will not change the selected parameter.
* When On, to change the selected parameter you will need to either:
1) use the select encoder;
2) use the shift + shortcut pad combo; or
3) go back to the automation overview;
* Allow Insecure Develop Sysex Messages (SYX)
* When On, the ability to load firmware over USB is enabled.
* Sync Scaling Action (SCAL)
Expand Down Expand Up @@ -408,4 +422,6 @@ This list includes all preprocessor switches that can alter firmware behaviour a
[#636]: https://github.com/SynthstromAudible/DelugeFirmware/pull/636
[#653]: https://github.com/SynthstromAudible/DelugeFirmware/pull/653
[#658]: https://github.com/SynthstromAudible/DelugeFirmware/pull/658
[#681]: https://github.com/SynthstromAudible/DelugeFirmware/pull/681
[#683]: https://github.com/SynthstromAudible/DelugeFirmware/pull/683
[Automation View Documentation]: https://github.com/SynthstromAudible/DelugeFirmware/blob/release/1.0/docs/features/automation_view.md
10 changes: 10 additions & 0 deletions docs/features/automation_view.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,16 @@ In the Automation Instrument Clip View, functionality is provided to shift autom

> **Note:** MPE recorded will still be shifted as the scope of this PR does not cover editing MPE.
### Disable Audition Pad Shortcuts

Currently in the Instrument Clip View if you hold down an audition pad and press a shortcut pad on the grid, it will open the menu corresponding to that shortcut pad.

By default in the Automation Instrument Clip View that same behaviour of holding an audition pad and pressing a shortcut pad is disabled in favour of you being able to hold down an audition pad and adjust the automation lane values so that you can audible hear the changes to the sound while adjusting automation settings.

Through the community features menu, you can disable this change and re-instate the audition pad shortcuts by setting the community feature to "Off."

> **Note:** in automation view, shortcuts do not open the menu. They change the selected parameter for automation lane editing.
# Fun things to try with the new Automation Instrument Clip View

## Two Hand Automation Drumming
Expand Down
5 changes: 5 additions & 0 deletions src/definitions_cxx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ constexpr int32_t kMinMenuPanValue = -1 * kMaxMenuPanValue;
//patch cable menu range e.g. -5000 to 5000
constexpr int32_t kMaxMenuPatchCableValue = kMaxMenuValue * 100;
constexpr int32_t kMinMenuPatchCableValue = -1 * kMaxMenuPatchCableValue;

//metronome volume menu range : 22 to 27
constexpr int32_t kMaxMenuMetronomeVolumeValue = 27;
constexpr int32_t kMinMenuMetronomeVolumeValue = 22;

//

//Automation View constants
Expand Down
3 changes: 3 additions & 0 deletions src/deluge/gui/l10n/english.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ PLACE_SDRAM_DATA Language english{
{STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_CLEAR_CLIP, "Clear Clip"},
{STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_NUDGE_NOTE, "Nudge Note"},
{STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_SHIFT_CLIP, "Shift Note"},
{STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_DISABLE_AUDITION_PAD_SHORTCUTS, "Disable Audition Pad Shortcuts"},
{STRING_FOR_COMMUNITY_FEATURE_DEV_SYSEX, "Allow Insecure Develop Sysex Messages"},
{STRING_FOR_COMMUNITY_FEATURE_SYNC_SCALING_ACTION, "Sync Scaling Action"},
{STRING_FOR_COMMUNITY_FEATURE_HIGHLIGHT_INCOMING_NOTES, "Highlight Incoming Notes"},
Expand Down Expand Up @@ -691,6 +692,8 @@ PLACE_SDRAM_DATA Language english{
{STRING_FOR_SIDECH_RELEASE_MENU_TITLE, "Sidech release"},
{STRING_FOR_SIDECHAIN_COMP_MENU_TITLE, "Sidechain comp"},
{STRING_FOR_NUM_MEMBER_CH_MENU_TITLE, "Num member ch."},
{STRING_FOR_METRONOME, "METRONOME"},
{STRING_FOR_DEFAULT_METRO_MENU_TITLE, "Default metro."},

{STRING_FOR_CV_INSTRUMENT, "CV instrument"},

Expand Down
1 change: 1 addition & 0 deletions src/deluge/gui/l10n/seven_segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ PLACE_SDRAM_DATA Language seven_segment{
{STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_CLEAR_CLIP, "CLEA"},
{STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_NUDGE_NOTE, "NUDG"},
{STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_SHIFT_CLIP, "SHIF"},
{STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_DISABLE_AUDITION_PAD_SHORTCUTS, "SCUT"},
{STRING_FOR_COMMUNITY_FEATURE_DEV_SYSEX, "SYSX"},
{STRING_FOR_COMMUNITY_FEATURE_SYNC_SCALING_ACTION, "SCAL"},
{STRING_FOR_COMMUNITY_FEATURE_HIGHLIGHT_INCOMING_NOTES, "HIGH"},
Expand Down
3 changes: 3 additions & 0 deletions src/deluge/gui/l10n/strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ enum class String : size_t {
STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_CLEAR_CLIP,
STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_NUDGE_NOTE,
STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_SHIFT_CLIP,
STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_DISABLE_AUDITION_PAD_SHORTCUTS,
STRING_FOR_COMMUNITY_FEATURE_DEV_SYSEX,
STRING_FOR_COMMUNITY_FEATURE_SYNC_SCALING_ACTION,
STRING_FOR_COMMUNITY_FEATURE_HIGHLIGHT_INCOMING_NOTES,
Expand Down Expand Up @@ -570,6 +571,7 @@ enum class String : size_t {
STRING_FOR_AUDIO_CLIP,
STRING_FOR_SETTINGS,
STRING_FOR_STUTTER_RATE,
STRING_FOR_METRONOME,

// MENU TITLES
STRING_FOR_ENV_ATTACK_MENU_TITLE,
Expand Down Expand Up @@ -614,6 +616,7 @@ enum class String : size_t {
STRING_FOR_MASTER_TRAN_MENU_TITLE,
STRING_FOR_MIDI_INST_MENU_TITLE,
STRING_FOR_NUM_MEMBER_CH_MENU_TITLE,
STRING_FOR_DEFAULT_METRO_MENU_TITLE,

STRING_FOR_CV_INSTRUMENT,

Expand Down
30 changes: 30 additions & 0 deletions src/deluge/gui/menu_item/defaults/metronome_volume.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2014-2023 Synthstrom Audible Limited
*
* This file is part of The Synthstrom Audible Deluge Firmware.
*
* The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "gui/menu_item/integer.h"
#include "storage/flash_storage.h"

namespace deluge::gui::menu_item::defaults {
class MetronomeVolume final : public Integer {
public:
using Integer::Integer;
[[nodiscard]] int32_t getMinValue() const override { return kMinMenuMetronomeVolumeValue; }
[[nodiscard]] int32_t getMaxValue() const override { return kMaxMenuMetronomeVolumeValue; }
void readCurrentValue() override { this->setValue(FlashStorage::defaultMetronomeVolume); }
void writeCurrentValue() override { FlashStorage::defaultMetronomeVolume = this->getValue(); }
};
} // namespace deluge::gui::menu_item::defaults
2 changes: 2 additions & 0 deletions src/deluge/gui/menu_item/runtime_feature/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Setting menuAutomationInterpolate(RuntimeFeatureSettingType::AutomationInterpola
Setting menuAutomationClearClip(RuntimeFeatureSettingType::AutomationClearClip);
Setting menuAutomationNudgeNote(RuntimeFeatureSettingType::AutomationNudgeNote);
Setting menuAutomationShiftClip(RuntimeFeatureSettingType::AutomationShiftClip);
Setting menuAutomationDisableAuditionPadShortcuts(RuntimeFeatureSettingType::AutomationDisableAuditionPadShortcuts);
Setting menuSyncScalingAction(RuntimeFeatureSettingType::SyncScalingAction);
DevSysexSetting menuDevSysexAllowed(RuntimeFeatureSettingType::DevSysexAllowed);
Setting menuHighlightIncomingNotes(RuntimeFeatureSettingType::HighlightIncomingNotes);
Expand All @@ -58,6 +59,7 @@ Submenu subMenuAutomation{
&menuAutomationClearClip,
&menuAutomationNudgeNote,
&menuAutomationShiftClip,
&menuAutomationDisableAuditionPadShortcuts,
},
};

Expand Down
3 changes: 3 additions & 0 deletions src/deluge/gui/ui/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "gui/menu_item/defaults/grid_unarm_empty_pads.h"
#include "gui/menu_item/defaults/keyboard_layout.h"
#include "gui/menu_item/defaults/magnitude.h"
#include "gui/menu_item/defaults/metronome_volume.h"
#include "gui/menu_item/defaults/scale.h"
#include "gui/menu_item/defaults/session_layout.h"
#include "gui/menu_item/defaults/velocity.h"
Expand Down Expand Up @@ -853,6 +854,7 @@ defaults::Scale defaultScaleMenu{STRING_FOR_SCALE, STRING_FOR_DEFAULT_SCALE};
defaults::Velocity defaultVelocityMenu{STRING_FOR_VELOCITY, STRING_FOR_DEFAULT_VELOC_MENU_TITLE};
defaults::Magnitude defaultMagnitudeMenu{STRING_FOR_RESOLUTION, STRING_FOR_DEFAULT_RESOL_MENU_TITLE};
defaults::BendRange defaultBendRangeMenu{STRING_FOR_BEND_RANGE, STRING_FOR_DEFAULT_BEND_R};
defaults::MetronomeVolume defaultMetronomeVolumeMenu{STRING_FOR_METRONOME, STRING_FOR_DEFAULT_METRO_MENU_TITLE};

Submenu defaultsSubmenu{
STRING_FOR_DEFAULTS,
Expand All @@ -865,6 +867,7 @@ Submenu defaultsSubmenu{
&defaultVelocityMenu,
&defaultMagnitudeMenu,
&defaultBendRangeMenu,
&defaultMetronomeVolumeMenu,
},
};

Expand Down
18 changes: 8 additions & 10 deletions src/deluge/gui/views/automation_instrument_clip_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1465,8 +1465,10 @@ ActionResult AutomationInstrumentClipView::padAction(int32_t x, int32_t y, int32

//if the user wants to change the parameter they are editing using Shift + Pad shortcut
if (velocity) {
if (Buttons::isShiftButtonPressed()) {

if (Buttons::isShiftButtonPressed()
|| (isUIModeActive(UI_MODE_AUDITIONING)
&& (runtimeFeatureSettings.get(RuntimeFeatureSettingType::AutomationDisableAuditionPadShortcuts)
== RuntimeFeatureStateToggle::Off))) {
initPadSelection();
handleSinglePadPress(modelStack, clip, x, y, true);

Expand Down Expand Up @@ -2434,10 +2436,8 @@ bool AutomationInstrumentClipView::modEncoderActionForSelectedPad(int32_t whichM
//ignore modEncoderTurn for Midi CC if current or new knobPos exceeds 127
//if current knobPos exceeds 127, e.g. it's 128, then it needs to drop to 126 before a value change gets recorded
//if newKnobPos exceeds 127, then it means current knobPos was 127 and it was increased to 128. In which case, ignore value change
if (clip->output->type == InstrumentType::MIDI_OUT) {
if ((knobPos == 64) || (newKnobPos == 64)) {
return true;
}
if ((clip->output->type == InstrumentType::MIDI_OUT) && (newKnobPos == 64)) {
return true;
}

//use default interpolation settings
Expand Down Expand Up @@ -2481,10 +2481,8 @@ void AutomationInstrumentClipView::modEncoderActionForUnselectedPad(int32_t whic
//ignore modEncoderTurn for Midi CC if current or new knobPos exceeds 127
//if current knobPos exceeds 127, e.g. it's 128, then it needs to drop to 126 before a value change gets recorded
//if newKnobPos exceeds 127, then it means current knobPos was 127 and it was increased to 128. In which case, ignore value change
if (clip->output->type == InstrumentType::MIDI_OUT) {
if ((knobPos == 64) || (newKnobPos == 64)) {
return;
}
if ((clip->output->type == InstrumentType::MIDI_OUT) && (newKnobPos == 64)) {
return;
}

int32_t newValue =
Expand Down
8 changes: 3 additions & 5 deletions src/deluge/gui/views/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,10 +874,8 @@ void View::modEncoderAction(int32_t whichModEncoder, int32_t offset) {
//if current knobPos exceeds 127, e.g. it's 128, then it needs to drop to 126 before a value change gets recorded
//if newKnobPos exceeds 127, then it means current knobPos was 127 and it was increased to 128. In which case, ignore value change
if ((getRootUI() == &instrumentClipView) || (getRootUI() == &automationInstrumentClipView)) {
if (clip->output->type == InstrumentType::MIDI_OUT) {
if ((knobPos == 64) || (newKnobPos == 64)) {
return;
}
if ((clip->output->type == InstrumentType::MIDI_OUT) && (newKnobPos == 64)) {
return;
}
}

Expand All @@ -894,7 +892,7 @@ void View::modEncoderAction(int32_t whichModEncoder, int32_t offset) {
char buffer[5];
int32_t valueForDisplay;
if (clip->output->type == InstrumentType::MIDI_OUT) {
valueForDisplay = newKnobPos = kKnobPosOffset;
valueForDisplay = newKnobPos + kKnobPosOffset;
}
else if ((modelStackWithParam->paramId == Param::Local::PAN)
|| (modelStackWithParam->paramId == Param::Unpatched::GlobalEffectable::PAN)) {
Expand Down
4 changes: 4 additions & 0 deletions src/deluge/model/settings/runtime_feature_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ void RuntimeFeatureSettings::init() {
SetupOnOffSetting(settings[RuntimeFeatureSettingType::AutomationShiftClip],
deluge::l10n::getView(STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_SHIFT_CLIP), "automationShiftClip",
RuntimeFeatureStateToggle::On);
// Disable Audition Pad Shortcuts in Automation View
SetupOnOffSetting(settings[RuntimeFeatureSettingType::AutomationDisableAuditionPadShortcuts],
deluge::l10n::getView(STRING_FOR_COMMUNITY_FEATURE_AUTOMATION_DISABLE_AUDITION_PAD_SHORTCUTS),
"automationDisableAuditionPadShortcuts", RuntimeFeatureStateToggle::On);
// devSysexAllowed
SetupOnOffSetting(settings[RuntimeFeatureSettingType::DevSysexAllowed],
deluge::l10n::getView(STRING_FOR_COMMUNITY_FEATURE_DEV_SYSEX), "devSysexAllowed",
Expand Down
1 change: 1 addition & 0 deletions src/deluge/model/settings/runtime_feature_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ enum RuntimeFeatureSettingType : uint32_t {
AutomationNudgeNote,
AutomationShiftClip,
AutomationInterpolate,
AutomationDisableAuditionPadShortcuts,
DevSysexAllowed,
SyncScalingAction,
HighlightIncomingNotes,
Expand Down
9 changes: 7 additions & 2 deletions src/deluge/processing/engines/audio_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ void routine() {
//the max error is 0.3ms. At 100bpm 24ppq it is 25ms per pulse
//this works out to a 1% error in the absolute worse case of alternating
//no extension and max extension, approximately 10x better than average usb midi accuracy.
numSamples = std::max<int32_t>(numSamples, MINSAMPLES);
int32_t minSamples = std::min<int32_t>(unadjustedNumSamplesBeforeLappingPlayHead, MINSAMPLES);
numSamples = std::max<int32_t>(numSamples, minSamples);
numSamplesLastTime = numSamples;
memset(&renderingBuffer, 0, numSamples * sizeof(StereoSample));

Expand Down Expand Up @@ -1414,11 +1415,15 @@ void slowRoutine() {
- SSI_TX_BUFFER_NUM_SAMPLES)
& (SSI_RX_BUFFER_NUM_SAMPLES - 1);

if (latencyWithinAppropriateWindow >= SSI_TX_BUFFER_NUM_SAMPLES) {
while (latencyWithinAppropriateWindow >= SSI_TX_BUFFER_NUM_SAMPLES) {
i2sRXBufferPos += (SSI_TX_BUFFER_NUM_SAMPLES << (2 + NUM_MONO_INPUT_CHANNELS_MAGNITUDE));
if (i2sRXBufferPos >= (uint32_t)getRxBufferEnd()) {
i2sRXBufferPos -= (SSI_RX_BUFFER_NUM_SAMPLES << (2 + NUM_MONO_INPUT_CHANNELS_MAGNITUDE));
}
latencyWithinAppropriateWindow =
(((rxBufferWriteAddr - (uint32_t)i2sRXBufferPos) >> (2 + NUM_MONO_INPUT_CHANNELS_MAGNITUDE))
- SSI_TX_BUFFER_NUM_SAMPLES)
& (SSI_RX_BUFFER_NUM_SAMPLES - 1);
}

// Discard any LiveInputBuffers which aren't in use
Expand Down
20 changes: 18 additions & 2 deletions src/deluge/processing/metronome/metronome.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

#include "processing/metronome/metronome.h"
#include "dsp/stereo_sample.h"
#include "model/song/song.h"
#include "modulation/params/param_set.h"
#include "processing/engines/audio_engine.h"
#include "storage/flash_storage.h"

Metronome::Metronome() {
sounding = false;
Expand All @@ -33,17 +37,29 @@ void Metronome::render(StereoSample* buffer, uint16_t numSamples) {
if (!sounding) {
return;
}
int32_t volumePostFX;
if (currentSong) {
volumePostFX = getFinalParameterValueVolume(
1 << FlashStorage::defaultMetronomeVolume,
cableToLinearParamShortcut(currentSong->paramManager.getUnpatchedParamSet()->getValue(
Param::Unpatched::GlobalEffectable::VOLUME)))
>> 1;
}
else {
volumePostFX = ONE_Q31;
}

q31_t high = multiply_32x32_rshift32(1 << FlashStorage::defaultMetronomeVolume, volumePostFX);
StereoSample* thisSample = buffer;
StereoSample* bufferEnd = buffer + numSamples;
do {

int32_t value;
if (phase < 2147483648u) {
value = 8388608;
value = high;
}
else {
value = -8388608;
value = -high;
}

phase += phaseIncrement;
Expand Down
13 changes: 13 additions & 0 deletions src/deluge/storage/flash_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ namespace FlashStorage {
119: gridUnarmEmptyPads
120: gridAllowGreenSelection
121: defaultGridActiveMode
122: defaultMetronomeVolume
*/

uint8_t defaultScale;
Expand All @@ -142,6 +143,8 @@ bool gridUnarmEmptyPads;
bool gridAllowGreenSelection;
GridDefaultActiveMode defaultGridActiveMode;

uint8_t defaultMetronomeVolume;

void resetSettings() {

cvEngine.setCVVoltsPerOctave(0, 100);
Expand Down Expand Up @@ -212,6 +215,8 @@ void resetSettings() {
gridUnarmEmptyPads = false;
gridAllowGreenSelection = true;
defaultGridActiveMode = GridDefaultActiveModeSelection;

defaultMetronomeVolume = kMaxMenuMetronomeVolumeValue;
}

void readSettings() {
Expand Down Expand Up @@ -407,6 +412,12 @@ void readSettings() {
gridUnarmEmptyPads = buffer[119];
gridAllowGreenSelection = buffer[120];
defaultGridActiveMode = static_cast<GridDefaultActiveMode>(buffer[121]);

defaultMetronomeVolume = buffer[122];
if (defaultMetronomeVolume > kMaxMenuMetronomeVolumeValue
|| defaultMetronomeVolume < kMinMenuMetronomeVolumeValue) {
defaultMetronomeVolume = kMaxMenuMetronomeVolumeValue;
}
}

void writeSettings() {
Expand Down Expand Up @@ -516,6 +527,8 @@ void writeSettings() {
buffer[120] = gridAllowGreenSelection;
buffer[121] = util::to_underlying(defaultGridActiveMode);

buffer[122] = defaultMetronomeVolume;

R_SFLASH_EraseSector(0x80000 - 0x1000, SPIBSC_CH, SPIBSC_CMNCR_BSZ_SINGLE, 1, SPIBSC_OUTPUT_ADDR_24);
R_SFLASH_ByteProgram(0x80000 - 0x1000, buffer, 256, SPIBSC_CH, SPIBSC_CMNCR_BSZ_SINGLE, SPIBSC_1BIT,
SPIBSC_OUTPUT_ADDR_24);
Expand Down
2 changes: 2 additions & 0 deletions src/deluge/storage/flash_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ extern bool gridUnarmEmptyPads;
extern bool gridAllowGreenSelection;
extern GridDefaultActiveMode defaultGridActiveMode;

extern uint8_t defaultMetronomeVolume;

void readSettings();
void writeSettings();
void resetSettings();
Expand Down

0 comments on commit ffa39ad

Please sign in to comment.