HISE Logo Forum
    • Categories
    • Register
    • Login

    Preset problem

    Scheduled Pinned Locked Moved General Questions
    8 Posts 3 Posters 184 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.
    • LindonL
      Lindon
      last edited by

      ..hmm whats wrong with this piece of code?

      		local plist = Engine.getUserPresetList();
      		for (i = 0;i<plist.length;i++)
      		{
      			if(plist[i].contains(myPresetName.get("text")))
      			{
      				Console.print(plist[i]);
      				Console.print(plist[i+1]);
      				Engine.loadUserPreset(plist[i+1]);
      			}
      		} 
      

      when it runs it prints the required preset name, and then tells me it doesnt exist:

      Interface: ALL/00 - Solo Instruments/00 - Brass Stacks
      Interface: ALL/00 - Solo Instruments/01 - Trumpet
      Interface:! NF_Presets.js (115): User preset F:\Audio\Channel Robot\Hise_Work\Nightfox\BrassStacks\UserPresets\ALL\00 - Solo Instruments\01 - Trumpet doesn't exist 
      

      HISE Development for hire.
      www.channelrobot.com

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

        @Lindon loadUserPreset takes a relative path or a file object. Looks like you're passing an absolute path. My mistake. I think you just need to add the file extension .preset

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

        LindonL 1 Reply Last reply Reply Quote 2
        • LindonL
          Lindon @d.healey
          last edited by

          @d-healey - thanks yep - works like a dream....

          HISE Development for hire.
          www.channelrobot.com

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

            Should I remove the ability of passing in anything else than a file object? This will prevent those kind of problems in the future...

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

              @Christoph-Hart I think it can be useful to pass in a string the way Lindon is, it skips out the step of having to get the file from the path (which would still require him to add the file extension).

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

              LindonL 1 Reply Last reply Reply Quote 1
              • LindonL
                Lindon @d.healey
                last edited by

                @d-healey said in Preset problem:

                @Christoph-Hart I think it can be useful to pass in a string the way Lindon is, it skips out the step of having to get the file from the path (which would still require him to add the file extension).

                agreed.

                HISE Development for hire.
                www.channelrobot.com

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

                  Alright, then we'll keep it that way. In my brain the method is broken if you don't pass in a file object so I will never use it like that, but if it works for you :)

                  LindonL 1 Reply Last reply Reply Quote 1
                  • LindonL
                    Lindon @Christoph Hart
                    last edited by

                    @Christoph-Hart its more about being able to use it with the results of

                    Engine.getUserPresetList();

                    HISE Development for hire.
                    www.channelrobot.com

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

                    8

                    Online

                    1.7k

                    Users

                    11.8k

                    Topics

                    102.8k

                    Posts