Ctrlr objects in Lua

Home Forums General Programming Ctrlr objects in Lua

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #23405
    obiwanjacobi
    Participant
      • Topics: 5
      • Replies: 6
      • Total: 11

      Hi,

      After building my first MIDI CC panel I am trying to get my hands dirty with Lua script. I have programming experience and have found the Lua site and read the references and tutorials.

      What I need now is some reference documentation on what object Ctrlr brings to the Lua script context and how those can be used.

      In another panel I have come across a reference like ‘http://ctrlr.org/api/class_ctrlr_modulator.html’ that seemed to be exactly what I need but unfortunately that link is dead…

      Can somebody please point me in the right direction?

      Thanx,
      Marc

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

        Right now i recommend looking through the DEMO panels that come with Ctrlr, there is a lot of example how to deal with stuff. I never got around to doing any good Lua documentation, for many reasons.

        If you hit any dead ends, ask here i will try to direct you and help as much as i can

        #23407
        obiwanjacobi
        Participant
          • Topics: 5
          • Replies: 6
          • Total: 11

          Can you point out what C/C++ source objects are available in the Lua context? (I can read C/C++ just fine)

          Also, would it be a good idea to set up a wiki so the community can slowly create the docs…?

          [2c]
          Marc

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

            There was a WIKI but very little additions from the community, it’s really up to me to do that, most users here are musicians not programmers.

            All classes bound to Lua from JUCE are clearly seen in special .cpp files in the git repo, each file represents one class (or more in some cases, when the classes have tight relationships like Graphics and Audio*).

            You can see the files here: https://github.com/RomanKubiak/ctrlr/tree/master/Source/Lua/JuceClasses

            on the bottom of each file there is a section that binds classes, methods, static members, enums to Lua so you can see what is available.

            Also i Lua when Ctrlr is started you have 2 magic methods that show what is really available at runtime.
            Those methods are how() and what(OBJECT), how prints all available types available, and what(OBJECT) prints all available members/methods on the OBJECT passed to it. It’s really helpful.

            #23413
            obiwanjacobi
            Participant
              • Topics: 5
              • Replies: 6
              • Total: 11

              Thanx.

              Another question: can I include Lua script files as resources and ‘require’ them in some way?

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

                as in include them as CODE or require them as in, this file must exist or this panel won’t work ?

                #23427
                obiwanjacobi
                Participant
                  • Topics: 5
                  • Replies: 6
                  • Total: 11

                  I want to modularize my Lua code so I can build a lua library to be reused in other projects.

                  So I may isolate the knowledge for working with a specific device into a separate lua file (or more). In the panel-project I would like to include that lua file in the project and reference to it from the panel methods.

                  The resources seem to be graphic oriented but the mechanism should be reusable…

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