HISE Logo Forum
    • Categories
    • Register
    • Login

    What Can Make a Component Callbacks Execute When Defined?

    Scheduled Pinned Locked Moved Solved Scripting
    17 Posts 3 Posters 681 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • clevername27C
      clevername27
      last edited by clevername27

      Other than a default preset?

      griffinboyG 1 Reply Last reply Reply Quote 0
      • griffinboyG
        griffinboy @clevername27
        last edited by griffinboy

        @clevername27

        Upon compilation they can get run as well, I'm pretty sure. Because all Ui parameters initialise at the start and this activates the callback.

        (This is the same for c++ nodes and scriptnodes too. I noticed that all the parameter callbacks get activated upon running for the first time )

        d.healeyD clevername27C 2 Replies Last reply Reply Quote 1
        • d.healeyD
          d.healey @griffinboy
          last edited by

          @griffinboy This^

          If the controls are set to save in preset then their callbacks will be triggered after on init completes.

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          1 Reply Last reply Reply Quote 1
          • clevername27C
            clevername27 @griffinboy
            last edited by

            @griffinboy Thank you - this is my concern. Is there any further clarity anyone can offer here?

            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @clevername27
              last edited by

              @clevername27 What's the issue you are having?

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

              clevername27C 1 Reply Last reply Reply Quote 1
              • clevername27C
                clevername27 @d.healey
                last edited by clevername27

                @d-healey Some control callbacks seem to be executing when they're defined. At first, I thought I had mistyped my question—but I had it right the first time. If there is no default preset, then callback shouldn't fire, because there is no preset to read from. (Thank you for your reply.)

                Already, broadcasters seem to be misfiring when they're defined—twice.

                And something…I don't know what…seems to persist even after my plugin halts.

                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @clevername27
                  last edited by

                  @clevername27 said in What Can Make a Component Callbacks Execute When Defined?:

                  then callback shouldn't fire, because there is no preset to read from

                  If they have saveInPreset enabled then the callbacks will be triggered after on init completes. This is unrelated to a default preset being set or a custom preset system being used.

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  clevername27C 1 Reply Last reply Reply Quote 0
                  • clevername27C
                    clevername27 @d.healey
                    last edited by clevername27

                    @d-healey Thank you for the clarification. Do you know how why this is a sensible thing to happen?

                    d.healeyD 1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @clevername27
                      last edited by

                      @clevername27 said in What Can Make a Component Callbacks Execute When Defined?:

                      Do you know how this is a sensible thing to happen?

                      I'm not sure what you're asking.

                      Libre Wave - Freedom respecting instruments and effects
                      My Patreon - HISE tutorials
                      YouTube Channel - Public HISE tutorials

                      clevername27C 1 Reply Last reply Reply Quote 0
                      • clevername27C
                        clevername27 @d.healey
                        last edited by clevername27

                        @d-healey How is this not a bug?

                        d.healeyD griffinboyG 2 Replies Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @clevername27
                          last edited by

                          @clevername27 It's the intended behaviour, always has been.

                          Libre Wave - Freedom respecting instruments and effects
                          My Patreon - HISE tutorials
                          YouTube Channel - Public HISE tutorials

                          clevername27C 1 Reply Last reply Reply Quote 0
                          • griffinboyG
                            griffinboy @clevername27
                            last edited by

                            @clevername27

                            It's not a bug because it's simply the parameters setting themselves.
                            I think that the xml or project itself has the knob values stored, and when opening this / compiling, each ui element goes through and sets itself up.
                            It's likely just the design of Hise. If it didn't, each knob would have nothing in there.

                            But yes, it means that making call-backs becomes tricky if you don't want the initial setup to trigger your code.

                            1 Reply Last reply Reply Quote 0
                            • clevername27C
                              clevername27 @d.healey
                              last edited by clevername27

                              @d-healey @griffinboy I appreciate that (and you both sticking with me on this). I'll rephrase -

                              In this context, a control callback is a function that is executed when a component is accessed. That can happen in one of two ways:

                              1. The user accesses the component. The value of that component is correct because, in this context, that is defined by what the user chose.

                              2. If the component is flagged to be saved in a preset, then the correct value is whatever was defined in the preset. But if there is no preset to read that from, then the value cannot be correct—because there is value to restore.

                              @griffinboy I hear your rationale. But if that's not a bug, it's something far more serious. (Or, I'm missing something.)

                              d.healeyD griffinboyG 2 Replies Last reply Reply Quote 0
                              • d.healeyD
                                d.healey @clevername27
                                last edited by

                                @clevername27 said in What Can Make a Component Callbacks Execute When Defined?:

                                if the component is flagged to be saved in a preset, then the correct value is whatever was defined in the preset. But if there is no preset to read that from, then the value cannot be correct—because there is value to restore.

                                It will use the value stored in your project's XML, this is also the initial state that will be seen when you compile your project.

                                For example in this project the slider "knbVibratoRate" will be set to 64 when I reopen the project or when the user loads a new instance of the plugin - https://codeberg.org/LibreWave/BellAndBone/src/branch/main/XmlPresetBackups/bellAndBone.xml#L26

                                Libre Wave - Freedom respecting instruments and effects
                                My Patreon - HISE tutorials
                                YouTube Channel - Public HISE tutorials

                                clevername27C 1 Reply Last reply Reply Quote 0
                                • clevername27C
                                  clevername27 @d.healey
                                  last edited by

                                  @d-healey I appreciate the extended information, and will move on. Thank you both for helping me out here, I (sincerely) appreciate it.

                                  1 Reply Last reply Reply Quote 0
                                  • clevername27C clevername27 has marked this topic as solved on
                                  • griffinboyG
                                    griffinboy @clevername27
                                    last edited by

                                    @clevername27

                                    When the ui elements get created (plugin was not loaded into daw, one becomes loaded into daw) it needs to create all of the ui elements and set them to the correct values.

                                    Settings them to the correct values triggers the callback because the values have been changed.
                                    This can be an advantage depending on the way you've scripted it.

                                    clevername27C 1 Reply Last reply Reply Quote 1
                                    • clevername27C
                                      clevername27 @griffinboy
                                      last edited by

                                      @griffinboy Thank you.

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post

                                      14

                                      Online

                                      1.7k

                                      Users

                                      11.8k

                                      Topics

                                      102.3k

                                      Posts