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?
March 28, 2018 at 8:46 pm
#83202
you mean to send the patch name?
here’s the code i’ve seen and used for that (Possemo’s, i think),
this is for sending the name to a label, so you’ll have to fiddle
with it, but it’s got the elements in it (been a while since i looked
at it)
-- Called when a modulator value changes
enterToneName = function(mod, value)
-- This variable stops index issues during panel bootup
if panel:getRestoreState() == true or panel:getProgramState() == true then
return
end
-- //////////////////////////// RETRIEVING PATCH NAME ///////////////////////////////
-- we take the text from the LCD_Text modulator and convert it to Lua type of string, that's why
-- there is the L() macro, otherwise we'd get a String() instance, that might not work well with
-- the native Lua library
NewPatchName = L(panel:getModulatorByName("lcd_ToneName"):getComponent():getProperty("uiLabelText"))
-- Store each character in variable --and convert it from ASCII to numerical code
character1 = string.byte(NewPatchName,1)
character2 = string.byte(NewPatchName,2)
character3 = string.byte(NewPatchName,3)
character4 = string.byte(NewPatchName,4)
character5 = string.byte(NewPatchName,5)
character6 = string.byte(NewPatchName,6)
character7 = string.byte(NewPatchName,7)
character8 = string.byte(NewPatchName,8)
character9 = string.byte(NewPatchName,9)
character10 = string.byte(NewPatchName,10)
-- insert space for empty characters --or method crashes at nil value
if character1 == nil then character1 = "32" else character1 = ""..character1 end
if character2 == nil then character2 = "32" else character2 = ""..character2 end
if character3 == nil then character3 = "32" else character3 = ""..character3 end
if character4 == nil then character4 = "32" else character4 = ""..character4 end
if character5 == nil then character5 = "32" else character5 = ""..character5 end
if character6 == nil then character6 = "32" else character6 = ""..character6 end
if character7 == nil then character7 = "32" else character7 = ""..character7 end
if character8 == nil then character8 = "32" else character8 = ""..character8 end
if character9 == nil then character9 = "32" else character9 = ""..character9 end
if character10 == nil then character10 = "32" else character10 = ""..character10 end
panel:getComponent("label_ToneNameDest"):setPropertyString("uiLabelText","i11-"..(NewPatchName))
end
end