HISE Logo Forum
    • Categories
    • Register
    • Login

    Content.storeAllControlsAsPreset

    Scheduled Pinned Locked Moved Scripting
    31 Posts 5 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.
    • ustkU
      ustk @d.healey
      last edited by

      @d-healey In fact, that wasn't the idea, because you still might want to store these controls in the global preset... But again, maybe not enough people will find this useful so... 😇

      Can't help pressing F5 in the forum...

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

        @ustk No I meant disable the saveInPreset button only when saving a sub-preset, the rest of the time you have saveInPreset enabled. I'm not sure if you can actually do this so it's just an idea.

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

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

          Somewhat related to this discussion.

          The Engine.loadUserPreset(""); function is causing this console message - Do not load user presets at startup. . This also happens in the custom preset browser example project.

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

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

            What about having the possibility to store only a bunch of controls of our choice, like a sub-preset for an FX section of an instrument, etc...?

            I had this idea also a few years back, but backwards-compatibility is more important. If you add a control to your plugin, all user presets made with an older version will not change this control then (because it would be the same as your "subset"). For example if it's a convolution reverb with a big impulse response every preset will sound like it's placed in a cathedral which goes against the intuition of the preset builder.

            The solution to this is to simply reset all controls to the default value if the control value is not found in a user preset (which is the case if you load an old user preset with an newer version). This way you just need to make sure that the default value is not modifying the sound if you add new stuff, and you're good to go.

            I'm not sure if you can actually do this so it's just an idea.

            It's a pretty bad idea actually. The saveInPreset flag is not supposed to be changed after initialisation, there are tons of weird edge cases that makes this just asking for trouble.

            Do not load user presets at startup.

            I can't remember adding this safe check, but it's a good one. Why would you want to load a user preset at the beginning? Just make sure you've exported the plugin with the exact state of the user preset.

            d.healeyD 1 Reply Last reply Reply Quote 2
            • d.healeyD
              d.healey @Christoph Hart
              last edited by

              @Christoph-Hart

              Why would you want to load a user preset at the beginning?

              I don't :) I have a button that when clicked calls the Engine.loadUserPreset() function and that is generating the message. The button has saveInPreset disabled.

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

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

                Ah OK, then I'll take a look why it fires that false positive thingie. Better safe than sorry :)

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

                  Just looked, it checks the initialisation state which should be set to false after the initial state has been loaded. So I understand it right that this is happening when clicking a button with the mouse, yes?

                  d.healeyD 1 Reply Last reply Reply Quote 0
                  • d.healeyD
                    d.healey @Christoph Hart
                    last edited by

                    @Christoph-Hart Correct

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

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

                      I just realised you'd already suggested my getFiles function a couple of weeks ago :p https://forum.hise.audio/topic/1146/viewport/24

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

                      1 Reply Last reply Reply Quote 0
                      • lalalandsynthL
                        lalalandsynth
                        last edited by

                        Sub presets could be useful to save lfo shapes , just stumbled upon the need to do that so i thought I would mention it.

                        https://lalalandaudio.com/

                        https://lalalandsynth.com/

                        https://www.facebook.com/lalalandsynth

                        https://www.facebook.com/lalalandsynth

                        1 Reply Last reply Reply Quote 1
                        • Dan KorneffD
                          Dan Korneff @d.healey
                          last edited by

                          @d-healey said in Content.storeAllControlsAsPreset:

                          It's also not possible to add sub-folders in the file path.

                          Was this ever added? I'm playing with Content.storeAllControlsAsPreset() and I can only create a preset in the main User Presets directory. @d-healey Is there a way to set sub-folders?

                          Dan Korneff - Producer / Mixer / Audio Nerd

                          d.healeyD 1 Reply Last reply Reply Quote 0
                          • d.healeyD
                            d.healey @Dan Korneff
                            last edited by

                            @dustbro Not that I know of

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

                            1 Reply Last reply Reply Quote 1
                            • Dan KorneffD
                              Dan Korneff
                              last edited by

                              @Christoph-Hart please? 😻 😻 😻

                              Dan Korneff - Producer / Mixer / Audio Nerd

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

                                What if you could just pass a ScriptFile object into these methods:

                                Engine.loadUserPreset( String relativePathWithoutFileEnding)
                                Engine.saveUserPreset(String presetName);
                                

                                Then you can create subfolders, add new files etc. as much as you want.

                                const var f = FileSystem.getFile(FileSystem.UserPresets).getChildFile("MyFunkySubFolder/AnotherSubFolder/3LevelSubfolder/Mindblowing4LevelSubfolder/Preset.preset");
                                
                                Engine.saveUserPreset(f);
                                

                                The old functionality will remain the same (so passing in a String will do whatever it does now).

                                d.healeyD Dan KorneffD 2 Replies Last reply Reply Quote 4
                                • d.healeyD
                                  d.healey @Christoph Hart
                                  last edited by

                                  @Christoph-Hart Looks good!

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

                                  1 Reply Last reply Reply Quote 0
                                  • Dan KorneffD
                                    Dan Korneff
                                    last edited by

                                    That's perfect!

                                    Dan Korneff - Producer / Mixer / Audio Nerd

                                    1 Reply Last reply Reply Quote 0
                                    • Dan KorneffD
                                      Dan Korneff
                                      last edited by

                                      my only gripe with saveUserPreset() is that you have to load a preset first.
                                      I had a method where I loaded an empty preset before saveUserPreset(), which was working great on everthing EXCEPT protools :( It didn't like the empty preset.

                                      Is there some method I'm overlooking to load a preset without changing your current control settings? It just seems backwards to me 🙃

                                      Content.storeAllControlsAsPreset() was great cause you could skip the whole "load a preset first" thing.

                                      Dan Korneff - Producer / Mixer / Audio Nerd

                                      d.healeyD 1 Reply Last reply Reply Quote 0
                                      • d.healeyD
                                        d.healey @Dan Korneff
                                        last edited by

                                        @dustbro all a preset does is store and restore control settings, so what would be the point of a preset that didn't change the controls when loaded?

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

                                        Dan KorneffD 1 Reply Last reply Reply Quote 0
                                        • Dan KorneffD
                                          Dan Korneff @d.healey
                                          last edited by

                                          @d-healey that's kind of my point. You can't use saveUserPreset() without first calling loadUserPreset() or else the newly saved preset will be created in an unexpected location.
                                          From my testing, you have to load an existing preset within the sub folder location you want to save to. Then saveUserPreset() makes a duplicate (child? ) of that file and saves the new data to it.
                                          So if you want to save your current settings as a preset, having to loading a preset first (which would change your controls) seems counterintuitive.
                                          Maybe @Christoph-Hart could clarify

                                          Dan Korneff - Producer / Mixer / Audio Nerd

                                          d.healeyD 1 Reply Last reply Reply Quote 0
                                          • d.healeyD
                                            d.healey @Dan Korneff
                                            last edited by

                                            @dustbro ah I see the problem now, I think the changes proposed by Christoph will solve this already.

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

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

                                            49

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            102.1k

                                            Posts