33 using Integer::Integer;
35 void readCurrentValue()
override { this->setValue(soundEditor.currentSound->transpose); }
36 void writeCurrentValue()
override {
38 int16_t value = this->getValue();
41 if (currentUIMode == UI_MODE_HOLDING_AFFECT_ENTIRE_IN_SOUND_EDITOR && soundEditor.editingKitRow()) {
43 Kit* kit = getCurrentKit();
45 for (
Drum* thisDrum = kit->firstDrum; thisDrum !=
nullptr; thisDrum = thisDrum->next) {
46 if (thisDrum->type == DrumType::SOUND) {
47 auto* soundDrum =
static_cast<SoundDrum*
>(thisDrum);
49 soundDrum->transpose = value;
51 char modelStackMemoryForSoundDrum[MODEL_STACK_MAX_SIZE];
53 getModelStackFromSoundDrum(modelStackMemoryForSoundDrum, soundDrum)->addSoundFlags();
54 soundDrum->recalculateAllVoicePhaseIncrements(modelStackForSoundDrum);
60 soundEditor.currentSound->transpose = value;
62 char modelStackMemory[MODEL_STACK_MAX_SIZE];
64 soundEditor.currentSound->recalculateAllVoicePhaseIncrements(modelStack);
69 uint32_t
getParamIndex()
override {
return deluge::modulation::params::LOCAL_PITCH_ADJUST; }
70 uint8_t getP()
override {
return deluge::modulation::params::LOCAL_PITCH_ADJUST; }
72 return PatchedParam::shouldBlinkPatchingSourceShortcut(s, colour);
75 return PatchedParam::patchingSourceShortcutPress(s, previousPressStillActive);
78 void drawValue()
override { display->setTextAsNumber(this->getValue(),
shouldDrawDotOnName()); }
80 void unlearnAction()
override { MenuItemWithCCLearning::unlearnAction(); }
81 bool allowsLearnMode()
override {
return MenuItemWithCCLearning::allowsLearnMode(); }
82 void learnKnob(
MIDICable* cable, int32_t whichKnob, int32_t modKnobMode, int32_t midiChannel)
override {
83 MenuItemWithCCLearning::learnKnob(cable, whichKnob, modKnobMode, midiChannel);
86 [[nodiscard]] int32_t getMinValue()
const override {
return -96; }
87 [[nodiscard]] int32_t getMaxValue()
const override {
return 96; }