HISE Logo Forum
    • Categories
    • Register
    • Login

    Can't find user preset?

    Scheduled Pinned Locked Moved Scripting
    10 Posts 2 Posters 491 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.
    • P
      paper_lung
      last edited by paper_lung

      Hi all,

      I'm (more than likely) doing this wrong, can someone advise a newbie? I'm using the following code to load a preset via a button rather than using the preset browser. I have 2 presets in the UserPresets project folder, yet when I compile the script or click the button, I get an error that the preset file doesn't exist.

      const var Button1 = Content.getComponent("Button1");
      
      
      inline function onButton1Control(component, value)
      {
      	Engine.loadUserPreset("two");
      };
      
      Content.getComponent("Button1").setControlCallback(onButton1Control);
      
      1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey
        last edited by

        Missing file extension perhaps - .preset?

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

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

          @d-healey I've tried that but Hise crashes, so I thought I was doing it wrong!

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

            @paper_lung Looks like you need to provide the full (relative) file path or a file object

            Link Preview Image
            HISE | Docs

            favicon

            (docs.hise.audio)

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

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

              @d-healey Ok thanks - I've tried the following, but it's still saying it doesn't exist.

              Engine.loadUserPreset("{PROJECT_FOLDER}UserPresets/two.preset");
              
              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @paper_lung
                last edited by

                @paper_lung What about just /two.preset? I'll test it myself when I'm at the computer.

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

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

                  @d-healey Yeah I've tried that as well, but it still can't be found.

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

                    Here's an example project that shows how to do it.

                    load user preset demo.zip

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

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

                      @d-healey Thanks, this is very helpful. Am I correct that this is switching between 2 different presets? If I added more buttons and set them as the same radio group, what would I need to change? This way, only 1 preset/button would be active at a time.

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

                        @paper_lung Yes this was just a simple demonstration so button on = preset 1, button off = preset 2.

                        You can use whatever system you like for the UI, knobs, buttons, panels, menus.

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

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

                        42

                        Online

                        1.7k

                        Users

                        11.7k

                        Topics

                        101.9k

                        Posts