There is a 'ctrlr for dummies'? i'm lost!

Home Forums General Programming There is a 'ctrlr for dummies'? i'm lost!

Tagged: ,

Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • #54033
    urbanspaceman
    Participant
      • Topics: 7
      • Replies: 38
      • Total: 45

      Hi, i’m francesco
      In these days i have spare time and i look into ctrlr.
      I’m a web developer, i know php, css, html, javascript… there is something that I know i can use to start with ctrlr?

      For the first experiment i want to do a bit of panel design… starting from zero, i want to have 2 tabs…

      Where to start?
      Thanks!!

      #54038
      Puppeteer
      Participant
        • Topics: 16
        • Replies: 185
        • Total: 201
        • ★★

        We’re in the process of writing one

        Ctrlr – Step by step guide (in DEV version)

        The Puppeteer
        http://godlike.com.au

        #54039
        urbanspaceman
        Participant
          • Topics: 7
          • Replies: 38
          • Total: 45

          Thanks!
          i go to read…

          #54040
          urbanspaceman
          Participant
            • Topics: 7
            • Replies: 38
            • Total: 45

            hey wow i have understand the tabs! thank you!
            Now i wont to know if is possible change the aspect of the tabs, instead of tabs, make a buttons..

            #54046
            urbanspaceman
            Participant
              • Topics: 7
              • Replies: 38
              • Total: 45

              Done with lua!!

              #54047
              urbanspaceman
              Participant
                • Topics: 7
                • Replies: 38
                • Total: 45

                sometimes i have a problem to select element (in this case the main container buld with tabs)… why?

                #54048
                urbanspaceman
                Participant
                  • Topics: 7
                  • Replies: 38
                  • Total: 45

                  ok, selection is possible via modulator list.

                  #54081
                  urbanspaceman
                  Participant
                    • Topics: 7
                    • Replies: 38
                    • Total: 45

                    for some reason, my lua doesn’t work…

                    i have a method like this

                    function BtnSlctVoice1(mod, value)
                    	panel:getComponent("VoicesTabs"):setProperty ("uiTabsCurrentTab", 0, false)
                    	panel:getComponent("BtnSlctVoice1"):setProperty ("componentDisabled", 1, false)
                    	panel:getComponent("BtnSlctVoice2"):setProperty ("componentDisabled", 0, false)
                    	panel:getComponent("BtnSlctVoice3"):setProperty ("componentDisabled", 0, false)
                    	panel:getComponent("BtnSlctVoice4"):setProperty ("componentDisabled", 0, false)
                    end

                    when i click on the button, i have this error

                    At line [2]: [string "BtnSlctVoice1"]
                    
                    Error message: [string "BtnSlctVoice1"]:2: attempt to index a nil value

                    i use this code to make the button switch trough the tabs

                    #54082
                    dasfaker
                    Keymaster
                      • Topics: 80
                      • Replies: 793
                      • Total: 873
                      • ★★★

                      You must use panel:getModulatorByName(“modName”):getComponent():setProperty….

                      #54083
                      urbanspaceman
                      Participant
                        • Topics: 7
                        • Replies: 38
                        • Total: 45

                        i don’t understand…
                        someone can check my lua code?

                        Attachments:
                        You must be logged in to view attached files.
                        #54086
                        dasfaker
                        Keymaster
                          • Topics: 80
                          • Replies: 793
                          • Total: 873
                          • ★★★

                          The elements you put on the panel are modulators. So to get access to them, use panel:getModulatorByName(“VoiceTabs”):getComponent()…

                          not panel:getComponent(“VoiceTabs”)

                          #54087
                          urbanspaceman
                          Participant
                            • Topics: 7
                            • Replies: 38
                            • Total: 45

                            Thanks dasfaker… now i have another problem.. the panel does not open more .. … i don’t get any error, i try to load my test.panel or a previously saved version… but nothing happens..

                            #54091
                            urbanspaceman
                            Participant
                              • Topics: 7
                              • Replies: 38
                              • Total: 45

                              ok, i have redone from scratch and now works.
                              but, i have another question.

                              my structure is composed by a main tab (with 2 tab)
                              inside one of this tab i have another tab with 4 tabs..

                              now this 4 tabs are visible always, not only in one of the main tab container…

                              #54092
                              urbanspaceman
                              Participant
                                • Topics: 7
                                • Replies: 38
                                • Total: 45

                                Done!

                                #54093
                                dasfaker
                                Keymaster
                                  • Topics: 80
                                  • Replies: 793
                                  • Total: 873
                                  • ★★★

                                  I had troubles opening the panel, and I think it’s because all your functions are changeTab = function(mod, value), in all the methods.

                                  The name of the function must be the same as the method’s name, so for example, selectPerformance method must have function selectePerformance = function(mod, value).

                                  #54095
                                  urbanspaceman
                                  Participant
                                    • Topics: 7
                                    • Replies: 38
                                    • Total: 45

                                    the code
                                    selectePerformance = function(mod, value)
                                    is the same as
                                    function selectePerformance(mod, value) ?

                                    As a good practice, is better to use the tabs for the different section of the editor or using layers?

                                    #54096
                                    urbanspaceman
                                    Participant
                                      • Topics: 7
                                      • Replies: 38
                                      • Total: 45

                                      I think I understood that the tabs are not containers, the elements are still hidden whit lua and the layers

                                      #54099
                                      dasfaker
                                      Keymaster
                                        • Topics: 80
                                        • Replies: 793
                                        • Total: 873
                                        • ★★★

                                        the code
                                        selectePerformance = function(mod, value)
                                        is the same as
                                        function selectePerformance(mod, value) ?

                                        It’s not the same.

                                        The first one is the function that is executed when a method is called.
                                        For instance, in a modulator’s property “called when the modulator value changes”
                                        you can create a method called “modValue”. This method must have a function called “modValue = function(mod, value)” that is executed every time the modulator change it’s value.

                                        The second one is for your own functions, for instance

                                        function loadInitValues(argument1, argument2)

                                        #68943
                                        goodweather
                                        Participant
                                          • Topics: 45
                                          • Replies: 550
                                          • Total: 595
                                          • ★★★

                                          You must use panel:getModulatorByName(“modName”):getComponent():setProperty….

                                          Totaly correct. I have also adapted the Step by Step Guide.
                                          This was a beginner’s mistake I did several months ago. Sorry for this.

                                          Since then, I’m following Atom’s advice to declare all modulators at panel load in order to avoid calling the panel:getModulatorByName(“modName”) method each time (can take time when you have a lot of modulators because Ctrlr has to scan a table for each name).
                                          So, at panel load I use for example:

                                          modOsc1WaveLeft = panel:getModulatorByName("Osc1WaveLeft")
                                          modOsc1Pitch = panel:getModulatorByName("Osc1Pitch")
                                          ...

                                          And in the different methods I just use:

                                          modOsc1Pitch:getModulatorValue()
                                          modOsc1WaveLeft:getComponent():setEnabled(false)
                                          modOsc1WaveLeft:getComponent():setProperty...

                                          Will explain that in the Step by Step guide 2.0

                                          #71832
                                          human fly
                                          Participant
                                            • Topics: 124
                                            • Replies: 1070
                                            • Total: 1194
                                            • ★★★★

                                            hi, resurrecting this: you say ‘at panel load..’
                                            do you mean ‘Called when panel has finished loading’ ?

                                            there are some other ‘panel’ entries there, i do not know
                                            what to use. i think i should initialize my panel on
                                            start-up to refresh views and called default values to
                                            modulators – without sending any midi messages –

                                            so: are you saying that one should declare all the modulators
                                            -or at least all that are mentioned in lua methods?- at startup,
                                            ie: ‘when panel has finished loading’ ?
                                            just declare, and end ?

                                            what about panel refresh/repaint? how does that work? what is
                                            purpose of?

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