Home › Forums › General › Programming › Needing combo box to output specfic syses strings
Tagged: build string
- This topic has 9 replies, 3 voices, and was last updated 6 years, 8 months ago by human fly.
-
AuthorPosts
-
June 27, 2017 at 12:16 am #72402
I have a combo box with different sized sysex strings that I need to link to specific values.
contents of box
aa = f0 00 00 01 z5 f7
bb = f0 00 00 11 23 05 z5 f7
cc = f0 10 00 00 00 z5 f7
dd = f0 00 10 10 00 00 00 00 00 78 z5 f7how do I get a combo box to output different sysex messages of different lengths?
June 27, 2017 at 5:51 am #72404you would want a lua method with the specific message
to send being called by each combo value
ie: if combo == 0 etc then send midi message etc.those don’t look like proper sysex messages btw.
aa,bb,cc,dd are normally used in manuals to denote
ie: address bytes, where they’ll be replaced by the
actual bytes.June 27, 2017 at 8:58 am #72405Trade out the aa bb cc dd for any type of parameter, for instance, they could be fx slot effect types that correspond to only certain types of fx.
I figured it would be a Lua method but I am not sure where to even begin.
June 29, 2017 at 3:54 am #72415In the combo box controls on the right, there is a field called OnValuechange
You need to have the name of your method here.The method will pretty much be
If combobox == value then
SendMIDINow(sysexString1)
elseif
combobox == value2 then
…The Puppeteer
http://godlike.com.auJune 29, 2017 at 5:20 am #72416That seems simple enough. Thank you!
June 29, 2017 at 9:18 am #72417here’s a little bpanelz i’ve been messing around with
whilst figuring out ways of handling writing text to
modulators, and building a string. hope it loads ok
at your end. (nb: it’s a bit ‘long’ where i repeat
the text to write to labels; suppose there’s a way
to get at table items directly?)there’s one box that just preloads some stuff, and
a second box which puts together strings. a little
‘practical’ 🙂June 29, 2017 at 12:18 pm #72418cleaned that up a bit:
https://app.box.com/s/sweo2yz5qn0iqxg2fkfv4w2xup8stxb7
(unfortunately boxnet no longer displays download count
so you can’t see if/how many – they claim it is a ‘bug’
with their new interface – where you can pay for a pro
service, but they do not say that they have removed
download count from ‘free’ account features, just that
they are ‘looking into it’ …)June 29, 2017 at 7:54 pm #72423ok i tried to start another thread to deal with this
but i know how it is, won’t get any takers, quieter
than a morgue around here.forgive me for hijacking thread, Mr OP, but you’ve
got what you need 🙂 i believe, and i’d like to take
this a bit further (quite rightly, this is all good
stuff)i’m currently interested in ways of getting/fetching
data and putting it somewhere else. particularly
building strings. i’m sure this is dealt with in really
uninspiring ways on the standard lua sites, and i’m
getting my info trawling panels instead – which leaves
some gaps in my education but seems to get things
happening reasonably quickly.first off, i thought this was interesting, build a string
from a table:(in fact this is a combination of 2 methods)-- //////////////////////////// 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("label_ToneNameDisplay"):getComponent():getProperty("uiLabelText")) console("Retreiving Patch name from LCD Text") -- 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) -- collect panel byte values nameBytesTab={} nameBytesTab[1] = character1 nameBytesTab[2] = character2 nameBytesTab[3] = character3 nameBytesTab[4] = character4 nameBytesTab[5] = character5 nameBytesTab[6] = character6 nameBytesTab[7] = character7 nameBytesTab[8] = character8 nameBytesTab[9] = character9 nameBytesTab[10] = character10 -- Concat table values to one string with space between values local nameDatas=table.concat(nameBytesTab," ",1,10) -- Initialize a memory block for datas to save local dataToWrite=MemoryBlock(nameDatas) --send to window if dataToWrite:getSize()>=0 then panel:getComponent("label_ToneNameDest"):setPropertyString("uiLabelText",(nameDatas)) end
it may be missing an ‘end’ there. this takes the text entry for 10
characters in the source label, and writes to the destination lable
their numerical values in decimal, as a string, separated by a space.
– don’t know what you’d use it for, in that form, but it works-
i really wanted to just pick up the same characters, as individual
items, and put them back together again as the destination label
string, as characters again.i really need a ‘double-click’ box, a label i can doubleclick to call
up a dialog where i enter 10 characters.Question ! how does it ‘know’ that the string.bytes are numerical
values, and how does it know what those are?June 30, 2017 at 12:22 am #72424Thank you both for helping out. When I have a moment I will try this out and report back.
June 30, 2017 at 10:35 pm #72432don’t take too much notice of my version 🙂 i’m figuring
things out. turns out you can have typed entry on any label,
it is a set of parameters at the bottom of the page.
getting the characters as ascii values is neat though, as
that’s what the device wants to receive (still haven’t
figured out why/how it is converted) -
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.