Home Forums General Panels, Components, Macros Trigger Button for UIimageButton ?

This topic contains 7 replies, has 3 voices, and was last updated by goodweather goodweather 8 months, 3 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #14287
    zeoka
    zeoka
    Participant

    Trigg on mouse down event
    Could be very cool …..

    #71710

    jersmi
    Participant

    +1

    #71712
    goodweather
    goodweather
    Participant

    What do you exactly mean? This is already possible…

    #71715

    jersmi
    Participant

    Thanks for your reply.

    I am having general issues with UIImageButton getting midi back and forth with my host (Plogue Bidule).

    I want to use UIImageButton to send a trigger with a mouse down (as opposed to a gate). If you could help me understand this I would appreciate it.

    (Apologies for the following long post on general issues I am having. I’m a newb.)

    I’m on MacOS 10.12.2
    Ctrlr version 5.3.163 (reverted because of image resource menu not loading issue).

    Currently with UIImageButtons I only get Ctrlr to send CC value 1 and 0 (ON and OFF respectively), so I am using expressions:
    modulatorValue*127 (for output)
    midiValue/127 (for input)

    I tried button values
    OFF=0
    ON=127

    but I was having problems.

    I first tried UIButton, but these appear stuck in OFF state, not sending midi (though color will change, this problem also in atom’s complex expressions demo — button values say OFF and ON, but only show OFF when clicked, and appear to not send the ON value).

    What’s the best way to get buttons stable and running? Is UIImageButton unreliable? Do I need to script these? I’ve been trying a setup first with no scripting, to learn and see how far I get. I’m not a programmer, but I am happy to try, copy/paste and learn as I go, as I see how others have done here.

    (Also confusing behavior using UIImageButton with radio buttons, too — “off” midi output is weird for the buttons (where do I set radio “off” messages?).

    Thanks for any help or guidance you can offer.

    • This reply was modified 8 months, 4 weeks ago by  jersmi.
    • This reply was modified 8 months, 4 weeks ago by  jersmi.
    • This reply was modified 8 months, 4 weeks ago by  jersmi.
    #71719
    goodweather
    goodweather
    Participant

    Ha ok. You want to send a quick ON-OFF.
    I have never done this but I can guess how to do it…
    – I’m using uiImageButton with 2 frames (Led off – Led On). Values are False True
    – Button mode = momentary
    – Called when the modulator value changes: MyButton_OnChange (this is just my syntax, put whatever you want)
    – in that method you could send 2 Midi messages after each other (Lua is very fast) or if needed send one message then start a timer and in that timer send the second message

    Did you try that?

    #71720

    jersmi
    Participant

    Did you try that?

    No but I will now. Can you recommend any panels or references I can dig through for some basics like this?

    Ps. THANK YOU for putting together that step by step guide.

    • This reply was modified 8 months, 4 weeks ago by  jersmi.
    • This reply was modified 8 months, 4 weeks ago by  jersmi.
    #71723

    jersmi
    Participant

    Ah I just found your DSI Pro2 panel. Wonderful!

    #71724
    goodweather
    goodweather
    Participant

    OK. Then I can guide you…
    – start Ctrlr
    – open my panel and create a new panel or open yours
    – select Panel – Lua editor
    – Create a group Panel methods and a method Miscellaneous
    – copy/paste the code from my method of the isPanelReady = function() in that method
    – Compile the method and save your panel
    – Create a method called Timers
    – copy only the top of my Timers method (in case you will need a timer)

    function timerCallback(timerId)

    if timerId == 1 then
    timer:stopTimer(timerId)
    end
    end
    – Compile the method and save your panel
    – create a button in your panel and look at what I did for example for the buttons in the Programs info tab
    – you can take my image from the your_user/appdata/roaming/ctrlr/ some cryptic string folder. Each panel gets a temp folder where the current images are stored. One of those will contain my images…
    – add the image as resource and check it is displayed
    – save your panel
    – to send Midi messages, look at RequestProgramDump under Midi methods group
    – try sending something and check if your synth sees it
    – if you need a timer, look at Juce to find which methods to use (I gave the link in the step by step guide)

    Good luck!

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Comments are closed.