Forum
    • Categories
    • Register
    • Login

    Call of getScriptingAudioSampleProcessor() outside of onInit callback

    Scheduled Pinned Locked Moved Solved General Questions
    7 Posts 2 Posters 838 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?

      David HealeyD 1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey @bendurso
        last edited by

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

        Synth.getSlotFX

        Is your inline function a factory function?

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        bendursoB 1 Reply Last reply Reply Quote 0
        • bendursoB
          bendurso @David 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

          David HealeyD 1 Reply Last reply Reply Quote 0
          • David HealeyD
            David 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.

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            bendursoB 1 Reply Last reply Reply Quote 0
            • bendursoB
              bendurso @David 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.

              David HealeyD 1 Reply Last reply Reply Quote 0
              • David HealeyD
                David 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.

                Free HISE Bootcamp Full Course for beginners.
                YouTube Channel - Public HISE tutorials
                My Patreon - HISE tutorials

                bendursoB 1 Reply Last reply Reply Quote 1
                • bendursoB
                  bendurso @David Healey
                  last edited by

                  @d-healey Oh nice, thanks :)

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

                  29

                  Online

                  2.1k

                  Users

                  13.1k

                  Topics

                  113.5k

                  Posts