update panel on dump request using Lua

Home Forums General Programming update panel on dump request using Lua

Viewing 12 posts - 21 through 32 (of 32 total)
  • Author
    Posts
  • #2943
    Filch
    Participant
      • Topics: 22
      • Replies: 173
      • Total: 195
      • ★★

      I’ve been updating the script from the Midi Example to update the Blofeld. I’ve not yet gotten it to work, so I’ve started troubleshooting. I’ve eliminated all the code except for the midiMessageReceived function. I’m going to work my way down from there making sure each part works.
      The code works as expected when dumping the program data from my Mopho as you’ve designed. I attempt to do the same thing for the Blofeld dump (changing the expected midi message size for program dump) and I get nothing.

      So I’ve made the midiMessageReceived REALLY simple , to just show me what the value of the getSize was to the LUA console, to make sure I have my message size right. And I can’t get it to work. This is bad news if I’m starting to hit road blocks at this juncture :-p.

      [code:2lesgvnh]
      midiMessageReceived = function(midiMessage)

      console("I saw some midi")
      s = midiMessage:getSize()
      console("I got the size of the message, here it is :")
      console(s)
      end
      [/code:2lesgvnh]

      I get an error here. I see in the console everything up to "here it is : " but no value of in the console of the getSize variable. What OBVIOUS thing am I missing here. :roll:

      -edit-
      Hanging out in IRC channel now from time to time if anyone is interested in chatting

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

        console() takes a string argument, if you want to print out formatted data use
        [code:25vr8h2b]
        console (string.format ("this is a string: %s this is a number: %d", string, number))
        [/code:25vr8h2b]

        or you can try

        [code:25vr8h2b]
        console ("this is a number: "..number)
        [/code:25vr8h2b]

        #2945
        Filch
        Participant
          • Topics: 22
          • Replies: 173
          • Total: 195
          • ★★

          Ah YES! Finally! hahah
          I was trying all sorts of things. Finally got what I wanted. Thanks much Atom.

          Do you frequent the IRC channel any?

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

            i used to for a couple of months but noone came, but i can re-join that i just need to add it to my miranda install.

            #2947
            msepsis
            Participant
              • Topics: 219
              • Replies: 732
              • Total: 951
              • ★★★
              "atom":1vbsal7v wrote:
              you can’t have multiple assignValues() methods you can have one…….[/quote:1vbsal7v]

              indeed. yes I didn’t pull up my code to cross reference but yes i only have one assignValues method. What I was referring to having many of were the many "setModulatorValue" below the assignValues but still this is moot in context of what I’m asking –

              where is the error in your midiMessageReceived script coming from? I was doing a mock with simplified code and still get this same Lua call function exception. run it on your script, you’ll see it. I narrowed it down to something in the first half of the script before the assignValues() method and all that follows. This error is going to be confusing especially to others who are using your demo panel as a starting point.

              Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

              #2948
              msepsis
              Participant
                • Topics: 219
                • Replies: 732
                • Total: 951
                • ★★★

                and oh by the way.. seems filch is running into the same error which he is describing above. it’s the same error from the same script I’m talking about which is in your DEMO – midi panel

                Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

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

                  i can’t say, you need to paste all the code that assignValues() method really, or just paste the whole code from the editor i’ll paste that into my panel and try to debug it

                  #2950
                  msepsis
                  Participant
                    • Topics: 219
                    • Replies: 732
                    • Total: 951
                    • ★★★

                    atom – once again, the code i’m testing is the code from your DEMO – midi panel. I can’t say it any more clearly that that <img decoding=” title=”Smile” /> If you run the bug check on your midiMessagesReceived script you will see exactly the error I’m referring to… likely the same error filch is trying to trace.

                    Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

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

                      i fixed that debugger a little to give a bit more informative message, and the error is there but it always be there, it says that the first parameter to the method is invalid and it’s true in case of the debugger i can’t say what parameters each method will take so i just run it without parameters and that’s why the debugger complains.

                      But the example works fine in normal mode for me, so the debugger aside (i’ll try to do something about that) it works the way it should.

                      #2952
                      msepsis
                      Participant
                        • Topics: 219
                        • Replies: 732
                        • Total: 951
                        • ★★★

                        Thank you Atom.
                        Yes I can confirm also that my panel works in this regard (receiving a sysex dump and passing values to the knobs) as well besides the error given from the debugger. I only am passing cc values so far… obviously wanted confirmation that the debugger is complaining about something benign before moving on… I do have some down time before all the excitement and haven’t been able to pull myself away completely just yet <img decoding=” title=”Smile” />

                        I have a line for every cc value that looks like:

                        [code:2ie2knv9]
                        panel:getModulatorByName("filter1EnvVel"):setModulatorValue(unpackedData:getByte(53), false, true, true)
                        [/code:2ie2knv9]

                        So how would one go about scripting a setModulatorValue for a modulator which is receiving sysex param changes like:
                        f0 3e 0e 00 20 00 01 01 xx f7

                        ??

                        Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

                        #2953
                        Filch
                        Participant
                          • Topics: 22
                          • Replies: 173
                          • Total: 195
                          • ★★
                          "msepsis":1kyrajzw wrote:
                          I have a line for every cc value that looks like:

                          [code:1kyrajzw]
                          panel:getModulatorByName("filter1EnvVel"):setModulatorValue(unpackedData:getByte(53), false, true, true)
                          [/code:1kyrajzw]

                          So how would one go about scripting a setModulatorValue for a modulator which is receiving sysex param changes like:
                          f0 3e 0e 00 20 00 01 01 xx f7

                          ??[/quote:1kyrajzw]

                          I’ll try to help out. I’ve got most of the panel update working for the majority of my panel.
                          What are you trying to do exactly? I don’t understand the specifics of your question. I’d say join me on IRC, but I’m about to head out for the evening.

                          #2954
                          atom
                          Keymaster
                            • Topics: 159
                            • Replies: 2945
                            • Total: 3104
                            • ★★★★★
                            "msepsis":8lrku81t wrote:
                            Thank you Atom.
                            Yes I can confirm also that my panel works in this regard (receiving a sysex dump and passing values to the knobs) as well besides the error given from the debugger. I only am passing cc values so far… obviously wanted confirmation that the debugger is complaining about something benign before moving on… I do have some down time before all the excitement and haven’t been able to pull myself away completely just yet <img decoding=” title=”Smile” />

                            I have a line for every cc value that looks like:

                            [code:8lrku81t]
                            panel:getModulatorByName("filter1EnvVel"):setModulatorValue(unpackedData:getByte(53), false, true, true)
                            [/code:8lrku81t]

                            So how would one go about scripting a setModulatorValue for a modulator which is receiving sysex param changes like:
                            f0 3e 0e 00 20 00 01 01 xx f7

                            ??[/quote:8lrku81t]
                            exactly the same way, it doesn’t matter what midi type is the modulator, you give it a value (a numeric value) and the MIDI message that is linked to it is updated (think of LUA as a artifical intelligence that moves your knobs and pushes your buttons)

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