Forum

    • Register
    • Login
    • Search
    • Categories

    Where should I put Synth.deferCallbacks(true)?

    General Questions
    4
    15
    82
    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.
    • S
      Steve Mohican last edited by Steve Mohican

      Where should I put Synth.deferCallbacks(true); ? Only on interface script or all of the scripts attached one by one?
      My interface scpirt is like this

      Content.makeFrontInterface(645, 437);
      
      
      include("Knobs.js");
      include("CustomFunctions.js");
      
      
       
      
      d.healey 1 Reply Last reply Reply Quote 0
      • d.healey
        d.healey @Steve Mohican last edited by d.healey

        @Steve-Mohican

        Put it in all scripts that will benefit from it...

        Generally I recommend putting it at the top (under the Content.makeFrontInterface) of all main Interface scripts (and any other scripts you want to defer), but there may be occasions when that's not the way to go.

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

        S 1 Reply Last reply Reply Quote 2
        • S
          Steve Mohican @d.healey last edited by Steve Mohican

          @d-healey Thank you for the information. My script are:

          1 script have knobs and their inline functions
          1 script have serial numbers
          1 script has serial number authorization system
          1 script has navigation menu

          I should add deferring callbacks all of them individually right?

          d.healey 1 Reply Last reply Reply Quote 0
          • d.healey
            d.healey @Steve Mohican last edited by

            @Steve-Mohican

            I should add deferring callbacks all of them individually right?

            I think you are mixing up MIDI processors with external script files. When you include external scripts they are all part of the same MIDI processor, so there is only one on init callback, one on note callback etc. You only need to put one defer statement per MIDI processor.

            You can defer each MIDI processor if you want to, but that depends on if it's something the script will benefit from. If you're doing real-time MIDI stuff then you probably don't want them deferred.

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

            S 1 Reply Last reply Reply Quote 1
            • S
              Steve Mohican @d.healey last edited by Steve Mohican

              @d-healey Actually I don't know what you mean with MIDI processors, but In my Project's "Scripts > ScriptProcessors" folder there are 2 scripts, Interface and a Delay Compensation script processor. (I am making an fx plugin by the way)

              Other scripts are .js files that I am attaching seperately and they are one up directory (in "Scripts" folder)

              d.healey 1 Reply Last reply Reply Quote 0
              • d.healey
                d.healey @Steve Mohican last edited by

                @Steve-Mohican

                Yeah I should have said script processor, but they generally are MIDI processors.

                ff27efaf-3519-4b03-a284-353732bfdcf6-image.png

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

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

                  @d-healey so if I have a lot of GUI stuff happening, paint routines and animated knobs etc, is it the best way to put them in a new script processor that has

                  Synth.deferCallbacks(true);
                  

                  ?

                  Hise Develop branch
                  MacOs 12.4, Xcode 13.0
                  http://musikboden.se

                  ulrik 1 Reply Last reply Reply Quote 0
                  • ulrik
                    ulrik @ulrik last edited by

                    @d-healey I'll show you what I mean.
                    This is an LFO and I want to draw the curve while playing and having the LFO active, so it will be possible to find the right curve for the occasion.

                    I also want the "fadein", "fadeout" & "Intensity" parameters to be reflected visually

                    lfogui.gif

                    Hise Develop branch
                    MacOs 12.4, Xcode 13.0
                    http://musikboden.se

                    d.healey 1 Reply Last reply Reply Quote 4
                    • d.healey
                      d.healey @ulrik last edited by d.healey

                      @ulrik There is no point putting GUI stuff in any script other than the main Interface since this is the only one a user will ever see. So that's the place where you would most likely use defer callbacks.

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

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

                        @d-healey Ok, I understand, but the curve calculations then, should I have them placed in another script processor and defer the main Interface? Will there be any benefits doing that?

                        Hise Develop branch
                        MacOs 12.4, Xcode 13.0
                        http://musikboden.se

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

                          @ulrik deferCallback is only useful when you are doing things in the realtime callbacks. So if your curve calculation is happening in on note on for example then it might be beneficial to use deferCallbacks if you don't need the calculation to be done on the audio thread.

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

                          ulrik ustk 2 Replies Last reply Reply Quote 1
                          • ulrik
                            ulrik @d.healey last edited by

                            @d-healey Thanks! 🙂

                            Hise Develop branch
                            MacOs 12.4, Xcode 13.0
                            http://musikboden.se

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

                              @d-healey aren't all interface scripts already deferred by default anyway?

                              Tired to press F5 in the forum...
                              Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

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

                                @ustk Nope

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

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

                                  @d-healey I'm keeping to ask this redundantly... I need to tape that in once for all! 🙂

                                  Tired to press F5 in the forum...
                                  Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

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

                                  19
                                  Online

                                  794
                                  Users

                                  5.5k
                                  Topics

                                  51.6k
                                  Posts