Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu - #963
Conversation
33ff41e to
6477def
Compare
| //are we currently in the instrument clip UI? | ||
| //if yes, we may need to refresh it (main pads and / or sidebar) | ||
| UI* currentUI = getCurrentUI(); | ||
| if (currentUI == &instrumentClipView || currentUI == &automationInstrumentClipView) { |
There was a problem hiding this comment.
Can you call instrumentClipView::setSelectedDrum instead? There's a bunch of duplicated logic here
There was a problem hiding this comment.
Can you call instrumentClipView::setSelectedDrum instead? There's a bunch of duplicated logic here
the problem with using InstrumentClipView::setSelectedDrum is that it uses getCurrentKit() and getCurrentClip(), which means it won't work with pressing a clip in Song or Arranger because currentSong->currentClip isn't updated.
I did however make two improvements to setSelectedDrum because I noticed a couple things which should improve performance:
-
it would set the selected drum even if it's the same drum that's currently selected. This happens when you audition a kit row for instance. So I added a check to make sure we're not re-selecting the same drum. In that instance the only thing that would happen is a re-rendering of the audition pad (so it lights up when you press it).
-
it would set the mod controllable when changing the selected drum, even if affect entire is enabled. This did not make sense because with affect entire enabled you cannot control the mod controllable stack of the selected drum. So there is no need to redraw mod led's or set the mod controllable. So I added a check to see if affect entire is enabled. Without check, this call to set the mod controllable would also unnecessarily send midi follow feedback when nothing has changed.
There was a problem hiding this comment.
Can you call instrumentClipView::setSelectedDrum instead? There's a bunch of duplicated logic here
Just as a further follow up. I have further refactored setSelectedDrum which enables me to now call that function instead of adding duplicate code to the Kit class.
1eb8dde to
50a3557
Compare
d9a81cc to
e8dbff9
Compare
Added new Select Kit Row menu to the Midi Defaults menu. When this setting is enabled, midi notes received for learned kit row's will update the kit row selection in the kit clip. This updates the mod controllable stack that the mod encoders control as well so that you can update the parameters for the drum being auditioned without needing to manually select the same drum as the drum corresponding to the learned note received. This is useful for midi follow as well because the updated drum selection will not only allow you to use your midi follow controller to control the parameters for that drum, but it will also send updated midi feedback for the current drum selection.
Changed getClipForMidiFollow to a function instead of a Class Method Renamed the function to getSelectedClip to better describe it's use
Updated for performance. No need to execute this function if you're selecting the same drum that is already selected (which would happen if you're using the audition pads) Also updated the function to not reset the mod controllable stack when affect entire is enabled because changing select row with affect entire enabled has no impact on what mod led's and what the gold knobs control (only need to redraw when affect entire is off). Also just cleaned up the code a bit to reduce the number of function calls.
Combined the drum selection code I added to the kit class with the drum selection code from the instrument clip class.
c1420b9 to
8698b99
Compare
Added new Select Kit Row menu to the Midi Defaults menu in
Settings > MIDI > Select Kit RowWhen this setting is enabled, midi notes received for learned kit row's will update the kit row selection in the kit clip.
This updates the mod controllable stack that the mod encoders control as well so that you can update the parameters for the drum being auditioned without needing to manually select the same drum as the drum corresponding to the learned note received.
This is useful for midi follow as well because the updated drum selection will not only allow you to use your midi follow controller to control the parameters for that drum, but it will also send updated midi feedback as the drum selection changes.
Refactored InstrumentClipView::SetSelectedDrum to improve it and enable its use with midi.
Improvements made:
it would set the selected drum even if it's the same drum that's currently selected. This happens when you audition a kit row for instance. So I added a check to make sure we're not re-selecting the same drum. In that instance the only thing that would happen is a re-rendering of the audition pad (so it lights up when you press it).
it would set the mod controllable when changing the selected drum, even if affect entire is enabled. This did not make sense because with affect entire enabled you cannot control the mod controllable stack of the selected drum. So there is no need to redraw mod led's or set the mod controllable. So I added a check to see if affect entire is enabled. Without check, this call to set the mod controllable would also unnecessarily send midi follow feedback when nothing has changed.
Only redraw clip if the drum being selected is in the currently opened kit clip (for drum selections received through midi, you may be changing the drum selection of a different clip than the current clip selected).
Added check to only set the mod controllable or redraw automation view when you actually changed the selected drum.
These changes should improve performance.