HISE Logo Forum
    • Categories
    • Register
    • Login

    Expansions / Combo Box + SampleMaps

    Scheduled Pinned Locked Moved General Questions
    109 Posts 4 Posters 5.7k 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.
    • DanHD
      DanH @d.healey
      last edited by DanH

      @d-healey What do you mean by 'handler'? I created two expansions using the system in the sampler window, they're all fine and populated with the right folders etc and show up in the combo box and in the preset browser.

      These are the only settings I've changed in Prefs:

      Screenshot 2021-08-27 at 14.38.37.png

      Am I right in thinking we no longer need to set flags?

      PS - if I use the Preset Browser to navigate the expansions the presets appear like normal, just not using the combobox method

      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
      https://dhplugins.com/ | https://dcbreaks.com/
      London, UK

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

        @DanH said in Expansions / Combo Box + SampleMaps:

        Am I right in thinking we no longer need to set flags?

        Nope

        @DanH said in Expansions / Combo Box + SampleMaps:

        What do you mean by 'handler'?

        Read the docs - https://docs.hise.audio/working-with-hise/project-management/expansions/index.html

        Make sure you read all of the sub categories too.

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

        DanHD 1 Reply Last reply Reply Quote 0
        • DanHD
          DanH @d.healey
          last edited by

          @d-healey

          Make sure you read all of the sub categories too.

          I have but I'm still not sure what you're referring to 😆

          DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
          https://dhplugins.com/ | https://dcbreaks.com/
          London, UK

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

            @DanH Did you use the tutorial projects provided in the docs?

            Also there's more docs :D https://docs.hise.audio/scripting/scripting-api/expansionhandler

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

            DanHD 1 Reply Last reply Reply Quote 0
            • DanHD
              DanH @d.healey
              last edited by DanH

              @d-healey ahaaaaaaa.... Merely typing 'Expansion' into the Docs search does not reveal any of the handler apis lol

              Ok thanks for this, lots more to chew through :thumbs_up_light_skin_tone:

              EDIT - Ok we're getting somewhere now! 😆

              DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
              https://dhplugins.com/ | https://dcbreaks.com/
              London, UK

              1 Reply Last reply Reply Quote 0
              • DanHD
                DanH @d.healey
                last edited by

                @d-healey

                If you want to use a combo box add an entry to select "no expansion" and when that's enabled you can use expHandler.setCurrentExpansion("") to go back to your factory project's data.

                So if I'm using

                const var expansions = Engine.getExpansionList();
                

                (which is preferable to writing a static list manually), how would I add the 'no expansion' entry to the list?

                DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                https://dhplugins.com/ | https://dcbreaks.com/
                London, UK

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

                  @DanH said in Expansions / Combo Box + SampleMaps:

                  So if I'm using
                  const var expansions = Engine.getExpansionList();

                  You won't be using that ;) You'll be using expHandler.getExpansionList(). Go through the tutorial projects.

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

                  DanHD 1 Reply Last reply Reply Quote 0
                  • DanHD
                    DanH @d.healey
                    last edited by

                    @d-healey Righto, but I think my point is roughly the same:

                    expHandler.getExpansionList() creates a predefined array. Can it be further edited?

                    DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                    https://dhplugins.com/ | https://dcbreaks.com/
                    London, UK

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

                      @DanH Of course, it's just an array like any other.

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

                      DanHD 1 Reply Last reply Reply Quote 0
                      • DanHD
                        DanH @d.healey
                        last edited by

                        @d-healey Morning!

                        I've got the project more or less working for switching between expansions. The Preset Browser updates with the right presets from each expansion. However, when I don't select an expansion (i.e go back to 'factory' presets), the Preset Browser doesn't update and shows the last expansion selected.

                        Is there a command to populate the preset browser with the 'factory' presets?

                        DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                        https://dhplugins.com/ | https://dcbreaks.com/
                        London, UK

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

                          @DanH It should happen automatically. How many columns are in your preset browser?

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

                          DanHD 1 Reply Last reply Reply Quote 0
                          • DanHD
                            DanH @d.healey
                            last edited by

                            @d-healey I'm using a combo box to switch between the expansions. I don't want the column in the preset browser, but it's there for now and works fine when switching between expansions and back to factory in the browser itself (just not the combo box)

                            DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                            https://dhplugins.com/ | https://dcbreaks.com/
                            London, UK

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

                              @DanH I see. I think that feature of going back to the "factory" presets must be unique to the preset browser. Have a look in the source code and see where it happens. If it's straightforward it should be pretty easy to translate into a scriptable function.

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

                              DanHD 1 Reply Last reply Reply Quote 0
                              • DanHD
                                DanH @d.healey
                                last edited by

                                @d-healey Ok, found a couple of contenders. Out of curiosity though, you mentioned in your expansions video that Christoph helped you implement a function whereby the Preset Browser would update itself when switching between expansions (23:20). This is kind of the reverse!

                                Also the instrument you showed as an example in the video used buttons to switch between expansions. Did you go in favour of the Preset Browser Expansion Column route in the end?

                                DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                https://dhplugins.com/ | https://dcbreaks.com/
                                London, UK

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

                                  @DanH

                                  Did you go in favour of the Preset Browser Expansion Column route in the end?

                                  Yes, I don't think that existed when I made the video.

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

                                  DanHD 1 Reply Last reply Reply Quote 0
                                  • DanHD
                                    DanH @d.healey
                                    last edited by

                                    @d-healey ok thanks.

                                    So I'm looking in PresetBrowser.cpp line 616 and 691 as places of interest...

                                    I've just realised that if I don't have the Expansion Column enabled in the Preset Browser then the presets won't switch at all when selecting expansions with the combo box (but I can set the column width to zero so I don't have to see it)

                                    DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                    https://dhplugins.com/ | https://dcbreaks.com/
                                    London, UK

                                    DanHD 1 Reply Last reply Reply Quote 1
                                    • DanHD
                                      DanH @DanH
                                      last edited by

                                      @d-healey Are either of these sections of use to me do you think?

                                      DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                      https://dhplugins.com/ | https://dcbreaks.com/
                                      London, UK

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

                                        @DanH oh I thought you'd solved it by hiding the columns. I'll take a look when I'm back at my computer.

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

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

                                          You might just need a wrapper around this function - void PresetBrowser::rebuildAllPresets() - you might also need to include the set root file thingy but I don't know.

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

                                          DanHD 1 Reply Last reply Reply Quote 0
                                          • DanHD
                                            DanH @d.healey
                                            last edited by

                                            @d-healey ok thanks :) I'll come back to that in a sec.

                                            I'm currently trying to get my combobox (SAMPLEBOX) to update with the samplemaps available in either an expansion or Factory mode. It's not really working however! I've tried to bend one of @Christoph-Hart's expansions examples to this purpose.

                                            Any insight would be hugely welcome :)

                                            const var expHandler = Engine.createExpansionHandler();
                                            
                                            const var expansions = expHandler.getExpansionList();
                                            
                                            const var expansionNames = [];
                                            
                                            expansionNames.push("FACTORY");
                                            
                                            for(e in expHandler.getExpansionList())
                                                expansionNames.push(e.getProperties().Name);
                                                
                                            
                                            const var ExpansionSelector = Content.getComponent("ExpansionSelector");
                                            ExpansionSelector.set("items", expansionNames.join("\n"));
                                            
                                            
                                            inline function onExpansionSelectorControl(component, value)
                                            {
                                            	//Engine.setCurrentExpansion(component.getItemText());
                                            	expHandler.setCurrentExpansion(component.getItemText());
                                            };
                                            
                                            Content.getComponent("ExpansionSelector").setControlCallback(onExpansionSelectorControl);
                                            
                                            // Implement the expansion switch
                                            
                                            inline function onExpansionSelectorControl(component, value)
                                            {
                                            	local expansionToLoad = component.getItemText();
                                            	
                                            	// We want the first item to reset the current expansion
                                            	// so we need to change it to an empty string
                                            	if(expansionToLoad == expansionNames[0])
                                                    expansionToLoad = "";
                                                
                                            	expHandler.setCurrentExpansion(expansionToLoad);
                                            };
                                            
                                            Content.getComponent("ExpansionSelector").setControlCallback(onExpansionSelectorControl);
                                            
                                            inline function newcombobox(newExpansion)
                                            {
                                                
                                                
                                                if(isDefined(newExpansion))
                                                {
                                            
                                                    local cx = expHandler.getCurrentExpansion();
                                                    local xs = cx.getSampleMapList();
                                                    SAMPLEBOX.set("items", xs.join("\n"));
                                            
                                                }
                                                else
                                                {
                                            
                                                    SAMPLEBOX.set("items", mySampleMapNames.join("\n"));
                                                }
                                                
                                                
                                            }
                                            
                                            
                                            expHandler.setExpansionCallback(newcombobox);
                                            
                                            // Call it once with undefined so that it loads the root images
                                            newcombobox(undefined);
                                            

                                            DHPlugins / DC Breaks | Artist / Producer / DJ / Developer
                                            https://dhplugins.com/ | https://dcbreaks.com/
                                            London, UK

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

                                            26

                                            Online

                                            1.8k

                                            Users

                                            12.0k

                                            Topics

                                            104.2k

                                            Posts