Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add MIDI Button actions and dec/inc trigger modes #767

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

soyersoyer
Copy link

No description provided.

Copy link

Build for testing:
MiniDexed_2024-11-26-cc76937
Use at your own risk.

@diyelectromusic
Copy link
Collaborator

Thanks for submitting this.

Is there a specific reason that the inc/dec only looks for specific values? I don't know how MIDI emulates an encoder, but am guessing having different values enables a "listening" system to distinguish between further rotations compared to a single on-off?

So, a sequence of (say) 64-63-62 would show decreasing - that kind of thing? But we don't seem to be checking the raw value at all against previous values, even though it is logged? Is this why the reset/write(0) has been added?

I wonder if we ought to be registering the changes of value - as written, I'm struggling to see the difference between just registering off<64<on - am I missing something?

If we do add in code to do something with the raw values, should the full range be acted upon? If not, the range should perhaps be configurable, unless there is a MIDI standard way for encoding inc/dec (I haven't looked tbh).

I like to ensure we're not becoming too specific to a particular controller, but a feature like this could support the same from other devices. At some point I'll see if there is any guidance for MIDI encoders (and see what my MiniLab does)...

Thanks,
Kevin

@probonopd
Copy link
Owner

probonopd commented Nov 28, 2024

Let's start with the basics - What do we want to achieve here that is not already possible?

@soyersoyer
Copy link
Author

soyersoyer commented Nov 28, 2024

Arturia encoders can be set to Absolute, Relative 1, Relative 2, Relative 3 modes.

From the Minilab mkII's manual:

Absolute: The default setting for Analog Lab: the knob will send absolute values
from 0-127.
• Relative 1: The knob will send values 61-63 when turned in a negative direction
and values 65-67 when turned in a positive direction. The turn speed determines
the parameter response.
• Relative 2: The knob will send values 125-127 when turned in a negative direction
and values 1-3 when turned in a positive direction. The turn speed determines the
parameter response.
• Relative 3: The knob will send values 13-15 when turned in a negative direction
and values 17-19 when turned in a positive direction. The turn speed determines
the parameter response.

The encoders of AKAI Mpk Mini 3 can also be set to Relative mode, which is the same as the Arturia Relative 1 mode.

The encoder doesn't send other values besides those, so a reset state (0) is necessary to prevent it from staying in INC or DEC state. And that's why the raw value was checked instead of the LOW/HIGH.

It can be extended to support all 3 relative modes.

Copy link

Build for testing:
MiniDexed_2024-11-28-2534d93
Use at your own risk.

@diyelectromusic
Copy link
Collaborator

diyelectromusic commented Nov 28, 2024

Ok, so my view would be that we define a relatively simple behaviour in MiniDexed and then rely on the ability of a MIDI controller to be configured with a mode that supports it.

I think the simplest is to follow the MIDI "standard" for on and off and relate that to being CW/CCW for an encoder - so in that world rather than OFF < 64 <= ON we would have CCW < 64 < CW so anything less than 64 decrements and 64 or above will increment (edit 64 and above is "ON" for standard buttons).

I'm nervous of hard-coding in specific controller mode values - especially the 13-15/17-19 mode which are all "OFF" in normal MIDI controller terms...

If we were to allow some configurability, then again I'd say keep it simple and let the user override an encoders "static" value - i.e. the centre value. That would be 64 by default which would cover both modes 1 and 2 and could be changed to 16 if mode 3 is configured.

This is all assuming we don't do anything with the specific values themselves - e.g. to measure "further away from the centre" as being "it was turned faster" and could (say) inc by 2 or 10 or something - but that is probably a bit OTT for what we need.

Kevin

@probonopd
Copy link
Owner

Agree @diyelectromusic, that'd be a clever way to do it. What worries me most is that all features made for specific hardware may ultimately break with future changes in MiniDexed as I don't have a way to retest them.

@soyersoyer
Copy link
Author

Ok. Customization can be done later if needed.

Copy link

Build for testing:
MiniDexed_2024-11-28-aa89b43
Use at your own risk.

@probonopd
Copy link
Owner

...now the question... will it work? :)

@soyersoyer
Copy link
Author

Now, yes.

Copy link

Build for testing:
MiniDexed_2024-11-28-33d89f4
Use at your own risk.

@probonopd
Copy link
Owner

Let's not change the defaults in minidexed.ini, shall we?

@soyersoyer
Copy link
Author

soyersoyer commented Nov 28, 2024

I think yes, because empty trigger is mapped to BtnTriggerNone in CUIButton::triggerTypeFromString().
For backward compatibility, this can be changed for MIDI buttons, but that won't be consistent.

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.

3 participants