setting a global variable

Home Forums General Using Ctrlr setting a global variable

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #7453
    SWB
    Participant
      • Topics: 35
      • Replies: 157
      • Total: 192
      • ★★

      I use setGlobal(0,63) and setGlobal(1,7) as an expression for two different modulators to assign the value 63 to global variable k0 and value 7 to global variable k1. Is this the right way? If so then this doesn’t work in my panel. If not, then please tell me how to…

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

        For a slider i just create an expression

        setGlobal (0, modulatorValue)
        

        seems to do the trick, i’ve create a second one with a sysex formula

        F0 00 k0 01 k1 F7
        

        and in the MIDI monitor i get the correct data (k0 is replaced by the value of the global variable).

        One of the panel properties is called “Global variables”, it’s read only, it’s a set of numbers seperated by “:” this property stores the global variables, see if that changes.

        #7477
        SWB
        Participant
          • Topics: 35
          • Replies: 157
          • Total: 192
          • ★★

          I’m aware of the panel property ‘Global variables’. Normally it’s filled with ‘placeholders’ with the value -1. In my panel only one value shows up (probably k0 because this value seems to work), but other values for e.g. k1 don’t show up. (See attachment). I checked this with a fresh panel and then  for example setGlobal(3,64) does work and shows the value 64 for (in this case)  k4. Probably a side effect of the weird behaviour of my panel? (See my  posts in the thread “Panic!”.)

          Attachments:
          You must be logged in to view attached files.
          #7481
          atom
          Keymaster
            • Topics: 159
            • Replies: 2945
            • Total: 3104
            • ★★★★★

            looks like a bad property, you can try to fix that in lua

            panel:setProperty ("panelGlobalVariables", "0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0")
            
            #7483
            SWB
            Participant
              • Topics: 35
              • Replies: 157
              • Total: 192
              • ★★

              Tried it in the Lua console:

              function fixGlobal()

              panel:setProperty(“panelGlobalVariables”,”0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0″)

              end

              This is the result:

              >>> fixGlobal()

              ERROR: No matching overload found, candidates:

              void setProperty(CtrlrLuaObject&,Identifier const&,var const&,bool)

              (Sorry, I won’t be on this forum for tonight, going out…)

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

                I wrote this from head, just add the bool parameter

                panel:setProperty(“panelGlobalVariables”,”0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0",false)
                
                #7492
                SWB
                Participant
                  • Topics: 35
                  • Replies: 157
                  • Total: 192
                  • ★★

                  Thanks! Everything with the global variables back to normal again and setting them works fine now. (Was a bit lazy and in a hurry, should have found the solution of adding a boolean variable myself, sorry.)

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

                    Thought i fixed my own problem, but I’m drawing a blank here.. how again is it possible to have a combobox’s value set the value of k0??

                    I thought it was “Modulator attached to global variable” but the value of this modulator seems to have zero impact on setting k0’s value.

                    • This reply was modified 10 years, 9 months ago by msepsis.
                    • This reply was modified 10 years, 9 months ago by msepsis.

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

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