Advice before starting the project.

Home Forums General Programming Advice before starting the project.

Viewing 20 posts - 1 through 20 (of 55 total)
  • Author
    Posts
  • #521
    Tronic
    Participant
      • Topics: 7
      • Replies: 45
      • Total: 52

      With the LUA available, you could create a sort of presets section, saved to a file (in xml format?) for a group of parameters?
      So my question specifically is, you can create arrays of internal parameters and manage them through the API to save and recall them?
      My project should contain roughly 16 tab groups (Track), each with an almost 512 parameters divided into more section.
      But for every track we would be available to more group, such as the synthesis, should have a list with 16 options,
      each option brings up a summary to the hardware, with the default parameters when called,
      I would like to know if there is a system to save only these parameters group in a file without creating a preset, the internal preset manager will contain all parameters globally.
      Why should I be able to do with the various sections such as: synthesis, effects, etc. etc..

      Thank you for your attention, hoping that you can do it.

      #3622
      Tronic
      Participant
        • Topics: 7
        • Replies: 45
        • Total: 52

        <img decoding=” title=”Sad” /> any answer?

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

          Try to split up sections by layers and show them to users based on what they want to do. Try to avoid LUA as much as possible (programming is always a trap). I can’t really give you specific advice cause it’s hard to know what’s in your head. Ask questions as you go on with the project.

          #3624
          Tronic
          Participant
            • Topics: 7
            • Replies: 45
            • Total: 52

            Thank you for your attention.
            What most interests me know and if you can have the opportunity to save a group of parameters in a separate file, in any format, "txt" or "xml" or whatever.
            And have a function to retrieve them with a browser or a panel that will be a list.
            Thank you and excuse me if I can not explain very well.

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

              there is the modulator list option that can export to csv, html, xml but if you want to "import" it later then it’s not for you, why do you want to export/import parameters ?

              #3626
              Tronic
              Participant
                • Topics: 7
                • Replies: 45
                • Total: 52
                "atom":n1a2z13g wrote:
                there is the modulator list option that can export to csv, html, xml but if you want to "import" it later then it’s not for you, why do you want to export/import parameters ?[/quote:n1a2z13g]
                I try to give an example of use.
                My synth has internally different machines for the synthesis, a section fx, and a section lfo.
                each machine has different parameters for synthesis, for example: start the sample, the end of the sample, etc..
                then save to a file only the synthesis section, and then recall it, but without changing the fx section, or LFO, which would eventually even they can be saved in separate files, so you have the sub-patch, for each group of parameters.
                So you do not have a patch only saved as a program, but you can load presets for example only the synthesis section.
                #3627
                atom
                Keymaster
                  • Topics: 159
                  • Replies: 2945
                  • Total: 3104
                  • ★★★★★

                  create a separate panel for each section, each panel will have it’s own programs and a program manager. That’s the only way to do it at this point. It might be later possible to connect panels using LUA. If you create one panel all parameters defined in it will be saved at each program save.

                  #3628
                  Tronic
                  Participant
                    • Topics: 7
                    • Replies: 45
                    • Total: 52

                    I had a look at API
                    You think I can realize the function in LUA using this class?
                    Or maybe I’m missing something.
                    [code:320u68zb]class CtrlrLuaXmlElement
                    class CtrlrLuaMemoryBlock
                    class CtrlrLuaFile
                    class CtrlrLuaUtils
                    File CtrlrLuaUtils::openFileWindow
                    File CtrlrLuaUtils::saveFileWindow[/code:320u68zb]

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

                      Well you can write stuff to files and read from them, but Ctrlr can’t create/delete modulators on the fly from LUA at this time. You can save some data in files like wave dumps, program dumps, samples and re-load them, but not really any Ctrlr structures.

                      I think it’s better to create your parts in each layer have them loaded and just show the user the part they’re currently editing. Even if I’d let LUA do the stuff you are missing it would be very slow and almost impossible to control in terms of Ctrlr being a plugin. It’s something i would not do this way.

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

                        Atom, could you give us an example of how to use OpenFileWindow? Everything I’ve tried give me errors.
                        Thx

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

                          [code:3alwjkje]
                          f = utils.openFileWindow ("open file", File(""), "*.*", true)
                          console (f:getFullPathName())
                          [/code:3alwjkje]

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

                            Thanks Atom. I can open the file, but how I work with the data? I want to open a sysex file and send this data to the midiMessageReceived, but I don’t know how to access the file data.

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

                              I made a type-o in the code so you need to wait for the latest nightly but the code that will work will be
                              [code:w7zg8hie]
                              f = utils.openFileWindow ("open file", File(""), "*.*", true)
                              data = f:loadFileAsData()
                              — data is a CtrlrLuaMemoryBlock with the contents of the file
                              console (data:toHexString(1))
                              [/code:w7zg8hie]

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

                                It works fine.
                                Great, Atom.

                                @ Tronic: Sorry for hijacking your post. :roll:

                                #3635
                                Tronic
                                Participant
                                  • Topics: 7
                                  • Replies: 45
                                  • Total: 52

                                  Many thanks Atom,
                                  but in fact I did not think of this as an opportunity to dynamically create the controls,
                                  but take only the values ​​of various modulators in a group, create an array with them and then save to a file.

                                  I was trying to use this API function but without success:
                                  [code:3mmu0lrq]luabind::object getModulatorsWildcard (const std::string wildcardMatch, const bool ignoreCase=true)[/code:3mmu0lrq]
                                  [i:3mmu0lrq]Get an array of modulators by their name, the name is matched agains a wildcard expression.
                                  So for example .getModulatorsWildcard ("*DEF", true) would return all modulators with names ending with DEF This isn’t a full-blown regex though!
                                  The only wildcard characters supported are "*" and "?".[/i:3mmu0lrq]

                                  so as to have the list of controls based on Wildcard option, and then assign to an array, take the values ​​of the modulators and pass them as data to the file.

                                  If you do not steal too much time, and you think it is a reasonable option, you could have an example of how to do this?


                                  @dasfaker

                                  do not worry, because they are indeed useful things for me

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

                                    sure thing i’ll post an example asap

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

                                      Again i had to do a small fix but the code that will work with the next nightly:
                                      [code:bc1r74k4]
                                      >>> table = panel:getModulatorsWildcard("joe*", false)
                                      >>> console (type(table))
                                      userdata
                                      >>> o = table:getObject()
                                      >>> console (type(o))
                                      table

                                      >>> for k,v in pairs(o) do
                                      console ("table key="..k)
                                      modulator = o[k]
                                      if modulator ~= nil then
                                      console (modulator:getLuaName())
                                      end
                                      end

                                      table key=3
                                      joe1
                                      table key=4
                                      joe0
                                      table key=5
                                      joe2
                                      [/code:bc1r74k4]

                                      #3638
                                      Tronic
                                      Participant
                                        • Topics: 7
                                        • Replies: 45
                                        • Total: 52

                                        Thanks so much atom.
                                        I’ll try to put down some code.

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

                                          I’m trying to save a file, but I can’t make it work. I’m using this:

                                          f = utils.saveFileWindow ("Save File", File(""), "*.syx", true)

                                          but it give me an error.

                                          I’m not sure if those commands are registered and how to put it down:

                                          f:replaceFileContentWithData (data)
                                          data = f:loadFileAsData()

                                          #3640
                                          Tronic
                                          Participant
                                            • Topics: 7
                                            • Replies: 45
                                            • Total: 52
                                            "dasfaker":282zxkzh wrote:
                                            I’m trying to save a file, but I can’t make it work. I’m using this:

                                            f = utils.saveFileWindow ("Save File", File(""), "*.syx", true)

                                            but it give me an error.

                                            I’m not sure if those commands are registered and how to put it down:

                                            f:replaceFileContentWithData (data)
                                            data = f:loadFileAsData()[/quote:282zxkzh]

                                            yes same here.

                                            I looked at the source code:
                                            file: CtrlrLuaUtils.cpp
                                            [code:282zxkzh]CtrlrLuaFile CtrlrLuaUtils::saveFileWindow(const String &dialogBoxTitle, const File &initialFileOrDirectory, const String &filePatternsAllowed, bool useOSNativeDialogBox)
                                            CtrlrLuaFile CtrlrLuaUtils::openFileWindow(const std::string &dialogBoxTitle, const File &initialFileOrDirectory, const std::string &filePatternsAllowed, bool useOSNativeDialogBox)
                                            [/code:282zxkzh]
                                            openFileWindow(const std::string[/color:282zxkzh] &dialogBoxTitle,
                                            saveFileWindow(const String[/color:282zxkzh] &dialogBoxTitle,
                                            <img decoding=:” title=”Question” />

                                          Viewing 20 posts - 1 through 20 (of 55 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