markusschloesser / MackieC4_P3

A Mackie C4 Midi Remote Script for Ableton 11
20 stars 2 forks source link

vpot handling for params with discrete states/steps #64

Closed markusschloesser closed 3 years ago

markusschloesser commented 3 years ago

lots of plug-ins have params with only 2 or 3 states (on/off, high/low) or an only limited step amount of discrete steps. Currently one has to really work hard on the vpot (twisting it multiple times) to toggle between those. Enhancement: introduce a better way of handling those by:

  1. use vpot press for toggle parameters advantage: intuitive, fast disadvantage: this gesture is currently reserved for returning a param to its default state
  2. scale the vpot rotation to not have all range available, but only a range of len(amount of steps available for this param). This is how the "Device on/off" works already. advantage: works for more than 2 steps, doesn't mess with default param value

I think 2 is the way to go, but might be harder to implement

markusschloesser commented 3 years ago

From the ableton live 8 manual section for the mcu: "The Mackie Control's V-Pots have dual functionality in many cases, as they can be both rotated and pressed. When being used to adjust single parameters (those belonging to track devices, for example), pressing a V-Pot returns a control to its default value. Pressing a V-Pot when dealing with a control that has various options (filter type choosers, for example), selects the options in sequence. With controls having only two options (e.g., an on/off switch) pressing a V-Pot toggles the options."

BilldarBagdar commented 3 years ago

We could definitely do that with the C4 Commander layouts, you could define exactly how many steps each encoder was mapped to (and what the mapped values are (because it's always a finite set of values in that situation)

I'm not sure, if we can do the same thing with this script. You certainly can't do it the same way. I wonder if we can maybe use the various "encoder LED options" to reduce the spread. The thing is we are getting the values from Live, we don't know if it's a toggle, a radio button, or an "endless" value like Pan or Volume, ahead of time. We just have the value Live gives us to display for the encoder. I will check out the MCU script to see if I can find the code that implements the above, "Pressing a V-Pot when dealing with a control that has various options (filter type choosers, for example), selects the options in sequence. With controls having only two options (e.g., an on/off switch) pressing a V-Pot toggles the options." I'm curious to see "how it knows".

Also, do you know the encoders respond to the speed with which you turn the knobs. Have you tried twisting single-click-at-a-time on those parameters.

markusschloesser commented 3 years ago

found it! It's in channelstripcontroller.py and the code is

    def handle_pressed_v_pot(self, strip_index, stack_offset):
        if not (self._ChannelStripController__assignment_mode == CSM_VOLPAN or self._ChannelStripController__assignment_mode == CSM_SENDS):
            if not self._ChannelStripController__assignment_mode == CSM_PLUGINS or self._ChannelStripController__plugin_mode == PCM_PARAMETERS:
                if stack_offset + strip_index in range(0, len(self._ChannelStripController__channel_strips)):
                    param = self._ChannelStripController__channel_strips[(stack_offset + strip_index)].v_pot_parameter()
                elif param:
                    if param.is_enabled:
                        if param.is_quantized:
                            if param.value + 1 > param.max:
                                param.value = param.min
                            else:
                                param.value = param.value + 1
                        else:
                            param.value = param.default_value

will try tomorrow

markusschloesser commented 3 years ago

works for both vpot press and vpot turn