Home › Forums › General › Panels, Components, Macros › Trigger Button for UIimageButton ?
- This topic has 7 replies, 3 voices, and was last updated 7 years, 1 month ago by goodweather.
-
AuthorPosts
-
October 18, 2013 at 10:20 am #14287
Trigg on mouse down event
Could be very cool …..March 21, 2017 at 6:42 am #71710+1
March 21, 2017 at 12:40 pm #71712What do you exactly mean? This is already possible…
March 21, 2017 at 8:09 pm #71715Thanks 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=127but 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.
March 21, 2017 at 9:15 pm #71719Ha 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 messageDid you try that?
March 22, 2017 at 1:03 am #71720March 22, 2017 at 1:34 am #71723Ah I just found your DSI Pro2 panel. Wonderful!
March 22, 2017 at 9:46 pm #71724OK. 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!
-
AuthorPosts
- The forum ‘Panels, Components, Macros’ is closed to new topics and replies.