Build 1441 (win) Lua broken?

Home Forums General Using Ctrlr Build 1441 (win) Lua broken?

Tagged: 

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #9928
    Hecticcc
    Participant
      • Topics: 25
      • Replies: 160
      • Total: 185
      • ★★

      Hi Atom,

      I installed the latest nightly and my panel, which relies entirely on Lua for midi communication, does not process Lua scripts correctly anymore. Some calls are made, others are ignored. Did you change syntax for important function calls and removed “legacy” calls? Or is it a “broken” build?
      In 1417 i have no errors.

      • This topic was modified 10 years, 10 months ago by Hecticcc.
      #9931
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        You’d have to be more specific, what’s not getting called. What sort of callbacks ?

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

          ive got a hunch its the same changes that caused 1441 to not work with my methods on the monstrumWaveXT panel… see the last few posts on this thread

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

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

            I’m away from home till sunday, but feed me more information so i can track down and fix this.

            #9935
            Hecticcc
            Participant
              • Topics: 25
              • Replies: 160
              • Total: 185
              • ★★

              Sure, here’s a snippet of the function logic.

              First an example of how i assign incoming midi to the modulators:

              1 – Grab some values in midiReceived script and trigger appropriate functions when needed, passing on those variables:

              
              midiReceived = function(midi)
              
              devID = 1 --make panel:getModulatorByName("midiDeviceId"):getValue() in initscript
              
              if midi:getSize() ~= nil then l = midi:getSize() end
              
              msg = midi:getData():getRange(0,l)
              eof = midi:getLuaData():getByte(5)
              cmd = midi:getLuaData():getByte(6)
              ID = midi:getLuaData():getByte(7)
              LS = midi:getLuaData():getByte(9)
              MS = midi:getLuaData():getByte(10)
              
              if dumpdatamsg:toHexString(1) == singleParamMsg then --its a single param value (singleParamMsg specified @ initscript)
              
              	if ID == 1 then setCord00source(LS,MS) end
              	if ID == 2 then setCord00dest(LS,MS) end
              	if ID == 3 then setCord00amt(LS,MS) end

              2 – Then the called functions do the assigning of values to the modulators so the panel reflects the device's state. The next example is one of this kind of functions.

              
              function setCord00dest(x,y)
              
              --used to translate the cord source values into sequential numbers for the comboboxes
              --x is lsb, y is msb. MSB selects activated block
              
              --console(string.format("setCord00dest received lsb %.d and msb %.d",x,y))
              
              if y == 0 then
              
              	if x == 8 then x = 1
              	elseif x == 47 then x = 2
              	elseif x == 48 then x = 3
              	elseif x == 49 then x = 4
              	elseif x == 50 then x = 5
              	elseif x == 51 then x = 6
              	elseif x == 52 then x = 7
              	elseif x == 53 then x = 8
              	elseif x == 54 then x = 9
              	elseif x == 56 then x = 10
              	elseif x == 57 then x = 11
              	elseif x == 64 then x = 12
              	elseif x == 65 then x = 13
              	elseif x == 66 then x = 14
              	elseif x == 72 then x = 15
              	elseif x == 73 then x = 16
              	elseif x == 74 then x = 17
              	elseif x == 75 then x = 18
              	elseif x == 80 then x = 19
              	elseif x == 81 then x = 20
              	elseif x == 82 then x = 21
              	elseif x == 83 then x = 22
              	elseif x == 86 then x = 23
              	elseif x == 88 then x = 24
              	elseif x == 89 then x = 25
              	elseif x == 90 then x = 26
              	elseif x == 91 then x = 27
              	elseif x == 94 then x = 28
              	elseif x == 96 then x = 29
              	elseif x == 97 then x = 30
              	elseif x == 104 then x = 31
              	elseif x == 105 then x = 32
              	elseif x == 106 then x = 33
              	elseif x == 108 then x = 34
              	end
              end
              
              if y == 1 then
              
              	if x == 33 then x = 35
              	elseif x == 34 then x = 36
              	elseif x == 35 then x = 37
              	elseif x == 36 then x = 38
              	elseif x == 37 then x = 39
              	elseif x == 38 then x = 40
              	elseif x == 39 then x = 41
              	elseif x == 40 then x = 42
              	elseif x == 41 then x = 43
              	elseif x == 42 then x = 44
              	elseif x == 43 then x = 45
              	elseif x == 44 then x = 46
              	elseif x == 45 then x = 47
              	elseif x == 46 then x = 48
              	elseif x == 47 then x = 49
              	elseif x == 48 then x = 50
              	elseif x == 49 then x = 51
              	elseif x == 50 then x = 52
              	elseif x == 51 then x = 53
              	elseif x == 52 then x = 54
              	elseif x == 53 then x = 55
              	elseif x == 54 then x = 56
              	elseif x == 55 then x = 57
              	elseif x == 56 then x = 58
              	elseif x == 57 then x = 59
              	end
              end
              
              cord00dest:setModulatorValue(x,false,false,false)
              end
              
              

              Then the other way around, modulators sending out midi:

              1 – Determine value to send for a certain modulator & pass the values on to the function that formats & sends out the midimessage.

              cord00source = function(mod, value)
              
              if loaded == true then --"loaded" bool comes from initscript
              
              if value == 2 then --Key+=5
              value = 5
              
              elseif value == 3 then --Key~=9
              value = 9
              
              elseif value == 4 then --Vel+=10
              value = 10
              
              elseif value == 5 then --Vel~=11
              value = 11
              
              elseif value == 6 then --Vel<=12
              value = 12
              
              elseif value == 7 then --RlsVel=13
              value = 13
              
              elseif value == 8 then --Gate=14
              value = 14
              
              elseif value == 9 then --PitchWhl=15
              value = 15
              
              elseif value == 10 then --ModWhl=17
              value = 17
              
              elseif value == 11 then --Press=18
              value = 18
              
              elseif value == 12 then --Pedal=19
              value = 19
              
              elseif value == 13 then
              value = 20
              
              elseif value == 14 then --MidiB=21
              value = 21
              
              elseif value == 15 then --FtSw1=22
              value = 22
               
              elseif value == 16 then--FtSw2=23
              value = 23
              
              elseif value == 17 then --Ft1FF=24
              value = 24
              
              elseif value == 18 then --Ft2FF=25
              value = 25
              
              elseif value == 19 then --MidiVl=26
              value = 26
              
              elseif value == 20 then --MidiPn=27
              value = 27
              
              elseif value == 21 then --MidiC=28
              value = 28
              
              elseif value == 22 then --MidiD=33
              value = 33
              
              elseif value == 23 then --MidiE=34
              value = 34
              
              elseif value == 24 then --MidiF=35
              value = 35
              
              elseif value == 25 then --MidiG=36
              value = 36
              
              elseif value == 26 then --MidiH=37
              value = 37
              
              elseif value == 27 then --Thumb=38
              value = 38
              
              elseif value == 28 then --ThmFF=39
              value = 39
              
              elseif value == 29 then --KeyGld=40
              value = 40
              
              elseif value == 30 then --VEnv+=60
              value = 60
              
              elseif value == 31 then --VEnv~=73
              value = 73
              
              elseif value == 32 then --VEnv<=74
              value = 74
              
              elseif value == 33 then --FEnv+=80
              value = 80
              
              elseif value == 34 then--FEnv~=81
              value = 81
              
              elseif value == 35 then--FEnv<=82
              value = 82
              
              elseif value == 36 then--AEnv+=83
              value = 83
              
              elseif value == 37 then--AEnv~=89
              value = 89
              
              elseif value == 38 then--AEnv<=90
              value = 90
              
              elseif value == 39 then--Lfo1~=91
              value = 91
              
              elseif value == 40 then--Lfo1+=97
              value = 97
              
              elseif value == 41 then--White=98
              value = 98
              
              elseif value == 42 then--Pink=99
              value = 99
              
              elseif value == 43 then--kRand1=100
              value = 100
              
              elseif value == 44 then--kRand2=101
              value = 101
              
              elseif value == 45 then--Lfo2~=102
              value = 102
              
              elseif value == 46 then--Lfo2+=105
              value = 105
              
              elseif value == 47 then--Lag0in=106
              value = 106
              
              elseif value == 48 then--Lag0=107
              value = 107
              
              elseif value == 49 then--Lag1in=108
              value = 108
              
              elseif value == 50 then--Lag1=109
              value = 109
              
              elseif value == 51 then--CkDwhl=110
              value = 110
              
              elseif value == 52 then--CkWhl=145
              value = 145
              
              elseif value == 53 then--CkHalf=146
              value = 146
              
              elseif value == 54 then--CkQtr=147
              value = 147
              
              elseif value == 55 then--Ck8th=148
              value = 148
              
              elseif value == 56 then--Ck16th=149
              value = 149
              
              elseif value == 57 then--DC=150
              value = 150
              
              elseif value == 58 then--Sum=161
              value = 161
              
              elseif value == 59 then--Switch=162
              value = 162
              
              elseif value == 60 then--Abs=163
              value = 163
              
              elseif value == 61 then--Diode=164
              value = 164
              
              elseif value == 62 then--FlipFlop=165
              value = 165
              
              elseif value == 63 then --Quantize=166
              value = 166
              
              elseif value == 64 then--Gainx4=167
              value = 167
              
              end
              
              paramChangeMsg(1,1,value)
              end
              end

              2- Function that receives the data needed for the midimessage, formats it into a hexstring & sends it out.

              function paramChangeMsg(paramNumLsb,paramNumMsb, paramVal)
              
              -- 5 values are: devID @ byte 3, paramnum @ 7 & 8, paramVal @ 9 & 10
              if loaded == true then
              
              msg = string.format("f0 18 21 %.2x 55 01 02 %.2x %.2x %.2x %.2x 7f f7", devID, paramNumLsb, paramNumMsb, lsb(paramVal), msb(paramVal))
              panel:sendMidiMessageNow(CtrlrMidiMessage(msg))
              end
              --console(string.format(msg))
              end

              All this works without a hitch in Ctrlr 1417…
              I will do some console dumping to see where stuff might get messed up if i have more time.

              • This reply was modified 10 years, 10 months ago by Hecticcc. Reason: these bloody wp tags keep messing with me
              • This reply was modified 10 years, 10 months ago by Hecticcc.
              • This reply was modified 10 years, 10 months ago by Hecticcc.
              • This reply was modified 10 years, 10 months ago by Hecticcc.
              • This reply was modified 10 years, 10 months ago by Hecticcc.
              #9941
              Hecticcc
              Participant
                • Topics: 25
                • Replies: 160
                • Total: 185
                • ★★

                ps: the lsb() and msb() functions in the string.format of the last function in the list are helper functions that – you’ll never guess – calculate the lsb and msb for the given value.

                
                function lsb(x)
                
                if x ~= nil then
                
                local bi = CtrlrLuaBigInteger(x)
                local lsb = bi:getBitRangeAsInt (0,7)
                
                return (lsb)
                end
                end
                
                
                function msb(x)
                
                if x ~= nil then
                
                local bi = CtrlrLuaBigInteger(x)
                local msb = bi:getBitRangeAsInt (7,7)
                
                return (msb)
                end
                end
                
                
                #10019
                Hecticcc
                Participant
                  • Topics: 25
                  • Replies: 160
                  • Total: 185
                  • ★★

                  There’s something dodgy going on in the midi-input. Whenever i try to dump midi-data to the console i get empty strings, and when i try to print out a single byte i get a value of 0 instead of an empty response (or the value it should have).
                  Weird thing is that i do not get “nil” errors anywhere also…

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

                    I think i found the bug, and since Jules posted a fix to JUCE a minute ago, i’ll do a nightly build right now. let me know if it fixes the issue.

                    #10037
                    Hecticcc
                    Participant
                      • Topics: 25
                      • Replies: 160
                      • Total: 185
                      • ★★

                      Cool!
                      I am working @ home this week so am sitting next to my gear – will check it out tomorrow inbetween study sessions and keep you posted.

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

                        yeah at least on the panel i had that seemed broken the issue is resolved with this latest pc rev. Here’s my obligatory request for a mac rev!

                        good work fixing whatever the problem was!

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

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

                          I’ll “do the mac” today after work.

                          #10049
                          Hecticcc
                          Participant
                            • Topics: 25
                            • Replies: 160
                            • Total: 185
                            • ★★

                            Fix confirmed in 1448 win32 , all working again as expected 🙂
                            Bigup Atom for the ninja-speed-debugging!

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

                              good deal.. except now how are we to get waveforms into the uiWaveformComponent now that there is no right click menu on them?

                              can’t release this waveform editor w/o that 🙁

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

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

                                ugh.. and hate to break it to you but the lua editor is broken in the mac rev 1451.. I’m able to copy/paste from there into textedit so it’s probably just white text on a white background.

                                Attachments:
                                You must be logged in to view attached files.

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

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

                                  That’s the JUCE bug i reported on sunday, it should have been fixed. I’ll have a look today when i’m home.

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

                                    Oh yeah and the right click i’ll fix i returned from a function too eraly

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

                                      ok i’ll be patient until these things are fixed and uploaded to the nightlies page. In the meantime I have a few other features I can work on adding to this microwaveXT panel before releasing it. I did get the waldorf rocket panel released and people are eating it up so far! IT’s a hugely beneficial panel for such a limited synth.

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

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

                                        The new nightlies are up for windows and mac.

                                        If the code editor issue is not fixed please let me know, it will be a compatibility issue (i checked on my OSX but it just auto-update to 10.8.4 i think).

                                        The right click is back.

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