HISE Logo Forum
    • Categories
    • Register
    • Login

    Dynamic reassignment of effect slots

    Scheduled Pinned Locked Moved General Questions
    24 Posts 7 Posters 1.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 @Orvillain
      last edited by

      @Orvillain
      PS. I wanted to work with hardcoded effects and HISE internal effects, which is why I used an effect slot and a hardcoded effect, which I switched to bypass depending on the effect selection.

      Unfortunately, the bypass didn't work reliably, so I actually had to load the effects individually. It's not an ideal solution, but unfortunately I couldn't find another one. Since you only use hardcoded effects, this shouldn't be a problem for you.

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

        @Orvillain
        PPS. In the label callback, after loading the effect, I set the value of the CombBox so that it displays the correct effect name. However, I did not use the changed() function, as this would have created a loop.

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

          @Orvillain For points 2 & 3 I dealt with this by setting the state of my UI via the Engine.addModuleStateToUserPreset. Initially I made the mistake of constructing my dynamic-fx system around the UI components and it took me a while to undo this decision.

          I found the benefits of constructing your system with the Module State means your UI can update according to whatever information is found in the modules, so your presets can load and save correctly, etc. I used a timer at the time but a broadcaster is arguably a better method now.

          For point 1 about the matrix modulator I can't say as I haven't integrated this into a dynamic-fx system. I imagine if the user is rearranging the fx you are going to have to store then clear modulation connections first, then restore them once the effect is in a new position.

          Sounds like @Oli-Ullmann has some interesting ideas on how to do this as well!

          Sonic Architect && Software Mercenary

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

            Just a small heads up that we have this now:

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

            Which should integrate well with the other ideas you‘re suggesting so the reordering is not too much out there.

            Oh and yeah definitely go with addToModuleState and not the saveInPreset route for every component.

            Oli UllmannO iamlampreyI HISEnbergH OrvillainO 5 Replies Last reply Reply Quote 3
            • 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.

                        d.healeyD 1 Reply Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @Orvillain
                          last edited by d.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 @d.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.

                            d.healeyD 1 Reply Last reply Reply Quote 0
                            • d.healeyD
                              d.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
                                            • First post
                                              Last post

                                            19

                                            Online

                                            2.0k

                                            Users

                                            12.8k

                                            Topics

                                            111.1k

                                            Posts