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 @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
            • d.healeyD
              d.healey
              last edited by

              You have to clear the items before you can replace them - not sure why, just a HISE quirk.

              HiseSnippet 958.3ocuVs0aaaCElxwJaRqqnEX+.H7Sx.pARJWZGJFlqcRJLZcpQcWw.VK5Xnni4hDogDUVMFBv9oteB8k875gRxVxYJYIdXSuct+cN7bQiSjTVZpLAYX8lEyYHi6YNYgPMavLBWfFdHx39liHoJVBtfU+EyIoorPjgwVOWyvvpMJ+6SeeeRDQPYUrPn2J4T1K4wbUE2w8dAOJ5XRH6M73ZZuWugToXfLRlA3YKSOzbB8bxYrSHZ0ZYhL19nPtRlLQQTrTPm9xvESlI+UQg9ukmxOMhoI7QS.GUvFMXFOJb7xbMEgLZOtJy2pHy+FyQ7P9J9UUfGjK.WYQ8ZfQq0gT60fj+0AoikQgZGbMvynF7ZW.uGZNglvmqpjnw1WYNT.ONSIPYuNrJzE05OaYNPBZHT6DSNmcbBPrxBmC77bw66408o11PoOUgi3oJe72g+IeWbfKdWW7dfFu+o0DGnEefK9wt3m3h+VWrGH1lKh3BFdZlfp3RAVJ5moTRguN7IxHGpLdtT..wEeAIJi0092rs3SwNkTV.o0.Y7ox9xO5uSJS4zgqXwocbwc5.H7Zkli4c9EIW3z4chNc05dokk8k.rVl7mwTCVB.mNkPqSWsiJA3.RTzoP+lyUQd2aH6B9+I6BtZ18OlaA2btETK2JdYuf.S3KQ.7B2ryWogFx10JGmHUrWIbxSa6KswWUzzoMJqDFQrjFEq2OjbSF5HxhOkkTunqUDFZVepb6a2TIsHoqonTLTvUuZNqjtZt0ug4VTYUSOAWhPPUU976CJmeWVBQ7P836pJJJOEpu6D8CCOjnHKcF3WHVyYIJtNkLNjcArasX4fk4grzyUx4P3V8bgL9hhPe+xPW71mGXKyxlbzGWExe+Y8VTQ7hd7zQxXvOjDfsQKlf.kL8pvWxHIB8VlTxErghwILnUSSitSwNnVr+in5wdz+xXu8srjWEeDsV7+4o8hIfLSCSfJePTamucf8t16YuObB6usdFNRHCyhHp0ubnOQVJ.ZbWaEsdMrHkqVT+D5c3bhWimSZrs7VB2GZNlqnyZFusZ.uPq4+03s737WadzzoLppBrsMO9G2zKw2An7ZYlhKNaDQkv0sDmjEOA9+DJCPhPvhR0sIszi9EzdZZckYBSDlS7WvWoPeMsQoP+kBQwDZh7CzhEF5y+eYNG.Sh7+7wB9ELfFuZGgoo2NdnXXb3CTptT7H.6MaSvFXytafM6sA1r+FXyAafMOdCr4I2nM5MQOKSIiKFS.FiOJeWsgwQ4qpx6HQeFP3tGG.
              

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

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

                @d-healey lovely, seems to work so far, thanks!

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

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

                  @d-healey

                  So below is the combox box callback for selecting a sample map. I was hoping that 'sampleMaps' would update when switching between expansions but it doesn't (I don't think).

                  The combox displays the available sample maps, however it continues to select the corresponding sample maps from the factory list. The sampler in Hise even has the expansion's sample maps in its menu, but obviously the callback is processing the original 'sampleMaps' list. So I guess I need to make 'sampleMaps' dynamic somehow...

                  Any clues welcome 😆

                  const var sampleMaps = Sampler.getSampleMapList();
                  
                  inline function onSAMPLEBOXControl(component, value)
                  {
                    Sampler1.asSampler().loadSampleMap(sampleMaps[value-1]);
                  };
                  
                  Content.getComponent("SAMPLEBOX").setControlCallback(onSAMPLEBOXControl);
                  
                  

                  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:

                    I was hoping that 'sampleMaps' would update when switching between expansions but it

                    It will if you use the previous example you posted

                            local cx = expHandler.getCurrentExpansion();
                            local xs = cx.getSampleMapList();
                    

                    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've done that (if that's what you mean). It feels like I need to push the list into 'sampleMaps' each time I switch expansion

                      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 need to push the list into 'sampleMaps' each time I switch expansion

                        Instead of local xs = cx... you need sampleMaps = cx..

                        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 hmmmm, getting the error:

                          Can't assign to this expression!

                          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 Need more info.

                            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 What would help?

                              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 Seeing the error message :) What is the expression that can't be assigned?

                                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 oh ha.... the expression is

                                  sampleMaps = cx.getSampleMapList();

                                  as suggested

                                  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 sampleMaps is a const, you can't overwrite a const.

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

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

                                      @d-healey doh

                                      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 right, so now I need to get the factory sample maps back for the else statement, they currently stay in the expansion!

                                        Is there a way to call 'factory' sample maps?

                                        I've tried:

                                        sampleMaps = Sampler1.asSampler().getSampleMapList();

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

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

                                          sampleMaps = Sampler.getSampleMapList();

                                          Doesn't that work?

                                          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 yes, huge thanks!

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

                                            d.healeyD 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            21

                                            Online

                                            1.8k

                                            Users

                                            12.0k

                                            Topics

                                            104.2k

                                            Posts