Jsh

Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • in reply to: General Programming/Lua question #120476
    Jsh
    Participant
      • Topics: 6
      • Replies: 12
      • Total: 18

      Sweeeet, thanks again Dnaldoog

      in reply to: Midi Input Overload on Multiple Sysex Dump Requests #120086
      Jsh
      Participant
        • Topics: 6
        • Replies: 12
        • Total: 18

        Yeah the default note overlays in overlay banks 2, 3, 4 and 5 are all full, and if requested individually return fine. I kinda figured as I was doing the hex table that it was bound to be unnecessary / wrong but I assumed it had to be in hex for whatever reason. Ultimately still having the same issue though after removing the unnecessary weird formatting / looping. Having the os.execute(sleep(125)) just seems to pause everything once (for longer than 125ms) and then do the same initial behavior afterwards rather than after each message?

        Cheers

        in reply to: Midi Input Overload on Multiple Sysex Dump Requests #120078
        Jsh
        Participant
          • Topics: 6
          • Replies: 12
          • Total: 18

          Hmmm,

          I tried using this in my code but I’m still only getting 3 of the 25 dumps in the midi monitor; I’m getting different dumps now, always numbers 16, 17 & 18, but not the desired result. Any ideas what might be happening. Here is my code:

          --
          -- Called when a modulator value changes
          -- @mod   http://ctrlr.org/api/class_ctrlr_modulator.html
          -- @value    new numeric value of the modulator
          --
          
          RequestOverlayDump = function(--[[ CtrlrModulator --]] mod, --[[ number --]] value, --[[ number --]] source)
          
          	local hexValues = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
           	0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
          	0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18}
          	
          	for _,v in pairs(hexValues) do
          		
          		os.execute(sleep(125))
          		local requestMsg = CtrlrMidiMessage({0xF0, 0x00, 0x20, 0x29, 0x00, 0x33, 0x00, 0x4F, v, 0xF7})
          		panel:sendMidiMessageNow(requestMsg)
          	
          	end
          
          end

          I have also tried using different times, i.e. os.execute(sleep(300)) etc, as well as having the sleep after sending the midi message but with no luck.

          Here is what the midi monitor shows:

          midi out:

          [06:47:52:000398]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 00 f7]
          [06:47:52:000699]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 01 f7]
          [06:47:53:000000]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 02 f7]
          [06:47:53:000300]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 03 f7]
          [06:47:53:000600]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 04 f7]
          [06:47:53:000901]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 05 f7]
          [06:47:54:000201]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 06 f7]
          [06:47:54:000502]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 07 f7]
          [06:47:54:000802]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 08 f7]
          [06:47:55:000103]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 09 f7]
          [06:47:55:000404]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 0a f7]
          [06:47:55:000704]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 0b f7]
          [06:47:56:000006]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 0c f7]
          [06:47:56:000306]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 0d f7]
          [06:47:56:000606]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 0e f7]
          [06:47:56:000907]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 0f f7]
          [06:47:57:000208]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 10 f7]
          [06:47:57:000509]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 11 f7]
          [06:47:57:000809]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 12 f7]
          [06:47:58:000110]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 13 f7]
          [06:47:58:000411]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 14 f7]
          [06:47:58:000712]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 15 f7]
          [06:47:59:000013]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 16 f7]
          [06:47:59:000314]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 17 f7]
          [06:47:59:000614]: Size:[    10] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4f 18 f7]

          midi in:

          [06:56:05:000059]: Size:[   106] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4e 16 00 00 00 24 02 01 53 00 01 10 08 0c 04 00 00 40 21 47 50 00 01 7f 31 59 71 40 00 00 02 38 00 00 04 10 00 04 30 00 00 00 20 00 08 60 00 00 00 00 00 00 09 31 48 00 00 00 00 0d 03 10 12 29 00 40 40 20 10 04 02 01 01 00 20 10 08 04 02 01 00 63 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 f7]
          [06:56:05:000360]: Size:[   106] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4e 17 00 00 00 24 02 03 41 00 01 10 08 08 04 00 00 40 21 4d 30 00 01 7f 7f 51 71 08 00 00 00 48 2e 0d 04 10 05 15 68 00 00 00 20 0a 2b 50 00 00 00 00 00 00 09 31 48 00 00 00 00 0d 03 10 12 29 00 40 40 20 10 04 02 01 01 00 20 10 08 04 02 01 00 5a 02 42 20 00 00 00 00 00 00 00 00 00 00 00 00 02 f7]
          [06:56:05:000660]: Size:[   106] Ch:[--] No:[----] Val:[----] RAW:[f0 00 20 29 00 33 00 4e 18 00 00 00 24 02 02 6d 00 01 10 08 0d 34 00 00 40 21 45 10 00 01 7f 7f 51 78 07 40 00 00 40 2a 0d 04 10 04 15 68 00 00 00 20 08 2b 50 00 00 00 00 00 00 09 31 48 00 00 00 00 0d 03 10 12 29 00 40 40 20 10 04 02 01 01 00 20 10 08 04 02 01 00 67 02 42 20 00 00 00 00 00 00 00 00 00 07 7f 7f 7f f7]

          Cheers.

          in reply to: User text input for uiListBox? #120068
          Jsh
          Participant
            • Topics: 6
            • Replies: 12
            • Total: 18

            Big thanks to both of you guys, very helpful. As for the other issue:

            Dnaldoooooooooog. Thanks for the advice, this works quite nicely for me. Quick related question, does anyone know how I can keep the last item in the uiListBox highlighted when I click somewhere else in my panel/unfocus the modulator?

            this is just happening when I enter the new patch name into the label and press enter, so I’m guessing when I do this I could also just do a set modulator value again on the list box (from the uiLabel on pressed enter) and it should re-highlight the selected row. Haven’t tried this yet though.

            in reply to: Looking to change button image on value change #120067
            Jsh
            Participant
              • Topics: 6
              • Replies: 12
              • Total: 18

              This is exactly what I was looking for!

              Thanks, Dlandog

              in reply to: User text input for uiListBox? #120029
              Jsh
              Participant
                • Topics: 6
                • Replies: 12
                • Total: 18

                Dnaldoooooooooog. Thanks for the advice, this works quite nicely for me. Quick related question, does anyone know how I can keep the last item in the uiListBox highlighted when I click somewhere else in my panel/unfocus the modulator?

                in reply to: User text input for uiListBox? #120027
                Jsh
                Participant
                  • Topics: 6
                  • Replies: 12
                  • Total: 18

                  Thanks for the advice Dnaly, looking into it – also looking forward to seeing your reply goodweather.

                  Cheers

                  in reply to: Help with getting the hang of lua+ ctrlr #119680
                  Jsh
                  Participant
                    • Topics: 6
                    • Replies: 12
                    • Total: 18

                    Chuffed, Thanks guys!

                    in reply to: Help with getting the hang of lua+ ctrlr #119666
                    Jsh
                    Participant
                      • Topics: 6
                      • Replies: 12
                      • Total: 18

                      Hmmm…

                      So I’ve run into a bit of an issue trying to send the value from the portamento modulator. My initial instinct was to do this:

                      --
                      -- Called when a panel receives a midi message (does not need to match any modulator mask)
                      -- @midi   CtrlrMidiMessage object
                      --
                      myMethod = function(--[[ CtrlrMidiMessage --]] midi)
                      	local msgSize = midi:getSize()
                      	if msgSize == 1179 then -- If message is program dump
                      		local portaValRaw = panel:getModulatorByName("Portamento"):getModulatorValue()
                      		local portaVal = tostring(string.format("%.2X", portaValRaw))
                      		progDump = {}
                      		midi:getData():toLuaTable(progDump)
                      		progDump[28] = portaVal
                      		progDumpMsg = CtrlrMidiMessage(progDump)
                      		panel:sendMidiMessageNow(progDumpMsg)
                      	end
                      end

                      However, this gives me the compile error:

                      At line [-1]: [C]
                      Error message: std::exception: ‘unable to make cast’

                      I’m thinking that I’m not referencing/passing the portamento modulator value in the correct way, but I’m not really too sure. Any thoughts?

                      Cheers

                      • This reply was modified 3 years, 7 months ago by Jsh.
                      in reply to: Help with getting the hang of lua+ ctrlr #119663
                      Jsh
                      Participant
                        • Topics: 6
                        • Replies: 12
                        • Total: 18

                        Awesome!

                        Thank you both (Samoht and dnaldoog) for the help. I’ve managed to receive the dump change the value and send it back. The scripts look like this:

                        — Called when a modulator value changes
                        — @mod http://ctrlr.org/api/class_ctrlr_modulator.html
                        — @value new numeric value of the modulator

                        GetSysexProgDump = function()

                        progData = {}
                        progData = CtrlrMidiMessage({0xF0, 0x42, 0x36, 0x00, 0x01, 0x51, 0x10, 0xF7})
                        panel:sendMidiMessageNow(progData)

                        end


                        — Called when a panel receives a midi message (does not need to match any modulator mask)
                        — @midi CtrlrMidiMessage object

                        CheckIncomingMidi = function(–[[ CtrlrMidiMessage –]] midi)

                        local msgSize = midi:getSize()

                        if msgSize == 1179 then

                        progDumpTable = {}
                        midi:getData():toLuaTable(progDumpTable)
                        progDumpTable[28] = 0x7f

                        progDumpMsg = CtrlrMidiMessage(progDumpTable)
                        panel:sendMidiMessageNow(progDumpMsg)
                        end
                        end

                        Here I’m just setting the portamento to full on the button press. I’ve also been experimenting with the table (just looping through and printing the values ert with a basic “for i, v in pairs(table) do” to see results and familiarize myself with other practices.

                        Next on the agenda is to actually pass a value from the modulator knob from the panel and use this to set the value. I’ll let you know how I get on.

                        Many thanks.

                        in reply to: Help with getting the hang of lua+ ctrlr #119650
                        Jsh
                        Participant
                          • Topics: 6
                          • Replies: 12
                          • Total: 18

                          Now my aim is to receive a program dump, edit one of the values and then dump this back to the synth in order to access parameters on some of my synths that can (as far as I can tell) only be accessed in this way, but I’m not entirely sure what the approach is for this so any help here would be appreciated. For simplicity sake, I’ll just be using this method to change the portamento (which has been my go-to for some reason), even though yes this can be done with far easier methods, it’s just a way to learn the process with something that is easy to identify the change in for me.

                          An example program dump from my Minilogue XD looks like this:

                          “F0 42 36 00 01 51 40 00 50 52 4F 47 49 6E 69 00 74 20 50 72 6F 67 72 00 61 6D 02 7F 00 01 00 00 04 02 01 00 02 00 00 00 02 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 00 7F 03 10 00 00 00 00 7F 03 00 00 00 00 00 00 00 00 02 01 7F 03 1E 00 00 00 00 40 02 00 02 00 01 01 28 00 02 00 02 02 00 01 00 50 00 00 00 00 7F 01 7F 28 01 00 00 7F 01 7F 01 14 00 00 7F 01 7F 01 02 00 02 16 78 0C 0A 00 04 01 48 0C 00 00 0C 32 01 00 01 00 00 00 01 00 01 00 01 00 66 64 64 64 64 00 64 64 00 00 00 00 00 06 00 7F 7F 0D 00 02 00 00 02 00 50 52 45 44 53 08 45 51 44 30 04 10 00 00 4B 36 00 ~ …etc ~ F7”, where the 28th byte is the portamento at full (127), reading 7F

                          I have a basic understanding of how to read the dump using the offset table in the midi implementation document…kinda. But I’m not too sure exactly where I would call a method that would request a program dump, how I would store the dump (in a table?) then modify it and send it back.

                          Thanks in advance for any advice anyone can offer, in the meantime I’ll continue to look through the forums (as I have seen this topic discussed a lot but am struggling to understand it) and experiment.

                          Cheers

                          in reply to: Help with getting the hang of lua+ ctrlr #119649
                          Jsh
                          Participant
                            • Topics: 6
                            • Replies: 12
                            • Total: 18

                            Thanks for the advice Samoht.

                            Fixed the method to achieve what I was going for by changing a mistake in the SysEx string where I had 3g, which is what I found as the exclusive header in the midi implementation chart and strangely works when used outside of the LUA method in the SysEx formula box in the midi section of the modulator settings (not sure of the proper terminology lol). After getting a SysEx program dump using Midi-Ox I found the ID should be 36…of course 3g would not work as g is not a hexadecimal value…whoops.

                            Anyways thank you again for the pointers, will definitely help as I progress.

                            Cheers, Josh.

                          Viewing 12 posts - 1 through 12 (of 12 total)
                          Ctrlr