Different behaviour using vst instance of a panel

Home Forums General Using Ctrlr Different behaviour using vst instance of a panel

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #23184
    dasfaker
    Keymaster
      • Topics: 80
      • Replies: 793
      • Total: 873
      • ★★★

      My panel behaves differently at startup if I use Ctrlr inside Ableton or if I use a vst instance of the panel.

      Instead of sending all modulators values with the option “Modulator does not output any MIDI during startup”, once the panel is loaded I collect all values in a memoryblock and send it to the synth.

      When I use Ctrlr inside Ableton the panel works as expected (I can for example change a patch and save the Ableton project, and when I reopen it, all modulators have their last value), but when I use the vst instance of the panel and reopen the Ableton project, all modulators have always the original value they had when I exported the instance.

      Another difference: Using the vst instance, all modulators that are linked trhu LUA send their midi value before the panel has finished loading (somehow they are triggered before they should, before receiving any incoming midi or lua code). This doesn’t happens using Ctrlr inside Ableton, only with the vst instance. The .dll version do things at startup in a different way.

      Is this normal?

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

        An update to the issue.

        On method “Called when the panel has finished loading” I call a function to collect the values of all modulators and store them in a memoryblock.

        With exported instances, the values I get are those present when I exported the instance (the initial values) and not the stored values when I save the project in Ableton. I have to execute this function again thru the console to get the correct values when the panel has loaded completely.

        It seems that the stored values of modulators in the Ableton project are not available while method “called when the panel has finished loading” is running, until it is finished I only get the initial values of the instance.

        I thought the cause was that the method wasn’t called on loading, but this is not the case, the method is executed.

        Atom, can you explain us a bit how and when the host pass the stored values on the project to the plugin (I don’t know if it works this way, or if it’s the plugin who store the values)

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

          My panel behaves differently at startup if I use Ctrlr inside Ableton or if I use a vst instance of the panel.

          Just a sanity check for you here – I’ve seen this too.. so it is “normal” but i wouldn’t call it desirable.

          I have seen similar issues – for me it manifests with the “called when panel is loaded” scripts. In my findings (yours seem to differ) – some things in there work, some things do not depending on whether it’s an exported VST from ctrlr or a panel opened in ctrlr within the DAW. PITA as you need to export the VST, trash the panel’s preferences/settings file and restart the DAW with the new exported instance to debug.

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

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

            Yes, debugging an exported instance is hard.

            Atom, can you explain us a bit how and when the host pass the stored values on the project to the plugin (I don’t know if it works this way, or if it’s the plugin who store the values)

            BUMP. I would like some info here, please.

            • This reply was modified 9 years, 9 months ago by dasfaker.
            #25907
            atom
            Keymaster
              • Topics: 159
              • Replies: 2945
              • Total: 3104
              • ★★★★★

              It’s hard to say what you mean here.

              In a single instance (when a panel is exported as an instance):
              When the host loads a plugin it passes a “blob” of binary data to it, that’s the data that the same plugin sent to the host when the project was saved (if this is a new project this data is simply 0 size). The plugin converts the data to suite it’s needs (in out case it’s an XML document that has values for all modulators or a PROGRAM). Once that’s verified that it’s a valid it’s set to the panel.

              In case of a normal multi-panel situation, the data that’s saved to the host is a complete state of Ctrlr (all panels with all values, resources etc.). Since you can’t tell the future and if this data would disappear or got moved from disk (resources) then the next time you’d load the project it would simply be broken.

              All this code is in one file in the GIT repo called CtrlrManagerInstance.cpp

              there are a lot of lines that make decisions based on getInstanceMode() call that tells if we’re in an normal MULTI or SINGLE instance.

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

                On method “called when the panel has finished loading” I collect all modulator values in a MemoryBlock and send this to the synth. This is the way I send to the synth the values stored on a project in the DAW, as I have set to “Mute” the option “modulator does not output any MIDI during startup” for all modulators.

                What I’m seeing is that the values collected in the MemoryBlock are always those present when I exported the instance (an init patch) and not the values present when I saved the Daw project (not an init patch).

                It seems that the values stored on the project are passed to Ctrlr after method “called when the panel has finished loading” is executed. This is what I want to confirm.

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

                  That seems logical, since in an instance the panel first needs to finish loading (create all modulators, resources, connections) to be able to change the state of all those loaded components (set a program) – remember that there are relationships between loaded components so they ALL must exist for a program to be complete.

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

                    Then I have a problem. How can I collect the values then? I’ve tried with timers, but as they are called in this method I still get the same result. Do I would need a new method named “called when the panel has finished method “called when panel has finished loading””? What do you suggest? I need to send the values to the synth in this way.

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

                      Have you tried the callback after a program change ? Once that happens the panel should have complete new program data.

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

                        No, I’ve not tried that. Do you mean that this method is called when the Daw pass the data to the instance at startup? That would be all I need.

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

                          Well it should (unless i fucked something up and i’ll fix that), but yes it should since the DAW passes a blob of data that’s treated like a program

                          you can see that on line 172 in method restoreInstanceState that call CtrlrPanel::setProgram that calls the Lua method, so it should work.

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

                            Thanks so much for the info, this issue was driving me nuts!

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

                              Finally it is really working as expected.

                              This explains why some of us were reporting a different behaviour of exported instances, as everything performed in method “called when panel has finished loading” is based on initial modulator values and not on stored modulator values.

                              Thanks again.

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

                                It seems that in .panel instances, method “Called after a program change” is executed before method “Called when the panel has finished loading”, but in exported vst instances it’s reversed (at least it’s what I see in the log file).

                                So right now I have to call my init functions from both methods to avoid errors.

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