HISE Logo Forum
    • Categories
    • Register
    • Login

    Engine.loadUserPreset for expansions?

    Scheduled Pinned Locked Moved General Questions
    28 Posts 2 Posters 807 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.
    • bendursoB
      bendurso
      last edited by

      Does Engine.loadUserPreset work with expansions?

      When I use a relative path, it adds "User Presets" at the beginning. If I use an object from full path, it crashes.

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

        Try this 50219bb2-13bc-4384-b82e-99ca43e5068a-image.png @bendurso

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

        bendursoB 1 Reply Last reply Reply Quote 0
        • bendursoB
          bendurso @d.healey
          last edited by

          @d-healey Thanks, it should be like this?

          local wildcardReference = expHandler.getCurrentExpansion().getWildcardReference("UserPresets/" + "myPreset.preset");
          
          Engine.loadUserPreset(wildcardReference);
          

          This relative path it's not working. And I'm not sure how to convert this into an object

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

            @bendurso Do you only have one column in your preset browser?

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

            bendursoB 1 Reply Last reply Reply Quote 0
            • bendursoB
              bendurso @d.healey
              last edited by

              @d-healey Oh yeah I forget the folder, but still is returning a wrong full path with this.

              The console returns:
              User preset /Volumes/Ben/Hise Projects/Raizes Player/UserPresets/{EXP::Auralis}UserPresets/Category 3/Native Preset.preset doesn't exist

              Because it adds "UserPresets" before the {EXP::Auralis}

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

                @bendurso What happens if you don't include "UserPresets/" in your relative path?

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

                bendursoB 1 Reply Last reply Reply Quote 0
                • bendursoB
                  bendurso @d.healey
                  last edited by

                  @d-healey It returns this:

                  User preset /Volumes/Ben/Hise Projects/Raizes Player/UserPresets/{EXP::Auralis}Category 3/Native Preset.preset doesn't exist

                  If I print this:

                  local wildcardReference = expHandler.getCurrentExpansion().getWildcardReference("UserPresets/Category 3/Native Preset.preset");
                  
                  Console.print(wildcardReference);
                  

                  It returns the correct path: {EXP::Auralis}Category 3/Native Preset.preset

                  But.. after inserting it on Engine.loadUserPreset, it adds the "User Preset" plugin full path (non expansion) at the beginning.

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

                    @bendurso I wonder if it only works in the compiled plugin

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

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

                      @bendurso I just found an example of where I used it, might help..

                      Link Preview Image
                      RhapsodyBoilerplate/includes/Expansions.js at main

                      RhapsodyBoilerplate - Boilerplate code used by Rhapsody.

                      favicon

                      Codeberg.org (codeberg.org)

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

                      bendursoB 1 Reply Last reply Reply Quote 1
                      • bendursoB
                        bendurso @d.healey
                        last edited by

                        @d-healey Thanks, I'm going to try... today I spent all day trying to make a custom preset browser with viewports (I almost got it), but I can't load the presets hehe.

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

                          @bendurso said in Engine.loadUserPreset for expansions?:

                          I spent all day trying to make a custom preset browser with viewports

                          Why?

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

                          bendursoB 1 Reply Last reply Reply Quote 0
                          • bendursoB
                            bendurso @d.healey
                            last edited by

                            @d-healey Because the searchbar don't work on expansions, and the button bounds "Add, Rename, Delete" can't be increased. Mainly for these two things.

                            1 Reply Last reply Reply Quote 0
                            • bendursoB
                              bendurso
                              last edited by

                              @Christoph-Hart Does Engine.loadUserPreset works for expansion presets? How should be the proper way to reference the path? Thanks :)

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

                                @bendurso Did you try using {EXP::Auralis}Category 3/Native Preset.preset directly?

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

                                bendursoB 1 Reply Last reply Reply Quote 0
                                • bendursoB
                                  bendurso @d.healey
                                  last edited by

                                  @d-healey Yeap, doesnt work.

                                  When you use a string path it adds "Plugin/User Presets" + the string path. (that's the error log of the console)

                                  like this:
                                  Plugin/User Presets/{EXP::Auralis}Category 3/Native Preset.preset

                                  bendursoB d.healeyD 2 Replies Last reply Reply Quote 0
                                  • bendursoB
                                    bendurso @bendurso
                                    last edited by bendurso

                                    @bendurso The only way it doesnt return an error is if I use a object full path to the preset with FileSystem.fromAboslutePath(), it starts loading a bit and Hise crashes.

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

                                      @bendurso said in Engine.loadUserPreset for expansions?:

                                      When you use a string path it adds "Plugin/User Presets" + the string path.

                                      You mean Engine.loadUserPreset("{EXP::Auralis}Category 3/Native Preset.preset");?

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

                                      bendursoB 1 Reply Last reply Reply Quote 0
                                      • bendursoB
                                        bendurso @d.healey
                                        last edited by bendurso

                                        @d-healey Yeap, if you use that, the console returns:

                                        User preset /Volumes/Ben/Hise Projects/Raizes Player/UserPresets/{EXP::Auralis}Category 3/Native Preset.preset doesn't exist
                                        

                                        It directly searches inside the main plugin User Presets folder, so it's impossible to make it work.

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

                                          @bendurso You said using a File object causes a crash. What about instead of using fromAbsolutePath you piece the path together, something like this:

                                          local rootFolder = Expansion.getRootFolder(); // I can't remember the proper function name
                                          local preset = rootFolder.createDirectory("UserPresets").getChildFile("myPreset.preset");
                                          

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

                                          bendursoB 1 Reply Last reply Reply Quote 0
                                          • bendursoB
                                            bendurso @d.healey
                                            last edited by bendurso

                                            @d-healey I had also previously tried building the entire path that way and it doesn't work either :( I mean, it doesn't throw an error but it crashes.

                                            I just tried in the compiled plugin, and it also crashes :(

                                            d.healeyD 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            25

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            102.0k

                                            Posts