Results 1 to 6 of 6

Thread: LSX Intensity by midi button input question. Need help!

  1. #1
    Join Date
    Sep 2015
    Posts
    14

    Default LSX Intensity by midi button input question. Need help!

    HI everyone!


    I have a quick and maybe dumb question about changing layers intensity in LSX using a midi pad.
    I have 2 layers of the same size and I want to turn off/on them using a midi button as input. When I use the potentiometers, it works fine. I just use the expression midi(whatever pot). The problem is that I canīt use the buttons for the same task. Do I have to make a little operation for making them work? Do I have to convert the midi button value to some kind of boolean? My midi buttons are configured to a 0 when off and 127 when on. I would want to use them as momentary buttons and sometimes as toggle ones. Any tips about this?


    Cheers!
    Last edited by Hamill; 11-06-2015 at 09:54.

  2. #2
    Join Date
    Jul 2008
    Location
    My momentum is too precisely determined :S
    Posts
    1,777

    Default

    Do your buttons show up as notes/keys in the midi setup window or do they appear as controls? If they appear as keys you can remap them to a control and then you can use them again with the midi() expression. When the button is on the midi expression should be equal to 1.

  3. #3
    Join Date
    Sep 2015
    Posts
    14

    Default

    In LSX midi settings I see the pot (is working as expected) as STATUS:Control KEY: 3 and the button is STATUS: ON KEY: 48.

    In my midi settings software I can change the button MODE to Toggle or momentary en the TYPE to: Note, Program or Program Bank.

    Where do I have to remap them in LSX or the midi setup software?

    Thanks!

  4. #4
    Join Date
    Sep 2015
    Posts
    14

    Default

    I found that the keyboard expression "keyboard(key code)" is doing what I need but only as momentary switch.

  5. #5
    Join Date
    Jul 2008
    Location
    My momentum is too precisely determined :S
    Posts
    1,777

    Default

    Looks like your buttons are indeed being sent as keys instead of controls. You can remap this in LSX by going to MIDI setup, scroll down to control 48 (for example) in the LSX Action column, and change type to key (and make sure key# is also 48). Now, incoming key messages should be treated as controller change messages (for key 48), so you can use them with the midi(48) expression. Selecting Control 48 and clicking Automap then hitting the button on your MIDI controller should have the same result.

    Maybe there is a way to do this in your MIDI controller system, whatever you think is easiest to do.

    If you like keyboard() more, or your MIDI button doesn't stay active, or whatever, you can use an expression like this:

    Code:
    a = keyboard(17);
    if(bnot(equal(b, a)) * a , assign(c, 1-c), 0);
    b = a;
    result=c
    In this code, "bnot(equal(b, a))" detects if you pressed or released the control key (so in this part of the expression, a and b would be different). This gets multiplied by a so it only works when you press the control key, not when you release it. If this condition is true (= equal to one, there are no booleans in LSX, that's why you can multiply instead of doing AND for example) then it assigns 1 to c if it is 0 or vice versa. The result is then c.

  6. #6
    Join Date
    Sep 2015
    Posts
    14

    Default

    Thanks for the code! Is working perfectly. Still no luck with the midi. I will keep trying

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •