HISE Logo Forum
    • Categories
    • Register
    • Login

    Call of getScriptingAudioSampleProcessor() outside of onInit callback

    Scheduled Pinned Locked Moved Solved General Questions
    7 Posts 2 Posters 37 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.
    • bendursoB
      bendurso
      last edited by

      Sometimes when I load a preset, HISE prints the following error:

      Call of getScriptingAudioSampleProcessor() outside of onInit callback
      

      It points to a line where I'm using Synth.getSlotFX inside an inline function.

      It happens once in a while. Why?

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

        @bendurso said in Call of getScriptingAudioSampleProcessor() outside of onInit callback:

        Synth.getSlotFX

        Is your inline function a factory function?

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

        bendursoB 1 Reply Last reply Reply Quote 0
        • bendursoB
          bendurso @d.healey
          last edited by

          @d-healey It's a inline function of a combobox.

          inline function onEffectComboboxControl(component, value)

          I have a lot of things inside because it's for changing the hardcoded module networks

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

            @bendurso I see. When you use functions that create references, like Synth.getSlotFX or Content.getComponent() you should place these in on init and store the reference in a const.

            Then use that reference throughout the rest of the script, rather than creating a reference each time you want to access the module.

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

            bendursoB 1 Reply Last reply Reply Quote 0
            • bendursoB
              bendurso @d.healey
              last edited by

              @d-healey Oh, but I can't place it on init. Because I have just one inline function for 36 comboboxes. So I'm using getSlotFX depending the selected combobox index.

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

                @bendurso Put all your slot fx into an array, and all of your combo box references in another array. Then you can use the index of the combo box that was clicked to select the correct slot fx.

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

                bendursoB 1 Reply Last reply Reply Quote 1
                • bendursoB
                  bendurso @d.healey
                  last edited by

                  @d-healey Oh nice, thanks :)

                  1 Reply Last reply Reply Quote 0
                  • bendursoB bendurso marked this topic as a question
                  • bendursoB bendurso has marked this topic as solved
                  • First post
                    Last post

                  21

                  Online

                  1.7k

                  Users

                  11.8k

                  Topics

                  102.6k

                  Posts