Skip to content

Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu - #963

Merged
seangoodvibes merged 6 commits into
SynthstromAudible:communityfrom
seangoodvibes:Add-Midi-Select-Kit-Row-Default-Setting
Jan 14, 2024
Merged

Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu#963
seangoodvibes merged 6 commits into
SynthstromAudible:communityfrom
seangoodvibes:Add-Midi-Select-Kit-Row-Default-Setting

Conversation

@seangoodvibes

@seangoodvibes seangoodvibes commented Jan 13, 2024

Copy link
Copy Markdown
Collaborator

Added new Select Kit Row menu to the Midi Defaults menu in Settings > MIDI > Select Kit Row

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 as the drum selection changes.

Refactored InstrumentClipView::SetSelectedDrum to improve it and enable its use with midi.

Improvements made:

  1. 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).

  2. 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.

  3. 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).

  4. Added check to only set the mod controllable or redraw automation view when you actually changed the selected drum.

These changes should improve performance.

@seangoodvibes seangoodvibes changed the title Enhancement / MIDI Defaults ~ Add Midi Select Kit Row Default Menu Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu Jan 13, 2024
@seangoodvibes seangoodvibes added this to the Release 1.1 milestone Jan 13, 2024
@seangoodvibes seangoodvibes changed the title Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu [DRAFT] Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu Jan 13, 2024
@seangoodvibes
seangoodvibes marked this pull request as draft January 13, 2024 05:08
@seangoodvibes
seangoodvibes force-pushed the Add-Midi-Select-Kit-Row-Default-Setting branch 2 times, most recently from 33ff41e to 6477def Compare January 13, 2024 22:33
@seangoodvibes seangoodvibes changed the title [DRAFT] Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu Jan 13, 2024
@seangoodvibes
seangoodvibes marked this pull request as ready for review January 13, 2024 22:33
Comment thread src/deluge/model/instrument/kit.cpp Outdated
Comment thread src/deluge/model/instrument/kit.cpp Outdated
//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) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you call instrumentClipView::setSelectedDrum instead? There's a bunch of duplicated logic here

@seangoodvibes seangoodvibes Jan 14, 2024

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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).

  2. 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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@seangoodvibes seangoodvibes changed the title Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu [DRAFT] Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu Jan 14, 2024
@seangoodvibes
seangoodvibes marked this pull request as draft January 14, 2024 00:47
@seangoodvibes
seangoodvibes force-pushed the Add-Midi-Select-Kit-Row-Default-Setting branch from 1eb8dde to 50a3557 Compare January 14, 2024 02:32
@seangoodvibes
seangoodvibes marked this pull request as ready for review January 14, 2024 02:38
@seangoodvibes seangoodvibes changed the title [DRAFT] Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu Jan 14, 2024
@seangoodvibes
seangoodvibes force-pushed the Add-Midi-Select-Kit-Row-Default-Setting branch from d9a81cc to e8dbff9 Compare January 14, 2024 02:44
@seangoodvibes seangoodvibes changed the title Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu [DRAFT] Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu Jan 14, 2024
@seangoodvibes
seangoodvibes marked this pull request as draft January 14, 2024 02:45
@seangoodvibes seangoodvibes changed the title [DRAFT] Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu Enhancement / MIDI Defaults ~ Add Select Kit Row Default Menu Jan 14, 2024
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.
@seangoodvibes
seangoodvibes force-pushed the Add-Midi-Select-Kit-Row-Default-Setting branch from c1420b9 to 8698b99 Compare January 14, 2024 17:08
@seangoodvibes
seangoodvibes marked this pull request as ready for review January 14, 2024 17:08
@seangoodvibes
seangoodvibes added this pull request to the merge queue Jan 14, 2024
Merged via the queue into SynthstromAudible:community with commit 7dbbac1 Jan 14, 2024
@seangoodvibes
seangoodvibes deleted the Add-Midi-Select-Kit-Row-Default-Setting branch February 22, 2024 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants