HISE Logo Forum
    • Categories
    • Register
    • Login

    ...Always on the PresetBrowser

    Scheduled Pinned Locked Moved General Questions
    31 Posts 6 Posters 2.8k 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
      last edited by

      FINALLY SOLVED!!!!!! :)
      To get the PresetBrowser viewer loaded and so the label that shows the first preset ("Init" for exemple) everytimes the plugin is launched just add this line on the main script:

      Engine.loadNextUserPreset(true);
      

      :)

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

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

        @ossian1961 This doesn't work for me, it shows the next preset not the last one that was used.

        This works though :p

        Engine.loadNextUserPreset(true);
        Engine.loadPreviousUserPreset(true);
        

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

        ossian1961O NatanN 2 Replies Last reply Reply Quote 4
        • Christoph HartC
          Christoph Hart
          last edited by

          Wow that‘s ugly ;)

          ossian1961O 1 Reply Last reply Reply Quote 3
          • ossian1961O
            ossian1961 @Christoph Hart
            last edited by

            @Christoph-Hart said in ...Always on the PresetBrowser:

            Wow that‘s ugly ;)

            LOL

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

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

              @d-healey said in ...Always on the PresetBrowser:

              @ossian1961 This doesn't work for me, it shows the next preset not the last one that was used.

              Thank you David! Anyway I thought to that guy (I don't remember who) who wrote about get the INIT preset everytimes a plugin is open :P

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

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

                Actually neither of these solutions really work. We need a simple way to be able to load a specific preset when the instrument is loaded, currently this doesn't seem to be possible...

                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

                  Ok I found a kind of solution. So when you save your project all of the controls that are set to be saveInPreset are saved. And when you open the project those controls will be restored. So you need to make it so the label you use to display the preset name is set to be saveInPreset. Then in your code where you are setting the text of that label when a preset is loaded you need to check to make sure the presetName is not an empty string.

                  if (Engine.getCurrentUserPresetName() != "") lblPreset.set("text", Engine.getCurrentUserPresetName());

                  The only really issue is that it's a little awkward (at least in my case) to save the presets because you have to turn off saveInPreset to get the name to load and then turn it back on and resave the preset. Actually it might be quicker just to edit the preset xml for this.

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

                  ossian1961O 2 Replies Last reply Reply Quote 2
                  • ossian1961O
                    ossian1961 @d.healey
                    last edited by

                    @d-healey said in ...Always on the PresetBrowser:

                    Ok I found a kind of solution. So when you save your project all of the controls that are set to be saveInPreset are saved. And when you open the project those controls will be restored. So you need to make it so the label you use to display the preset name is set to be saveInPreset. Then in your code where you are setting the text of that label when a preset is loaded you need to check to make sure the presetName is not an empty string.

                    if (Engine.getCurrentUserPresetName() != "") lblPreset.set("text", Engine.getCurrentUserPresetName());

                    The only really issue is that it's a little awkward (at least in my case) to save the presets because you have to turn off saveInPreset to get the name to load and then turn it back on and resave the preset. Actually it might be quicker just to edit the preset xml for this.

                    Thank you David, I now check it :)

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

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

                      @d-healey The label return empty for the same :( It seems that without the "Engine.loadNextUserPreset(true);" or the "Engine.loadPreviousUserPreset(true);" lines the PresetBrowser is empty when the project is open... though the sound of the preset is loaded the PresetBrowser looks as initialized.

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

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

                        I suggest the following thing that I am doing at HEXERACT:

                        • make a init preset and call it Init.
                        • whenever you save your project XML, load the Init patch - this also makes sure there is no noise in the Git commits because of parameter changes.
                        • the preset label is obviously saveInPreset = false (everything else is just nasty). In the onInit callback you just check whether its empty and do this:
                        if(!Engine.getCurrentUserPresetName())
                            Label.set(„text“, „Init“);
                        
                        ossian1961O 1 Reply Last reply Reply Quote 3
                        • ossian1961O
                          ossian1961 @Christoph Hart
                          last edited by

                          @Christoph-Hart said in ...Always on the PresetBrowser:

                          I suggest the following thing that I am doing at HEXERACT:

                          make a init preset and call it Init.
                          whenever you save your project XML, load the Init patch - this also makes sure there is no noise in the Git commits because of parameter changes.
                          the preset label is obviously saveInPreset = false (everything else is just nasty). In the onInit callback you just check whether its empty and do this:

                          if(!Engine.getCurrentUserPresetName())
                          Label.set(„text“, „Init“);

                          Thank you Christoph :)

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

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

                            @Christoph-Hart said in ...Always on the PresetBrowser:

                            if(!Engine.getCurrentUserPresetName())

                            I had to change this to if(Engine.getCurrentUserPresetName() == "")

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

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

                              @d-healey said in ...Always on the PresetBrowser:

                              if(Engine.getCurrentUserPresetName() == "")

                              I checked both the ways, same result. If I don't put "Engine.loadNextUserPreset(true);" or the "Engine.loadPreviousUserPreset(true);" the label will be empty and the PresetBrowser without the preset list :(

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

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

                                @ossian1961 Yes Christoph's code doesn't solve the preset browser issue but it should fix the label problem.

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

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

                                  @d-healey said in ...Always on the PresetBrowser:

                                  @ossian1961 Yes Christoph's code doesn't solve the preset browser issue but it should fix the label problem.

                                  Unluckily it doesn't fix nothing :(

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

                                  orangeO 1 Reply Last reply Reply Quote 0
                                  • orangeO
                                    orange @ossian1961
                                    last edited by

                                    @ossian1961 If you rename your preset title

                                    - Init
                                    

                                    it will be on top of the presets, and you can use

                                    Engine.loadNextUserPreset(true);
                                    

                                    develop Branch / XCode 13.1
                                    macOS Monterey / M1 Max

                                    ossian1961O 1 Reply Last reply Reply Quote 1
                                    • orangeO
                                      orange
                                      last edited by

                                      My example
                                      Untitled-1.jpg

                                      develop Branch / XCode 13.1
                                      macOS Monterey / M1 Max

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

                                        @orange said in ...Always on the PresetBrowser:

                                        @ossian1961 If you rename your preset title

                                        - Init
                                        

                                        it will be on top of the presets, and you can use

                                        Engine.loadNextUserPreset(true);
                                        

                                        That works! Thanks!!!!!! :)

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

                                        orangeO pelleP 2 Replies Last reply Reply Quote 1
                                        • orangeO
                                          orange @ossian1961
                                          last edited by orange

                                          @ossian1961 I've just recognized that, it works everytime but except first initialization of the plugin.
                                          Because when the plugin is opened for the first time, after succesfully loading, plugin creates the user preset folders and presets.
                                          But since presets haven't been created (because the plugin hasn't been loaded yet for the first time) on first initialization, the label box will be empty.

                                          If you load plugin again, the label box will be ok and show - Init preset since the presets have been created on previous plugin opening.

                                          There should be a fix for that.

                                          develop Branch / XCode 13.1
                                          macOS Monterey / M1 Max

                                          pelleP 1 Reply Last reply Reply Quote 3
                                          • NatanN
                                            Natan @d.healey
                                            last edited by Natan

                                            @d-healey said in ...Always on the PresetBrowser:

                                            @ossian1961 This doesn't work for me, it shows the next preset not the last one that was used.

                                            This works though :p

                                            Engine.loadNextUserPreset(true);
                                            Engine.loadPreviousUserPreset(true);
                                            

                                            Yeah It Does What It Supposed To Do, But The Issue With This Method Is That The Instrument/ Effect Won't Remember It's Last Settings When An End User Closes His Project.

                                            In Short: Don't Use This Method⚠️

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

                                            16

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.8k

                                            Posts