Repository navigation
Feature / Add support for affecting-all kit rows while in the sound editor by holding Affect-Entire button - #3425
Conversation
# Conflicts: # src/deluge/gui/menu_item/arpeggiator/mode.h # src/deluge/gui/menu_item/arpeggiator/preset_mode.h
|
Ready for review |
soymonitus
left a comment
There was a problem hiding this comment.
@stellar-aria Added comments to my own PR to explain some things. Basically what this huge PR is about is to take all parameters of a sound and add to them the same if-else that sample reverse, or sample repeat mode already had, that is, check if we are in a kit and holding affect-entire, then do the edit to all rows, and if not, then just edit the selected row. The only complexity here is that some parameters executed some additional logic before or after editing the parameter (for example LFOs: they resync the lfos after editing them), so I had to carefully do the same pre/post logic for all kit rows
| using Selection::Selection; | ||
| void readCurrentValue() override { this->setValue(soundEditor.currentArpSettings->chordTypeIndex); } | ||
|
|
||
| bool usesAffectEntire() override { return true; } |
There was a problem hiding this comment.
This is the virtual method used to tell the sound editor that this parameter supports holding affect-entire button when in kit to do batch edits. The line
bool usesAffectEntire() override { return true; }
has been added to all parameters that have been modified in this PR, to make them batch-edit-enabled
| } | ||
|
|
||
| // If affect-entire button held, do whole kit | ||
| if (currentUIMode == UI_MODE_HOLDING_AFFECT_ENTIRE_IN_SOUND_EDITOR && soundEditor.editingKitRow()) { |
There was a problem hiding this comment.
You will find in all the parameters that have been edited in this PR that a new if-else condition is added, mimicking the ones which were already there in the code for sample/reverse.h and sample/repeat.h for example. Basically this is:
if (currentUIMode == UI_MODE_HOLDING_AFFECT_ENTIRE_IN_SOUND_EDITOR && soundEditor.editingKitRow()) {
// Loop through all kit rows and apply the change to each one (only if they meet the requirements stated by isRelevant)
} else {
// Just edit the current selected row
}
| } | ||
| } | ||
|
|
||
| ModelStackWithThreeMainThings* getModelStackFromSoundDrum(void* memory, SoundDrum* soundDrum) { |
There was a problem hiding this comment.
A new utility method has been added to be able to get a modelstack from a sounddrum kit row, to avoid code repetition
| // If was off, or is now becoming off... | ||
| if (soundEditor.currentArpSettings->mode == ArpMode::OFF || current_value == ArpMode::OFF) { | ||
| if (getCurrentClip()->isActiveOnOutput() && !soundEditor.editingKitAffectEntire()) { | ||
| kit->cutAllSound(); |
There was a problem hiding this comment.
Some parameters execute additional logic when edited. In this case, when the arp mode was changed just for one row, it called currentSound->unassignAllVoices() (or maybe named killAllVoices now that Stellar-Aria made a refactor) , so here when batch editing all arp modes of all kit rows, we have to do the same. Luckily there is already a method in kit that cuts all voices for all rows so we don't have to call unassignAllVoices per row.
Same logic applies to other parameters, if there is some extra work to do before or after editing the parameter, we have to do the equivalent but for all the rows
| } | ||
| virtual uint64_t getCompressorValue() = 0; | ||
| virtual void setCompressorValue(q31_t value) = 0; | ||
| virtual void setCompressorValue(q31_t value, RMSFeedbackCompressor* compressor) = 0; |
There was a problem hiding this comment.
Use a specific compressor instead of the one from selected kit row, so this method is more flexible and we can use it for the batch edit of other rows
| } | ||
| void setMode(int32_t value) const { | ||
| void setMode(int32_t value) const { setModeForModControllable(value, soundEditor.currentModControllable); } | ||
| void setModeForModControllable(int32_t value, ModControllableAudio* modControllable) const { |
There was a problem hiding this comment.
Same here as with compressor, modify it so we can edit any modControllable and not only the one from selected kit row
| && soundEditor.currentSource->oscType == OscType::SAMPLE) { | ||
| (static_cast<MultisampleRange*>(soundEditor.currentMultiRange))->sampleHolder.transpose = transpose; | ||
| (static_cast<MultisampleRange*>(soundEditor.currentMultiRange))->sampleHolder.setCents(cents); | ||
| // If affect-entire button held, do whole kit |
There was a problem hiding this comment.
The transpose parameters were actually the most complex parameters to make compatible with batch-edit, because you have to carefully take the multsample range and whatnot. But anyway not a big deal after all.
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
…ditor by holding Affect-Entire button (SynthstromAudible#3425) * wip * wip * wip * wip * wip * wip * format * wip * wip * cleanup * wip * wip * docs * transpose osc * fix * fix * transpose * fix doc typos * Allow to keep holding affect-entire while you navigate to other menu items * Fix
Just like what happens with Sample Mode, Reverse, Pitch/Speed... we want to be able to batch change all kit rows at the same time. This works by holding the affect-entire button (it will flash indicating that this action is available for this parameter), and when you edit the parameter, it will apply the same value to all kit rows within the current clip.
All Sound parameters are implemented except for Oscillator Type and patch cables.
Additional features: batch editing a param for all kit rows while record engaged will record automation for all rows!
Considerations:
Community: 1,581,892 bytes
This PR: 1,585,772 bytes
Things this feature will enable: