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

Radio Button Selection, for example for Banks #263

Closed
vonglan opened this issue Mar 27, 2021 · 4 comments
Closed

Radio Button Selection, for example for Banks #263

vonglan opened this issue Mar 27, 2021 · 4 comments
Labels
bug Something isn't working high priority

Comments

@vonglan
Copy link

vonglan commented Mar 27, 2021

In a Controller Mapping, I would like to configure a group of buttons to work like radio buttons, for example for Bank Selection. Especially, I would like the selected button (and only the selected) to light up (via ReaLearn feedback).

Described more technically: I would like to define a "radio button group" (maybe implemented with mapping groups), for example with mappings for 8 illuminated buttons in a row on my controller. ReaLearn should then send feedback automatically as follows: Whenever I press one of the buttons in the group, this button should receive a feedback value of 1 or 127 (configurable). All the other buttons in that group (or at least the one most recently selected) should receive 0. (While the button should send the Bank Number to a virtual target - this is already possible.)

(To be used for #205 with controllers like the X-Touch Mini)

@helgoboss helgoboss added the question Further information is requested label Mar 27, 2021
@helgoboss
Copy link
Owner

helgoboss commented Mar 27, 2021

This is already possible.

One thing important to understand is that ReaLearn never sends "light on/off" commands to devices just for the sake of having a good light show. The "light on/off" commands are always generated as a reaction to things that happen within REAPER, e.g. FX parameter value changes, change playback cursor position etc. - and therefore your controller will always reflect the current state of REAPER. That's true MIDI feedback: It feeds the state of REAPER back to your controller.

Therefore the question is, what do you actually want to control using these radio buttons? If you really just want a light show, you can "abuse" an internal ReaLearn FX parameter:

{
  "version": "2.8.0-pre6",
  "id": "aJHI3LHL",
  "controlDeviceId": "3",
  "feedbackDeviceId": "4",
  "defaultGroup": {},
  "defaultControllerGroup": {},
  "mappings": [
    {
      "id": "483e4887-6f25-423f-8e86-9a93287044dd",
      "name": "1",
      "source": {
        "type": 1,
        "channel": 0,
        "number": 64,
        "isRegistered": false,
        "is14Bit": false,
        "oscArgIndex": 0
      },
      "mode": {
        "minTargetValue": 0.01,
        "maxTargetValue": 0.01,
        "outOfRangeBehavior": "min"
      },
      "target": {
        "fxAnchor": "this",
        "useProject": true,
        "moveView": true,
        "seekPlay": true
      }
    },
    {
      "id": "19157dac-5f2a-4057-bf10-6b2887cfdd3f",
      "name": "2",
      "source": {
        "type": 1,
        "channel": 0,
        "number": 65,
        "isRegistered": false,
        "is14Bit": false,
        "oscArgIndex": 0
      },
      "mode": {
        "minTargetValue": 0.02,
        "maxTargetValue": 0.02,
        "outOfRangeBehavior": "min"
      },
      "target": {
        "fxAnchor": "this",
        "useProject": true,
        "moveView": true,
        "seekPlay": true
      }
    },
    {
      "id": "291c7b0a-d44c-46c0-9240-0d688a8b390b",
      "name": "3",
      "source": {
        "type": 1,
        "channel": 0,
        "number": 66,
        "isRegistered": false,
        "is14Bit": false,
        "oscArgIndex": 0
      },
      "mode": {
        "minTargetValue": 0.04,
        "maxTargetValue": 0.04,
        "outOfRangeBehavior": "min"
      },
      "target": {
        "fxAnchor": "this",
        "useProject": true,
        "moveView": true,
        "seekPlay": true
      }
    }
  ],
  "parameters": {
    "0": {
      "value": 0.01
    }
  }
}

Just use "Import from clipboard" and learn the sources to your LED buttons.

In this example:

  • ReaLearn's "Main param 1" represents the radio button group.
  • Its value 1 represents the first radio button.
  • Its value 2 represents the second radio button.
  • Its value 4 represents the third radio button.

One secret is to set "Out-of-range behavior" to "Min" (which makes the light turn off if the target value is not within Target min/max). If you choose "Min or max", you get an "LED Fader" instead which can sometimes also be nice.

The reason why I chose value 4 and not 3 for the third radio button is that it for some reason didn't work with 3. Might be a bug related to rounding. That's why I leave this issue open for now.

@helgoboss helgoboss added bug Something isn't working high priority and removed question Further information is requested labels Mar 27, 2021
@vonglan
Copy link
Author

vonglan commented Mar 27, 2021

It's working with the "min" setting. That's a very useful trick! Should be mentioned in the manual (I can write something, if you want - although it seems you're very good at writing text as well. One important point: Banks (Programs in the GUI) must start with 1. Zero does not work with this trick).
I did not understand what you mean with "light show". I think my use case is quite basic (Banks with direct selection instead of next/previous) and not about a fancy light show.
Not sure whether the error about "3" is about rounding. 2.9 and 3.1 did not work.

@helgoboss
Copy link
Owner

It's working with the "min" setting. That's a very useful trick! Should be mentioned in the manual (I can write something, if you want - although it seems you're very good at writing text as well. One important point: Banks (Programs in the GUI) must start with 1. Zero does not work with this trick).

Okay, will look into it tomorrow.

I did not understand what you mean with "light show". I think my use case is quite basic (Banks with direct selection instead of next/previous) and not about a fancy light show.

By "light show" I meant switching lights on and off for the sake of the lights itself. I'm sure you want something in REAPER or ReaLearn to change when you press these buttons, right? Or do you really just want lights to go on and off!?

My point is: ReaLearn doesn't send MIDI feedback in direct response to button presses. It sends MIDI feedback in response to changes in REAPER. I have the feeling most users don't get this important core fact about ReaLearn. I'm probably using too complicated words to explain it. If you understand it and you have a good metapher/analog, I'm really interested in it. This needs to be the first sentence in the "Feedback" section of the user guide. I need people to understand the feedback concept, otherwise they will get many surprises.

@vonglan
Copy link
Author

vonglan commented Mar 29, 2021

By "light show" I meant switching lights on and off for the sake of the lights itself. I'm sure you want something in REAPER or ReaLearn to change when you press these buttons, right? Or do you really just want lights to go on and off!?

No, the buttons select the Bank Number (with one button for each Bank, not via increment/decrement). This is the primary goal. The secondary goal is that the user should also see on the controller, which Bank he selected (like with old-fashioned radio buttons - see here ).

My point is: ReaLearn doesn't send MIDI feedback in direct response to button presses. It sends MIDI feedback in response to changes in REAPER. I have the feeling most users don't get this important core fact about ReaLearn. I'm probably using too complicated words to explain it. If you understand it and you have a good metapher/analog, I'm really interested in it. This needs to be the first sentence in the "Feedback" section of the user guide. I need people to understand the feedback concept, otherwise they will get many surprises.

I think the section about Feedback is quite clear.
Only at the beginning

(controller to REAPER) and feedback (REAPER to controller)

I would replace "REAPER" with "REAPER or Track FX parameter".

I also think, the following little extension in the introduction, 3.1, would be good:

ReaLearn's approach is quite different: It gives you total control on which control element operates which REAPER parameter and provides you with a learn function which allows you build your own control mappings quickly and intuitively without writing configuration files.

REAPER parameters can be, for example:

  • Reaper-internal parameters, like a track's volume
  • Parameters that are offered by the "track FX" loaded in Reaper's tracks, e.g. "Rate" of a delay effect, or "Cutoff" of a software synthesizer
  • Reaper actions

All of that on a per-instance basis. That's right, the ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority
Projects
None yet
Development

No branches or pull requests

2 participants