April 19, 2024, 11:45:53 pm
Welcome, Guest. Please login or register
News:

Arturia Forums



Author Topic: Midi-mapped hardware buttons cannot toggle interface buttons.  (Read 1185 times)

Fragoletta

  • Apprentice
  • *
  • Posts: 4
  • Karma: 0
Midi-mapped hardware buttons cannot toggle interface buttons.
« on: December 31, 2019, 03:49:47 pm »
I have a midiplus keyboard with 6 assignable buttons, and I'd like to use them to perform various tasks on the interface. Specifically, I'd like one to switch engine 1 on and off, one to switch filter 1 on and off (and similarly for engine 2 and filter 2).

Mapping the buttons isn't a problem. But each button sends two midi signals: a 127 value when pressed and a 0 value when released. From what I can tell, the 127 sets the engine/filter to off, and the 0 sets it on again. So, if an engine is on, pressing the button turns it off until the button is released, at which point it comes on again. If an engine is off, pressing the button does nothing, but releasing it turns it on. There doesn't seem to be a way to make a button just change the status of the engine and leave it changed when released.

I don't think there's a fix for this outside Pigments itself, because there's nowhere in the keyboard or midi pipeline to keep track of the current engine on/off status. In Pigments itself, the fix would involve taking the 127 value and using it to toggle the engine from on to off, or vice-versa, and ignoring the 0 value.

I thought I'd start by asking here, to see if I'd missed something, or if anyone had a suggestion other than raising a feature request. Thanks.

[Edited to add: I got round this by writing an AppleScript in midipipe which, in effect, changed the buttons on my controller from gate mode to toggle mode. Script example in a reply below.]
« Last Edit: January 01, 2020, 01:15:25 am by Fragoletta »

LBH

  • Hero Member
  • *****
  • Posts: 4.920
  • Karma: 261
Re: Midi-mapped hardware buttons cannot toggle interface buttons.
« Reply #1 on: December 31, 2019, 04:44:53 pm »
Hi and welcome to Arturia forums.

This is about how your controllers buttons can work. It look like your buttons is set to a gate mode and not a toogle mode.

Please refer to your specific Midiplus models manual, to see if and how you can change the buttons functionality. I think it's different from model to model, what you can do.

Happy new year.

Fragoletta

  • Apprentice
  • *
  • Posts: 4
  • Karma: 0
Re: Midi-mapped hardware buttons cannot toggle interface buttons.
« Reply #2 on: December 31, 2019, 05:35:35 pm »
Hi LBH: thank you so much for your welcome, and happy new year to you, too.

Alas, I don't think I can do that with my controller, but if I could, how would it work? I double-checked by mapping a knob instead of a button to the on/off: turn to anything less than 64 and it turns on; turn to 64 or more and it turns off. So any button on my controller couldn't just send the same, single value to the on/off: it would have to know the engine was on and send a 64 or more, or know it was off and send a 63 or less.

Ah, well. It doesn't surprise me that a more expensive controllers can do more complicated things.

(Luckily my controller does work with the left/right patch select mapping because there the press-sent 127 has an effect and the release-sent 0 is just ignored.)

Thanks again for your quick, helpful response.

LBH

  • Hero Member
  • *****
  • Posts: 4.920
  • Karma: 261
Re: Midi-mapped hardware buttons cannot toggle interface buttons.
« Reply #3 on: December 31, 2019, 06:10:09 pm »
Thanks Fragoletta.

A button can have multiple functionality. In eaxample the gate and simple toggle i mentioned.
- When in gate mode the button send out one value when down and another value when up, just like you describe.
- When in simple toggle mode the button switch between the two possible values for each press or release. It does'nt send out one value when you press and another value when you release the button.
Keep in mind that you need a value to activate and another value to deactivate something like a filter, when there only is one button for this.

Fragoletta

  • Apprentice
  • *
  • Posts: 4
  • Karma: 0
Re: Midi-mapped hardware buttons cannot toggle interface buttons.
« Reply #4 on: December 31, 2019, 06:55:57 pm »
Yes. I thought I might see if I could write a midipipe script to do something similar, and turn my gate into a toggle that way. The only thing that that can't deal with (and I don't think it could even if it were a toggle on the controller itself) is knowing the initial state of the engine. So, the toggle could send 127 when first pressed, then 0 the next time, then 127, and so on. But if the engine is already off, the first press won't do anything. (And if the first send were to be a 0, then the same problem occurs if the engine is initially on, of course.) Still, that's not really any different from (un-motorized) knobs and faders, I suppose: there's always an initial movement necessary to get them in sync.

Thanks again, LBH.


Fragoletta

  • Apprentice
  • *
  • Posts: 4
  • Karma: 0
Re: Midi-mapped hardware buttons cannot toggle interface buttons.
« Reply #5 on: December 31, 2019, 07:59:28 pm »
Pleased to say that I cobbled together this midipipe AppleScript Trigger which turns the controller gate mapped to cc22 into a toggle which swaps between sending 127 and 0 on each press. The release message is not sent. (Ignore the use of "my minutes" as a variable: it's a kludge to get past some AppleScript limitations.)

on runme(message)
   -- if control key
   if (item 1 of message = 176) then
      -- if cc 22
      if (item 2 of message = 22) then
         -- if pressed
         if (item 3 of message = 127) then
            -- look at my minutes and act accordingly
            if (my minutes = 127) then
               set my minutes to 0
            else
               set my minutes to 127
            end if
            set (item 3 of message) to my minutes
            return message
         -- if released do nothing
         end if
      -- if not cc 22 then pass through
      else
         return message
      end if
   -- if not control key then pass through
   else
      return message
   end if
end runme
« Last Edit: December 31, 2019, 09:18:36 pm by Fragoletta »

LBH

  • Hero Member
  • *****
  • Posts: 4.920
  • Karma: 261
Re: Midi-mapped hardware buttons cannot toggle interface buttons.
« Reply #6 on: January 01, 2020, 03:54:30 pm »
Great if you have found a way that will work for you.

Cheers

 

Carbonate design by Bloc
SMF 2.0.17 | SMF © 2019, Simple Machines