Forum
    • Categories
    • Register
    • Login

    Dynamic reassignment of effect slots

    Scheduled Pinned Locked Moved General Questions
    37 Posts 8 Posters 2.1k 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.
    • Oli UllmannO
      Oli Ullmann @Christoph Hart
      last edited by

      @Christoph-Hart said in Dynamic reassignment of effect slots:

      addToModuleState

      Why should we use “addToModuleState”? To save the modulation of the sliders, they have to be “saveInPreset” anyway, right? Isn't that redundant?

      1 Reply Last reply Reply Quote 0
      • Oli UllmannO
        Oli Ullmann @Christoph Hart
        last edited by

        @Christoph-Hart
        Ok, no they don't. I just checked it.

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

          Why should we use “addToModuleState”?

          Because it stores everything (including audio files & sliderpacks if applicable) and you don't need to reroute components to the new modules.

          To save the modulation of the sliders, they have to be “saveInPreset” anyway, right?

          No. The modulation connections are not part of the slider's data model. For loading / saving matrix connections you just use this method and store the string somewhere.

          EDIT: Actually you don't need to do this manually, as soon as you create a ScriptModulationMatrix, it registers itself and writes / loads its state from user presets.

          Oli UllmannO 2 Replies Last reply Reply Quote 1
          • iamlampreyI
            iamlamprey @Christoph Hart
            last edited by

            @Christoph-Hart aww man I just did it all manually

            1 Reply Last reply Reply Quote 0
            • Oli UllmannO
              Oli Ullmann @Christoph Hart
              last edited by

              @Christoph-Hart
              Great, thanks for the info. :-)

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

                Does any kind soul have a snippet that demonstrates how to use Engine.addModuleStateToUserPreset???

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

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

                  @Orvillain

                  // In onInit
                  Engine.addModuleStateToUserPreset("InsertNameOfModule");
                  

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

                  OrvillainO 1 Reply Last reply Reply Quote 0
                  • OrvillainO
                    Orvillain @David Healey
                    last edited by

                    @d-healey So Do I have it right then.... call that function for every module that I want to save to a preset.... save to a preset in the browser..... then when I load it, those things will be recalled both in the module tree and the connected UI parameters, regardless of if saveInPreset is enabled????

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

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

                      @Orvillain It will be recalled to the module tree, not sure about the UI parameters but Christoph seems to indicate that with this dynamic effect slot system that it will be.

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

                      1 Reply Last reply Reply Quote 0
                      • Oli UllmannO
                        Oli Ullmann @Christoph Hart
                        last edited by

                        @Christoph-Hart
                        When I try to follow your advice with a HardcodedMasterFX, I get the following error message:
                        Can't store modules with child modules

                        Is it not possible to use Engine.addModuleStateToUserPreset with a HardcodedMasterFX?

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

                          those things will be recalled both in the module tree and the connected UI parameters, regardless of if saveInPreset is enabled????

                          It will be recalled to the module tree, not sure about the UI parameters but Christoph seems to indicate that with this dynamic effect slot system that it will be.

                          No UI parameters are not part of the module that is restored with its state so they won't update automatically. But you can call this method after loading a user preset to ensure that all connected sliders are synced to their internal values:

                          https://docs.hise.dev/scripting/scripting-api/userpresethandler/index.html#updateconnectedcomponentsfrommodulestate

                          Is it not possible to use Engine.addModuleStateToUserPreset with a HardcodedMasterFX?

                          Do you have any modulation slots enabled? If yes then this is preventing you from restoring the hardcoded FX because currently you can only restore modules that have no child modules with this function. But I might have to change this to allow it for hardcoded modules as this would be very limiting.

                          Oli UllmannO DanHD 2 Replies Last reply Reply Quote 1
                          • Oli UllmannO
                            Oli Ullmann @Christoph Hart
                            last edited by

                            @Christoph-Hart
                            Ah, okay, that's where the problem lies...
                            Yes, I have enabled modulation slots.

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

                              @Oli-Ullmann Alright this is fixed now - you can call this on modules with child elements now but the child elements will not be modified at all - the rule that rebuilding child elements is dangerous still stands, but this is a valid use case to restore a module without its modulation slots (which are restored by the script modulation matrix anyways).

                              Oli UllmannO 1 Reply Last reply Reply Quote 2
                              • Oli UllmannO
                                Oli Ullmann @Christoph Hart
                                last edited by

                                @Christoph-Hart
                                That's great, thanks! I'll try it out and give feedback if I encounter any problems. Thanks very much! :-)

                                1 Reply Last reply Reply Quote 0
                                • DanHD
                                  DanH @Christoph Hart
                                  last edited by

                                  @Christoph-Hart said in Dynamic reassignment of effect slots:

                                  https://docs.hise.dev/scripting/scripting-api/userpresethandler/index.html#updateconnectedcomponentsfrommodulestate

                                  What if the controls are not connected by Parameter ID etc but via scripting instead (as lots of mine are as they do more than one job...)

                                  DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                  https://dhplugins.com/ | https://dcbreaks.com/
                                  London, UK

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

                                    @Christoph-Hart said in Dynamic reassignment of effect slots:

                                    Just a small heads up that we have this now:

                                    https://docs.hise.dev/tutorials/ui/index.html#draggable-fx-chain

                                    I noticed one small anomaly about this example. If you add more effects to the example script, you need to set the panel's saveInPreset to false temporarily to update the JSON effect list, then reenable it again!

                                    Sonic Architect && Software Mercenary

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

                                      @Christoph-Hart said in Dynamic reassignment of effect slots:

                                      Just a small heads up that we have this now:

                                      https://docs.hise.dev/tutorials/ui/index.html#draggable-fx-chain

                                      As it turns out, that was reasonably easy to add.

                                      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 1
                                      • HISEnbergH
                                        HISEnberg @Orvillain
                                        last edited by

                                        @Orvillain Agreed so far I am really happy about this! Very simple to use. Need to test it out in some real world examples still!

                                        Sonic Architect && Software Mercenary

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

                                          I'm bumping up against an issue I can't solve in this snippet. How do you filter the list of effects so only certain ones can be rearranged?

                                          In my case I may have certain effects like Routing Matrices, or Input and Output Gains that I want in fixed places (beginning and end of chain).

                                          **Edit I did resolve this with some back and forth with AI. I think someone can come up with a cleaner solution since it should hypothetically be fairly simple to filter the list of effects.

                                          What A(I) did was make edits to the make() and onChange() functions.

                                          On make() I manually created the Fx List and added a startIndex and endIndex. Then in onChange I you just need to offset the indices (add startIndex) so setEffectChainOrder() get's the right positions.

                                          I'll spare the forum some AI slop but here is a sloppy HISE snippet in case anyone needs it and no better solutions present themselves!

                                          HiseSnippet 3356.3oc4ZrzbabadokXhIyilzISaNhvoMyJKZZR4GwItJRzRhxrUxVURwwcT03AbWPxsd4hs6BpGoUyzi8VOma8uQukC8XNzYx0dno8T6o9On86C.6tXIWIqH6jFmROdnvGvG9d+..bqHtCKNlGYUp5tGGxrJ8pk243.wvUFR8Br5tJ.u7pQzA6xhEV283PZbLy0pToYVGmuTkYsje92KcWpOMvgkAxx5gbOG1Fdi7DYP2Z4elmueGpKaWuQFq9FK20gGrB2mOF3kYJ2zJj57D5.18o3xtTYq6QiGZU5Jku0s6078d+92t+BLVudNuO0s4MYLmaQ6068ZRasfae1scu40utUoWZMWOAOZGAUvhsJM6c4tGuyP9gAJB7PuXud9LbPKqc.Jq.2g66hhHB0Zkgd9taknjhsrJUdqLU1LJU1aUdSOWuT3Ypt2PNAICCSEXoKkm8lIG60xj8ZZvd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S1JIbBmrUxjlNEurxn7JkSSkqe6zrw4d6TETzIVI8+wO8S+xk9XlnMb9p.goJAhmy+p4fyHOVLIrmaZthdX3BiG+gkyjBxyRliYOegEm8Sr++HC9kKqJWK0HoCLUAaCBoV5+rO+y+qK8w4x4CpijnqLX+skTgyeWHvnhRO85k2waTnOS0RiVaoGjSaw4ivGHJKr3etzpzQg.GmkQ5efQJa.H6m.6K+j+7RqFcrIrOa8u7ekSYK2KHoD6SXf2pAE9Su3pcub5O+Fo1c8jXyWRVN+L9o2.Ijy6hYYMgi4uX4B9w4zU9R.aw8oQSVp84V9mYO28Cfhz2Bx7bN42uupH8KRLrzk3EGF9MvNt++uRQudZuGvYfkmsWpM9AxwjOFNU.YcFbNeTY05LxI7WNu+b7BO2+b7dfi.H+tQzf3PdbtMdG1HucgyPEaB7ihYXaiailOS3qvwGrnfofxmfPVHNYcmLYSUSmsZ1yW1pmxuxuY+V2uxuW.N9Wt9Mqjvip5YqAka7giiml+rOcruHAZde4M4A7vg7.OGSC81LHFDu.FSduPApsPjqIr2Z4sY9LpoS6OZ4M.mMZjQ6CeU0EOm589sKqXWBF.Rdw8X6y7c6isaZNKqne0x6HXQLNPSj3updHoyix6NCUxL6Eaply9l2m6Yu55E2N9MQE0uInwHpSD+wNpqsDU9WVBAj6.4uX8Jk2DGSRuuxrfhQP4hG63jeqlBwEtnHd8KJh23hh3MunHdqKJhu2EEwa+zQDql2drfqdPYXAat0ZxaVtTo0BvmASFlX8eAjtAwbG
                                          

                                          Sonic Architect && Software Mercenary

                                          ustkU 2 Replies Last reply Reply Quote 0
                                          • ustkU
                                            ustk @HISEnberg
                                            last edited by ustk

                                            @HISEnberg if it's just in the beginning and the end of the chain, then you can re-order them using the range parameter and an offset. In fact, even in the case you have fixed FXs in the middle, it should be possible to re-order in two chunks, before and after.

                                            In the end it is just juggling with position numbers.

                                            if you have 10 fx in total, and want to re-order from 3 to 7 (0 based, 3 fixed at start and 2 at the end)

                                            the the slotRange is [3, 7] and chainOrder is for instance [4, 7, 6, 3, 5]
                                            This leaves 0,1,2 and 7,8,9 untouched

                                            If your chainOrder is based on indexes from 0 to 4, just add an offset of 3

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

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

                                            32

                                            Online

                                            2.1k

                                            Users

                                            13.0k

                                            Topics

                                            112.6k

                                            Posts