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.
    • 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
                                    • Dan KorneffD
                                      Dan Korneff @Christoph Hart
                                      last edited by

                                      @Christoph-Hart said in Content.storeAllControlsAsPreset:

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

                                      @Christoph-Hart Any chance we can get this update on your radar?

                                      Dan Korneff - Producer / Mixer / Audio Nerd

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

                                        Alright, Engine.loadUserPreset() accepts a file object now, so the minimal setup for loading and storing user presets via the native file browser is:

                                        function load(file)
                                        {
                                            Engine.loadUserPreset(file);
                                        }
                                        
                                        function save(file)
                                        {
                                            Engine.saveUserPreset(file);
                                        }
                                        
                                        // Place this anyway you like (button callbacks, whatever)...
                                        var shouldLoad = true;
                                        
                                        if(shouldLoad)
                                            FileSystem.browse(FileSystem.UserPresets, false, "*.preset", load);
                                        else
                                            FileSystem.browse(FileSystem.UserPresets, true, "*.preset", save);
                                        
                                        Dan KorneffD 2 Replies Last reply Reply Quote 4
                                        • Dan KorneffD
                                          Dan Korneff @Christoph Hart
                                          last edited by

                                          @Christoph-Hart tenor.gif

                                          Dan Korneff - Producer / Mixer / Audio Nerd

                                          1 Reply Last reply Reply Quote 2
                                          • Dan KorneffD
                                            Dan Korneff @Christoph Hart
                                            last edited by

                                            @Christoph-Hart said in Content.storeAllControlsAsPreset:

                                            FileSystem.browse(FileSystem.UserPresets, true, "*.preset", save);

                                            @Christoph-Hart Is there a way to default the browser to open the User Presets folder when using this save function? I have FileSystem.UserPresets set, but the system browser opens the last location you've navigated to.

                                            Dan Korneff - Producer / Mixer / Audio Nerd

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

                                            57

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            102.1k

                                            Posts