Patch Name to uiCDLabel

Home Forums General Programming Patch Name to uiCDLabel

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13065
    lfo2vco
    Participant
      • Topics: 26
      • Replies: 162
      • Total: 188
      • ★★

      Hi, I know this is a bit of an old chestnut and there is a resolved case over at:

      [resolved] uiLabel to display/edit program names

      However I have been through the methods over there and still cannot get any of them to work in this instance. Atom very kindly showed me how to view my patch name in the console, grabbing it from an incoming Buffer Dump thus:

      nameData = midiMessage:getData():getRange(1,138)
      nameChar = nameData:getRange(7,23)
      console (nameChar:getRange(2,16):toString()) -- 2 null bytes

      I may have altered Atom’s method slightly, I cannot remember! Anyway the result comes back thus: LUA>> Low Strings

      I wish to get this result into a uiCDLabel called “Patch Label”… any help as always very appreciated.

      Here is some noise I organised into an acceptable format:
      https://soundcloud.com/lfo2vco/a-dark-crystal

      #13072
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        it’s like any other component, just set it’s property, if your LCD Label is named “lcd” and you want to to display “myText”

        l = panel:getComponent("lcd")
        if l ~= nil then 
             l:setProperty ("uiLabelText", "myText", false) 
        end
        
        #13082
        lfo2vco
        Participant
          • Topics: 26
          • Replies: 162
          • Total: 188
          • ★★

          Thanks Atom, still found it a struggle but got there in the end with:

          nameData = midiMessage:getData():getRange(1,138)
          nameRange = nameData:getRange(7,23)
          nameLabel = panel:getComponent("Patch Label")
          
          console (nameRange:getRange(2,16):toString())
          
          if nameLabel ~= nil then 
              	nameLabel:setProperty ("uiLabelText", (nameRange:getRange(2,16):toString()), false)
          
          	end
          
          end

          What I didn’t realise was that I could put (nameRange:getRange(2,16):toString()) where you had “myText”. That’s down to my very limited knowledge of Lua and coding in general.

          Here is some noise I organised into an acceptable format:
          https://soundcloud.com/lfo2vco/a-dark-crystal

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The forum ‘Programming’ is closed to new topics and replies.
        There is currently 0 users and 62 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