HISE Logo Forum
    • Categories
    • Register
    • Login

    loadUserPreset - strange behaviour...

    Scheduled Pinned Locked Moved General Questions
    35 Posts 6 Posters 2.5k 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.
    • ossian1961O
      ossian1961 @Lindon
      last edited by

      @Lindon said in loadUserPreset - strange behaviour...:

      @ossian1961 thank you for this pointer, however, developing a separate stand alone call-and-response based solution is again over kill in my view, plus it definitely does not fit with any of the major distributor networks - who require (at best) a set of pre-built "authorisation codes" to distribute with their sales receipts.

      So what I'm trying to do here is find a way of storing IN the plug-in (or in a file I can access from the plug-in) a set of authorisation numbers.

      This functionality has been available in Kontakt since at least version 4, so I'm a bit surprised frankly its not in HISE already.

      You right. I partecipated for this theme on many forums and most of the best developers, at the end, noticed that a "good" cracker will be able to find the way to crack it.

      https://www.kontakthub.com/label/Imagik-Sound/
      https://mirtklaar.bandcamp.com/

      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @ossian1961
        last edited by

        @ossian1961 then if you were on those forums you will know all sides of the argument.

        HISE Development for hire.
        www.channelrobot.com

        ossian1961O 1 Reply Last reply Reply Quote 0
        • ossian1961O
          ossian1961 @Lindon
          last edited by

          @Lindon said in loadUserPreset - strange behaviour...:

          @ossian1961 then if you were on those forums you will know all sides of the argument.

          I just wrote those guys said, that's all. They have this problem every days about their work.

          https://www.kontakthub.com/label/Imagik-Sound/
          https://mirtklaar.bandcamp.com/

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

            @Lindon

            This functionality has been available in Kontakt since at least version 4, so I'm a bit surprised frankly its not in HISE already.

            I think the reason it's not in HISE is because until now there hasn't been a use case for it, everything so far can be done through the existing preset system.

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

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

              @d-healey Dave, yeah understood, and I'm happy (ish) to use the existing systems - especially if I can get it to work - but right now I cant get HISE to recall any values for any widget.

              Lets hope Christoph can point at what I'm doing wrong.

              HISE Development for hire.
              www.channelrobot.com

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

                Hey guys. I'm just starting to add user presets to my project. Having a little trouble getting them to load with a combo box.
                I've created 2 user presets in the PresetBrowser, but the interface designer doesn't show any control changes.
                Here's what I'm doing:

                const var ComboBox1 = Content.getComponent("ComboBox1");
                
                const var list = Engine.getUserPresetList();
                
                inline function onComboBox1Control(component, value)
                {
                    switch (number)
                	{
                		case 1:
                		Engine.loadUserPreset(list[0]);
                		break;
                
                		case 2:
                		Engine.loadUserPreset(list[1]);
                		break;
                	}
                };
                
                Content.getComponent("ComboBox1").setControlCallback(onComboBox1Control);
                

                Dan Korneff - Producer / Mixer / Audio Nerd

                LindonL d.healeyD 2 Replies Last reply Reply Quote 0
                • LindonL
                  Lindon @Dan Korneff
                  last edited by Lindon

                  @dustbro have you checked that list elements contain the correct data? Bit obvious but still...

                  HISE Development for hire.
                  www.channelrobot.com

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

                    @dustbro

                        switch (number)
                    	{
                    		case 1:
                    		Engine.loadUserPreset(list[0]);
                    		break;
                    
                    		case 2:
                    		Engine.loadUserPreset(list[1]);
                    		break;
                    	}
                    

                    Use this instead : Engine.loadUserPreset(list[number-1]); it's not a fix to the issue it's just a much shorter way of writing the same thing. Where are you getting number from though?

                    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 @Lindon
                      last edited by

                      @Lindon I believe so:
                      script watch.PNG

                      Dan Korneff - Producer / Mixer / Audio Nerd

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

                        Protip: Rightclick on the row in the table to get a popup with the data for arrays and objects :)

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

                          @d-healey said in loadUserPreset - strange behaviour...:

                          Where are you getting number from though?

                          I thought the number was the position of the selected combo box?

                          Dan Korneff - Producer / Mixer / Audio Nerd

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

                            @dustbro said in loadUserPreset - strange behaviour...:

                            I thought the number was the position of the selected combo box?

                            The combobox has a index starting with 1 because 0 marks "no selection".

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

                              @dustbro

                              I thought the number was the position of the selected combo box?

                              In this function the first time the word number appears is inside the switch. I think you want to replace number with value.

                              inline function onComboBox1Control(component, value)
                              {
                                  switch (number)
                              	{
                              		case 1:
                              		Engine.loadUserPreset(list[0]);
                              		break;
                              
                              		case 2:
                              		Engine.loadUserPreset(list[1]);
                              		break;
                              	}
                              };
                              

                              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 said in loadUserPreset - strange behaviour...:

                                I think you want to replace number with value.

                                If I replace number with value, HISE crashes when I compile the script

                                Dan Korneff - Producer / Mixer / Audio Nerd

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

                                  Even if I ditch the array
                                  this = instant HISE crash:

                                  inline function onComboBox1Control(component, value)
                                  {
                                      switch(value)
                                  	{
                                  		case 1:
                                  		Engine.loadUserPreset("asdf/Bass/BassLeveler");
                                  		break;
                                  
                                  		case 2:
                                  		Engine.loadUserPreset("asdf/Drums/DrumPump");
                                  		break;
                                  	}
                                  };
                                  
                                  Content.getComponent("ComboBox1").setControlCallback(onComboBox1Control);
                                  

                                  Dan Korneff - Producer / Mixer / Audio Nerd

                                  LindonL d.healeyD 2 Replies Last reply Reply Quote 0
                                  • LindonL
                                    Lindon @Dan Korneff
                                    last edited by

                                    @dustbro yeah HISE crashes like a 0.1 app when I use loadUserPreset

                                    HISE Development for hire.
                                    www.channelrobot.com

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

                                      @Lindon :( Using the Preset browser floating tile works as expected... but my GUI only has room for a simple combo box.
                                      not sure what I'm doing wrong

                                      Dan Korneff - Producer / Mixer / Audio Nerd

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

                                        @dustbro yeah must be some bug with the load preset function. But value is definitely right since number doesn't exist

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

                                        1 Reply Last reply Reply Quote 0
                                        • LindonL
                                          Lindon @Dan Korneff
                                          last edited by

                                          @dustbro As Dave pointed out to me, using:

                                          storeAllControlsAsPreset("abc",false);

                                          and
                                          restoreAllControlsAsPreset("abc");

                                          seems to be more reliable - try substituting those?

                                          HISE Development for hire.
                                          www.channelrobot.com

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

                                            @Lindon I'll give that a try.
                                            Is it required to use storeAllControlsAsPreset if the preset files already exist?

                                            Dan Korneff - Producer / Mixer / Audio Nerd

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

                                            32

                                            Online

                                            1.8k

                                            Users

                                            12.0k

                                            Topics

                                            104.4k

                                            Posts