HISE Logo Forum
    • Categories
    • Register
    • Login

    Strange behavior with Presets

    Scheduled Pinned Locked Moved General Questions
    15 Posts 2 Posters 764 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.
    • d.healeyD
      d.healey @nouslou
      last edited by

      @nouslou Seems to work here

      Peek 2022-01-20 15-56.gif

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

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

        @d-healey no, it's not what I meant) I try to explain this: for example I have 2 articulations, each of them has they own panel with different controls. When I choose one of the articulations (by pressing a button) - there is callback on the button, which trigger Engine.loadUserPreset and then show or hide panels. When I only pressing the buttons - all works fine, presets are changing and panels are changing too. BUT when I click on the presets themselves in the preset browser - they almost work, sample maps are changing, stored values on knobs too, BUT panels (with controls related specifically to this articulation) don't. And I can't understand at all why?I changed my code 100 times but it still doesn't work properly.

        HiseSnippet 2435.3oc4ZstaabbEdWIu1docbrSSA5eJvBghB5HEQxcot35VDJpKFBIxlPT1oEtFNC2cH4TsbG1YGJKk.gFzmj9HzGA+Vz+lGA+FzdlYuvYWtjhTNNHAU+PVy4Lm47c9lyYtstEi5hCCoLMcyStXHVS+tFsuHf2e29HRf1g6ooeOi2P38aNhyoAg1ZMuXHJLD6ooqu7SD8Q27FZxed2WzD4iBbwiEoo8BJwE+UjAD9XosZ7kDe+CPd3SHCT5c8FG5RC1k5SGA3YYipZCQtmh5geJRzskLzzu49dDNk0li33PM8azj5cQ69z2DD0+WPBIc7whF0zZCCTj3Cn9dBDKjpsaehuWqj3NTSS2n0XVX4HV3SMNh3QRkOlMtuTg0XKT4C8kxBuky.uZpvqpB7J.R5JP5FQP5AFscYjg7wZD34NFGFvwrtHf1UgRTe0V5+XZrKE5Q.e8AnSwGvfFoVTdypUWyZipUe3iKUpRkmvP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3DFx8TfJTiwmEfAtlqFi6xnggcgvQNVgppZMh0SvUikbL9LLKLqLwpM8QAhGqJ4FCOODKleItGg3LRlC5I8R0SPx43kLhZWKWa6bscx0tdt1ajq8l4Zu031o28IJyH8dL4e4maNeu7CLPxcQU5YSRuwWvRJ4J9Ro27mceozeArBYlOlqYBFaSDD+9AmAUdfDAF+Di8vcQi74IRytJvQz.5v9z.ha17bHusWOLSE6EFP6v4PYl5U6NF1wFEhUOKzWQBfcqxV9tPbQsE9CaW370uwHBtVhktr9k6NaK++M6rMKJ5dw6qYAdjw+Y3b3cMjq9ZI1r7mR3cLcj3FJoa9.6P0F1U1EqtOkvuwsql7f3swAdxF+W3mXk0Ds0iUVKmRaUKsyozQ0RmDkZtIf.RXi+a4sYzWFtF.Dfxit4Caz5qlbGBmZPDL2xv0mBqtns3ldSCFkNXB5wnP5Yo2K5Qa.xkQec7+sWDg5skR.jFH+ucjowQh1VouusgQ00qpM.1b60tthpqOG1qrXaruF13bMro90vlMtF1r40vlstF1r8LsQbthcFwoChVsEDzZ+njK88SStVV6+M7zXBO
        

        Could you pleeease check this snippet of my code?:folded_hands_light_skin_tone:

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

          @nouslou Post a minimal project, it's no good posting a snippet in this case because I don't have your presets

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

          nouslouN 2 Replies Last reply Reply Quote 1
          • nouslouN
            nouslou @d.healey
            last edited by

            @d-healey you mean this project in .zip on any file hosting?

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

              @d-healey it's only 3 mb :)

              test_interface.zip

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

                @nouslou said in Strange behavior with Presets:

                @d-healey it's only 3 mb :)

                test_interface.zip

                That seems to be some project related to tabbed interfaces...

                I mean make a new minimal project - minimal = the project only contains the essential components required to demonstrate the problem.

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

                nouslouN 1 Reply Last reply Reply Quote 1
                • nouslouN
                  nouslou @d.healey
                  last edited by

                  @d-healey here it is, David

                  test_interface_2.zip

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

                    In your changeTab2callback you are hiding/showing panels and also changing the preset.

                    When changing preset through the preset browser though you haven't set anything up to hide/show the panels. The UserPresetHandler.setPostCallback() might be the way to go.

                    https://docs.hise.audio/scripting/scripting-api/engine/index.html#createuserpresethandler
                    https://docs.hise.audio/scripting/scripting-api/userpresethandler/index.html#setpostcallback

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

                    nouslouN 1 Reply Last reply Reply Quote 1
                    • nouslouN
                      nouslou @d.healey
                      last edited by

                      @d-healey I totally don't understand how to implement this) I wrote this code. But every time I choose preset manually or with buttons - Hise crashes. Where should I exactly put it?

                      const var presetHandler = Engine.createUserPresetHandler();
                      
                      presetHandler.setPostCallback(postPreCallback);
                      
                      inline function postPreCallback()
                      {
                      		Panel3.showControl(true);
                      		Panel4.showControl(false);	
                      }
                      
                      
                      d.healeyD 1 Reply Last reply Reply Quote 0
                      • d.healeyD
                        d.healey @nouslou
                        last edited by d.healey

                        @nouslou I think you need to use a real function here (not an inline one).

                        presetHandler.setPostCallback(function()
                        {
                            // Your code here
                        });
                        

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

                        nouslouN 1 Reply Last reply Reply Quote 1
                        • nouslouN
                          nouslou @d.healey
                          last edited by

                          @d-healey and how can I declare each preset? Because for every specific preset there are different panels need to show/hide . I mean how to tell Hise for example : if I choose this preset_1 manually from preset Browser - do this, but when I manually from preset browser choose preset_2 - do that

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

                            @nouslou There are a number of ways to do that. If you are using buttons to hide/show each combination of panels you could set the buttons to saveInPreset = true, then it would happen automatically (but not if those buttons are also changing presets because that would create an infinite loop). Another way is to hardcode it in the postCallback, but this could get ugly quickly. Another way is to store the configuration in an external JSON file and read it in after the preset loads and do the hiding/showing then.

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

                            nouslouN 1 Reply Last reply Reply Quote 1
                            • nouslouN
                              nouslou @d.healey
                              last edited by

                              @d-healey Thank you so much, David, as usual!! I managed to solve this

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

                              25

                              Online

                              1.8k

                              Users

                              12.0k

                              Topics

                              104.1k

                              Posts