HISE Logo Forum
    • Categories
    • Register
    • Login

    How to Change Order of the Stacked Effects

    Scheduled Pinned Locked Moved General Questions
    26 Posts 11 Posters 3.0k 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.
    • LindonL
      Lindon @ustk
      last edited by Lindon

      @ustk said in How to Change Order of the Stacked Effects:

      (at least none I can think of to replace 15 or more panels, which is absolutely not a good start).

      Why? It works like a dream for me...as you can see in the example I posted 5 slots with 7 FX in each = 35 panels, works fine, no CPU or graphics overload....

      HISE Development for hire.
      www.channelrobot.com

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @Lindon
        last edited by

        @Lindon For two reasons:
        It's good you don't have graphic overloads because I had some in the first tests I've made long ago. So I would be afraid to get glitchy graphics on some user smaller systems...
        But the main reason (if the graphic load is ok) is the maintenance and the UI list growing exponentially, requiring huge component declarations.
        I don't say it doesn't work or it is bad, but I prefer dynamic stuff with only one panel and some factory. The only issue with child panels is the impossibility of inserting something else than a panel. So knobs have to be panels too...

        Hise made me an F5 dude, browser just suffers...

        1 Reply Last reply Reply Quote 0
        • DabDabD
          DabDab @ustk
          last edited by

          @ustk Ok... Thank you :)

          Bollywood Music Producer and Trance Producer.

          1 Reply Last reply Reply Quote 0
          • ?
            A Former User @Christoph Hart
            last edited by

            @Christoph-Hart This is really interesting!! I think I'll try this one! But what I don't quite get yet is the dsp.get("reverb") for example. So the reverb is a container in your DspNetwork? Or wrapped ones?

            1 Reply Last reply Reply Quote 0
            • OrvillainO
              Orvillain @Christoph Hart
              last edited by

              @Christoph-Hart said in How to Change Order of the Stacked Effects:

              @ustk said in How to Change Order of the Stacked Effects:

              Scriptnode has nothing to do with this, it's more a modular DSP environment.

              Actually it is a bit more convenient to implement a dynamic signal chain that can be scripted using scriptnode.

              // Create a DSP Network
              const var dsp = Engine.createDspNetwork("dsp") ;
              
              // Create a list of all effects that you want to assign
              const var fx = [dsp.get("reverb"), dsp.get("delay")];
              
              // Create the ID list for the slots 
              // (they are just simple containers but it helps avoiding
              // fiddling with the indexes)
              const var slots = ["slot1", "slot2"];
              
              
              // This function will take an array with slot indexes
              // and move them into the slots defined above
              inline function setOrder(order)
              {
                  local i = 0;
                  
                  for(i = 0; i < order.length; i++)
                  {   
                      local idx = order[i];
                      fx[i].setParent(slots[idx], 0);
                  }
              }
              
              
              // Use -1 to remove the effect (not assign it to anything)
              setOrder([-1, -1]);
              
              setOrder([0, -1]);
              
              setOrder([1, 0]);
              

              Now all you need to do is to implement a dragging UI using script panels and then call setOrder with the updated index array (this is rather a tedious task but you would have to implement it anyway).

              Hey Chris, is this the right approach in 2025?

              I was thinking I'd add slotFX instances, and then write a callback to update each slot with the specified network name. But which is better or more future proof?

              Musician - Instrument Designer - Sonic Architect - Creative Product Owner
              Crafting sound at every level. From strings to signal paths, samples to systems.

              HISEnbergH 1 Reply Last reply Reply Quote 0
              • HISEnbergH
                HISEnberg @Orvillain
                last edited by

                @Orvillain Yup you are on the right track. I find it best to follow the Module order (which networks are placed in which Hardcoded Master FX) and update your UI components from there, but you can do it either way.

                I made a template about this a few months ago:

                Link Preview Image
                Modular FX Template - changing Fx order with drag and drop panels

                Alright this is probably the least frustrating way to set this up to share on the forum. I realize the effects won't be shared either unless they are in Scri...

                favicon

                Forum (forum.hise.audio)

                OrvillainO 1 Reply Last reply Reply Quote 1
                • OrvillainO
                  Orvillain @HISEnberg
                  last edited by Orvillain

                  @HISEnberg Nice one! I'll take a looksie. I'm not really bothered about dragging and dropping right now. Just the raw mechanics of switching the effect order across a bunch of SlotFX entries.

                  Musician - Instrument Designer - Sonic Architect - Creative Product Owner
                  Crafting sound at every level. From strings to signal paths, samples to systems.

                  HISEnbergH Christoph HartC 2 Replies Last reply Reply Quote 0
                  • HISEnbergH
                    HISEnberg @Orvillain
                    last edited by

                    @Orvillain Understandable. You can replace that whole "drag n drop" system with simple comboboxes.

                    The code is pretty verbose but I tried to keep it modular enough to follow the different functions. I recommend putting it through an AI and directing it to just remove the drag and drop panels so you can study the SlotFX API.

                    As a side note, it isn't ready yet but I know Christoph is working on a DynamicContainer Component which will allow you to attach/detach the UI components to the module, so eventually this whole system will be a lot cleaner.

                    On the audio/module side it is quite clean to switch networks in the HardcodedMasterFx. For that reason I really recommend starting from the Engine.addModuleStateToUserPreset and building your UI accordingly.

                    Hope my ranting is clear here!

                    1 Reply Last reply Reply Quote 1
                    • Christoph HartC
                      Christoph Hart @Orvillain
                      last edited by Christoph Hart

                      @Orvillain actually with the (not finished) addition of the dynamic container system which will be the goto solution for dynamic FX racks (once it leaves the experimental stage) you can leave the effects in the same slot modules and just tell them to be rendered in a different order.

                      The connection and API with the UI will change at some point, but there is also a new API call that's completely undocumented (because it's part of this new system which is not 100% ready yet), but since 2025 is not over yet, I would suggest this as an option:

                      HiseSnippet 1581.3oc4Y8zaaTDEe23rkFWnpEJzJwkUUbHEBodsSSCpBrShsSsvI1xq6ePUUlw6N1dU2clkcmMfKhybjy8FeM3i.23i.HjPpbhuAva1cs2YcLINl7mphOX44Myad+l2+mwM8nFXeepmjb11CcwRxuoh9PBav1CPVDoZkkjurxtHeF1SMhzVCcQ99XSIY4L6vIHuzhRge9qhagrQDCbBIIoGRsLv0sbrXITaV5ysrsqhLwssbDV8ZkpYPIaSsoA.dxnjSxEY7LTe7dH9xVPQ59H+ARxenBt6Zn6lecyB423N4JT.kK2FZFcQ4t6FcWO2F4WG00nqFdsbRxWnhoEi5oyPLrOroaQMGpOf90jHA7PKeqt1X9.MIcPxQjk1dfksYyQJGeIIYklIppLQppqorqko0X5IprqDNgZBGhJM4ENLHocLfjr.jVLBRWUQ2vyxkkLCGOWRoFArf8PfsQDJQqUZgueAksovJHrUcPOCW0CFLlikWOWtUTgut08xlErO9L08QdpQNEgmY0OUMzmY09XVHJCGs7ME8atYZtaUoQqxUZ0oYi5eQmpOF1gdHae78DVhd8Fs6zZy81oBL6S.HT3ovVb6aC79vJs1R8i+L0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wLriUaJA6mh5DbjepbjhZYLKfjdqiHkZUbUQUPUnIVmeDw7hDahHo1LXbpcJUGZ+Zwnp25X3ja1v2.TLgQwhQlA193vKFnIxXB47hjuOxybx1GlLncF6uJ8crEV+Thluv4vi5c3217r6sDl+KDOk6hdk36hVg.WMjBThZptLtGJvlMhZ53vcoDp6.JwJkUuEFRezuONkyzTOPaxXHwlAuVoVXaLzBYBoOnTcKBF4IbSziqt3DpdvMThfqJO4g54hc6D4cexLSu6yIBFOGdqmYO5CxG9psU75JPd47pglR0yGa4qKMc3fL7ncLhd5ZdP+ECo.maR3eL0RJ6xGqpIE9b1hJSGnjQGCiza0AXL+7xXg4kw0lWFuy7x35yKi2cdYbiilQdE8MCXTmnXCnMmlUhdh.4wuOgbFo+A.NMM8a
                      

                      Relevant code:

                      const var MasterChain = Synth.getChildSynth("Master Chain");
                      
                      const var REORDER_POLY_FX = false;
                      const var SLOT_RANGE = [0, 3];
                      
                      // REVERB -> PHASER -> SATURATOR 
                      MasterChain.setEffectChainOrder(REORDER_POLY_FX, SLOT_RANGE, [0, 1, 2]);
                      
                      // PHASER -> SATURATOR -> REVERB
                      //MasterChain.setEffectChainOrder(REORDER_POLY_FX, SLOT_RANGE, [1, 2, 0]);
                      
                      // SATURATOR -> PHASER -> REVERB
                      //MasterChain.setEffectChainOrder(REORDER_POLY_FX, SLOT_RANGE, [2, 1, 0]);
                      

                      This will also show the current processing order in the module tree like this:

                      47410819-e4c8-4fa5-8bd9-7a944bb2e531-image.png

                      HISEnbergH 1 Reply Last reply Reply Quote 4
                      • HISEnbergH
                        HISEnberg @Christoph Hart
                        last edited by

                        It's.... so much less code 🤤

                        meme.gif

                        Christoph HartC 1 Reply Last reply Reply Quote 0
                        • Christoph HartC
                          Christoph Hart @HISEnberg
                          last edited by

                          @HISEnberg yup and the drag container will create and update the index array automatically but that part is not ready yet…

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

                          25

                          Online

                          2.0k

                          Users

                          12.6k

                          Topics

                          109.5k

                          Posts