2 last things to get

Home Forums General Programming 2 last things to get

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #7318
    zeoka
    Participant
      • Topics: 73
      • Replies: 466
      • Total: 539
      • ★★★

      Hi

      I’ve finish my panel and before upload it i need last things  to make it  fully functionnal  :

      -scriptNameToRun() : i’ve tried but i’m wrong  with just  scriptNameToRun(“filter01”)

      i just want launch scripts in others  (This is for my version 2 panel) .

      -insert delays in my script “called after panel finished loading”  to launch several dumps at startup .I will calculate the exact delay i need with viewing a dump sequence in reaper…

      The command is  “Timer ” ? How it works please  ?

      Thank you very much

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

        I’m afraid i don’t understand point 1 at all ???

         

        For timers have a look at the: DEMO – Component Transforms and Animation panel in the Panels directory of the Ctrlr installation, it shows how to use timers “delays”

         

        #7343
        zeoka
        Participant
          • Topics: 73
          • Replies: 466
          • Total: 539
          • ★★★

          Hi Atom !

          The point 1 is just calling others scripts in a script  i’ve tried the command scriptNameToRun().

          Do i need to use function ?

          I see time from time DEMO panels.

          In “toogleRotate” i see timers but i don’t understand why there is  any temporal thing in the panel

          I click on and have to click off to stop rotate . what ‘s the number values ?seconds?

          Why the first timer has two values ?  It’s confuse for me  sorry   because you work very much for our understanding

           

           

           

           

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

            Again i got nothing, maybe someone can re-translate this for me?

            Calling a function in Lua is simple: http://www.lua.org/pil/6.html in Ctrlr, methods are functions, as you can clearly see in the editor.

            As for the timer example i really can’t be more clear then that, you got a simple example just adjust it to your needs, change it break it, fix it.

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

              This example should answer both questions.

              Script1 = function(modulator, newValue)

              otherScript() -- this will run the contents of some other Lua script named "otherScript"
              timer:setCallback (xx, Script1Callback) -- "xx" is a unique ID number you make, followed by the callback script you'd like to run after some delay defined next...
              timer:startTimer(xx,1000) -- xx = ID number of callback above, will run 1000 ms after the contents of this "Script1" script (delay).
              end

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

              #7357
              zeoka
              Participant
                • Topics: 73
                • Replies: 466
                • Total: 539
                • ★★★

                Ooooh Msepsis you’re a killa !

                I’ve bad interpreted your initial post ! It was not a command but a “whatever name ”

                Thank you very much i understand clearly now the timer doesn’t need to stop !

                I’d a doubt with the ID but it’s clear now.

                Last night i was lost in google and LUA world   It was too much 🙂

                Big up

                #7648
                zeoka
                Participant
                  • Topics: 73
                  • Replies: 466
                  • Total: 539
                  • ★★★


                  — Called when the panel has finished loading

                  SendSnapshots = function(mod, value)

                  Send = panel:getModulatorByName(“Send Program”):getModulatorValue()

                  if Send == 1 then

                  timer:setCallback (1, Program)
                  timer:setCallback (2, Sound01)

                  timer:startTimer(1,500)
                  Program()
                  timer:stoptTimer(1)
                  timer:startTimer(2,1000)
                  Sound01()
                  timer:stopTimer(2)

                  end

                  end

                  That ‘s doing the job but…..

                  Problem : the timers don’t stop . I ‘ve created a loop….

                  Any idea ?

                  #7716
                  zeoka
                  Participant
                    • Topics: 73
                    • Replies: 466
                    • Total: 539
                    • ★★★

                    Hello i’ve doing this, based on virus panel script :

                    SendSnapshots = function(mod, value)

                    Send = panel:getModulatorByName(“Send Program”):getModulatorValue()

                    if Send == 1 then

                    BLABLA(–get mods values and send midi message)

                    timer:setCallback (1, Sound01)
                    timer:startTimer(1,80)

                    Sound01 = function(timerId)
                    timer:stopTimer(1)

                    BLABLA(–get mods values and send midi message)

                    end

                    timer:setCallback (2, Sound02)
                    timer:startTimer(2,160)

                    Sound02 = function(timerId)
                    timer:stopTimer(2)

                    BLABLA(–get mods values and send midi message)

                    end

                    etc……

                    end

                    end

                    This is working as expected now but i’ve a callback error at startup

                    Please why ?

                     

                     

                     

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