Home › Forums › General › Programming › How to get label content and send it via SysEx? › Reply To: How to get label content and send it via SysEx?
you can do this but i foresee a problem if the user enters
a non-number character ie: won’t be a number you can convert to hex
(maybe someone can come up with a filter to exclude alphabet
characters)
oh dear, i’ll have a go..
off top of head, you’d fetch the text with something like this.
someone else can fill in/correct?
function myFetchTextToHex () --[ when modulator value changes ]--
local myValue = nil --[ initialise local variables ]--
local myHexVal = nil
myValue = panel:getComponent("myLabel"):getProperty("uiLabelText")
--console(String(myValue)) --[ see what you've got, will return a 'string' ]--
myHexVal = string.format("%.2X",myValue)
--console(String(myHexVal)) --[ see what you've got ]--
end
it’s probably wrong 🙂
this is the 1st part. then you have to build the midi message, where
you’d insert myHexVal
where you want your value. gets a whole lot
more complicated of course if it’s more than 0-127 value range, or
exotic value ranges.
why not have a ‘combo’ with a dropdown list of displayed values?