Needing combo box to output specfic syses strings

Home Forums General Programming Needing combo box to output specfic syses strings

Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #72402
    memorysplice
    Participant
      • Topics: 14
      • Replies: 59
      • Total: 73

      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 f7

      how do I get a combo box to output different sysex messages of different lengths?

      #72404
      human fly
      Participant
        • Topics: 124
        • Replies: 1070
        • Total: 1194
        • ★★★★

        you 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.

        #72405
        memorysplice
        Participant
          • Topics: 14
          • Replies: 59
          • Total: 73

          Trade 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.

          #72415
          Puppeteer
          Participant
            • Topics: 16
            • Replies: 185
            • Total: 201
            • ★★

            In 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.au

            #72416
            memorysplice
            Participant
              • Topics: 14
              • Replies: 59
              • Total: 73

              That seems simple enough. Thank you!

              #72417
              human fly
              Participant
                • Topics: 124
                • Replies: 1070
                • Total: 1194
                • ★★★★

                here’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’ 🙂

                https://app.box.com/s/sweo2yz5qn0iqxg2fkfv4w2xup8stxb7

                #72418
                human fly
                Participant
                  • Topics: 124
                  • Replies: 1070
                  • Total: 1194
                  • ★★★★

                  cleaned 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’ …)

                  #72423
                  human fly
                  Participant
                    • Topics: 124
                    • Replies: 1070
                    • Total: 1194
                    • ★★★★

                    ok 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?

                    #72424
                    memorysplice
                    Participant
                      • Topics: 14
                      • Replies: 59
                      • Total: 73

                      Thank you both for helping out. When I have a moment I will try this out and report back.

                      #72432
                      human fly
                      Participant
                        • Topics: 124
                        • Replies: 1070
                        • Total: 1194
                        • ★★★★

                        don’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)

                      Viewing 10 posts - 1 through 10 (of 10 total)
                      • The forum ‘Programming’ is closed to new topics and replies.
                      There is currently 0 users and 45 guests online
                      No users are currently active
                      Forum Statistics
                      Threads: 2,495, Posts: 17,374, Members: 77,605
                      Most users ever online was 12 on January 22, 2019 3:47 pm
                      Ctrlr