HISE Logo Forum
    • Categories
    • Register
    • Login

    Sample map Expansion Tutorial

    Scheduled Pinned Locked Moved General Questions
    43 Posts 3 Posters 1.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.
    • d.healeyD
      d.healey @BWSounds
      last edited by

      @bwsounds said in Sample map Expansion Tutorial:

      A button which when clicked will load the expansion

      Why not use the preset browser to load the expansions? That eliminates the need to add a button per expansion.

      And a way to cypher through the samplemaps (combobox maybe)?

      This part is easy. I'll make a snippet for you.

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

      B 1 Reply Last reply Reply Quote 0
      • B
        BWSounds @d.healey
        last edited by

        @d-healey said in Sample map Expansion Tutorial:

        This part is easy. I'll make a snippet for you.

        thank you, I can script it for the factory samplemaps just not for the expansions.

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

          @bwsounds said in Sample map Expansion Tutorial:

          just not for the expansions.

          A lot has changed in the last year since Christoph made that tutorial.

          HiseSnippet 1300.3ocyX0raaaDDlTxLMTMsMIHG5kBvJzCz.tBRINNEnHIxRVNUn9GAImfdn.AqIWIs0j6Rr6RW4V32o9Hz2f9pj2f1YWRJRJK3Jql3FcvPye67MyryLq7.NyCKDLtgo8IWDgMLum0nKnxocmhHTi96YX9EVBTXT.NDEIwBoQmKhPBA12vzr5qTJYZugg9y6dYGT.h5gyYYX7FFwCe.IjHy4Nn8ORBB1G4iOgDVP6sa22iQ6xBXw.fpZ0zHB4cFZB9HjRsJVFl2omOQx3ijH.LfNcX9WLZJ6WoI5+FhfbZ.VQzxXDbPIrM5NkD3OHKXEFFlVCxC8pIg9irNj3SlyOOEbes.mbKJlCLqbcPp0M.RlEfzFIP5AVi73jHYtDEd9Tq9TIlOFAo5hPIQWiJ+UEqtLPCprQH5L79bfXtEt6zr4VNve176qU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X8Z1JNKXO3HX2uGt31vJpMrIzMyd+4HL0WS72vmTgsxVcpD1JSngW1QAwV520ul1rJlpVcnelW.rTNn3UZA7BCEjf0a2JnLD4wYu0K42Knv5c0b.TR0+aLrsNTQ6zJ6mGXY0rQSiPXW0a87TMBeKjgWtMOdMr4IqgMauF17z0vlcVCad1ZXy2cs1ndlvtwRVXxPRfwfdIWrL6M+hUUi+ArhMMP.
          

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

          B 1 Reply Last reply Reply Quote 1
          • B
            BWSounds @d.healey
            last edited by

            @d-healey
            humm the combobox isn't loading anything, but its a good starting point for me.

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

              @bwsounds said in Sample map Expansion Tutorial:

              humm the combobox isn't loading anything, but its a good starting point for me.

              It doesn't load anything until you load an expansion.

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

              B 1 Reply Last reply Reply Quote 0
              • B
                BWSounds @d.healey
                last edited by

                @d-healey
                Yep yep, thanks man I appreciate it. 💙

                B 1 Reply Last reply Reply Quote 0
                • B
                  BWSounds @BWSounds
                  last edited by

                  @bwsounds
                  ok, last question, so from my understanding you cant replace the EXP:... part of the expansion name but you can "split" it?

                  I see this in the docs..

                  split
                  Splits the string into an array with the given separator.
                  String.split(var separatorString)

                  But I also read in a post that that you could use substring as well...

                  What is the best way to go about doing this while using comboboxes?

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

                    @bwsounds Why not use .replace()?

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

                    B 1 Reply Last reply Reply Quote 0
                    • B
                      BWSounds @d.healey
                      last edited by

                      @d-healey
                      if im not mistaken, I think I read in a post where you said it wouldn't work. I may have read incorrectly.

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

                        @bwsounds Explain the context and I'll provide a solution, I'm not 100% sure what you want to do.

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

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

                          @bwsounds this is what I do:

                          for (i = 0; i < sampleMapsed.length; i++)
                                  {
                                  sampleMapsed[i] = sampleMapsed[i].replace("{EXP::");
                                  sampleMapsed[i] = sampleMapsed[i].replace("}");
                                  sampleMapsed[i] = sampleMapsed[i].replace(expName);
                          
                                  }
                          

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

                          B 1 Reply Last reply Reply Quote 1
                          • B
                            BWSounds @d.healey
                            last edited by

                            @d-healey
                            ok, so far I have this, which loads the samplemaps into a combobox(list1)...

                            It works great, but the {EXP:..} text which is included with the samplemap text is a bit unappealing.

                            So what I want to do is remove it {EXP:..} , but im lost on how...

                            const var expHandler = Engine.createExpansionHandler();
                            const var expansions = expHandler.getExpansionList();
                            expHandler.setAllowedExpansionTypes([expHandler.FileBased, 
                                                                 expHandler.Intermediate, 
                                                                 expHandler.Encrypted]);
                            const var expansionNames = [];
                            
                            
                            for(e in expHandler.getExpansionList())
                                expansionNames.push(e.getProperties().Name);
                            
                            
                            const   Sampler1 = Synth.getSampler("Sampler1");
                             const list1 = Content.getComponent("list1");
                             list1.setControlCallback(onlist1Control);
                             const var namesExp = [];
                             
                             
                            inline function onlist1Control(component, value)
                            {
                            	if (value > 0)
                            	{
                            		local sampleMap = component.getItemText();
                                     
                            
                            
                            		if (sampleMap != "")
                            			Sampler1.loadSampleMap(sampleMap);	
                            		{	
                            			
                            			namesExp.clear();
                            		    var smname = expSampleMaps[value];
                            			
                            				
                            			for (e in smname)
                            		    e.replace("{EXP::" + getExpansionName() + "}", ""); 
                            		    list1.set("items", smname.join("\n"));
                            			
                             
                                }			
                              }		
                            }
                            
                            
                            expHandler.setExpansionCallback(function(e)
                            {
                            	list1.set("items", e.getSampleMapList().join("\n"));
                            });
                            

                            no iterable type keeps popping up, so I know im way off. Did a search on it but nothing came up.

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

                              @danh said in Sample map Expansion Tutorial:

                              for (i = 0; i < sampleMapsed.length; i++)
                              {
                              sampleMapsed[i] = sampleMapsed[i].replace("{EXP::");
                              sampleMapsed[i] = sampleMapsed[i].replace("}");
                              sampleMapsed[i] = sampleMapsed[i].replace(expName);

                                  }
                              

                              humm.. I tried something like that but the sampler didn't recognize the samplemaps..
                              I look into it again

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

                                @bwsounds I excecute this in an expansionSelector callback - which in my case is a combobox. How are you selecting and switching between expansions? And do you have 'factory' presets as well?

                                If what you want is similar to mine I can send over my code when back at my machine tomorrow

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

                                B 1 Reply Last reply Reply Quote 0
                                • B
                                  BWSounds @DanH
                                  last edited by

                                  @danh
                                  That would be great!
                                  And no factory presest, I was planning on having an expansion titled "FACTORY"
                                  also Im using the preset browser to switch between expansions.

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

                                    @bwsounds said in Sample map Expansion Tutorial:

                                    no iterable type keeps popping up, so I know im way off. Did a search on it but nothing came up.

                                    This video was made for you

                                    And you should read this - https://docs.hise.audio/scripting/scripting-in-hise/hise-script-coding-standards.html

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

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

                                      @bwsounds here it is, essentially it's all dealt with with the 'expHandler.setExpansionCallback' function. 'SAMPLEBOX' is my combo box which lists the available sample maps for the user to browse, and the 'sampleMapsed' array is the list of expansion sample maps (so I guess you can ignore the 'sampleMaps' array). It also removes all the Expansion text so you just get the name of your sample map in the combo box.

                                      const var expHandler = Engine.createExpansionHandler();
                                      
                                      const var expansions = expHandler.getExpansionList();
                                      
                                      expHandler.setAllowedExpansionTypes([expHandler.FileBased, 
                                                                           expHandler.Intermediate, 
                                                                           expHandler.Encrypted]);
                                                                           
                                      const var expansionNames = [];
                                      /// Push 'FACTORY" into the available expansion packs list so users can navigate back to factory presets
                                      
                                      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"));
                                      
                                      // 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);
                                      
                                      var sampleMaps = Sampler.getSampleMapList();
                                      var sampleMapsed = Sampler.getSampleMapList();
                                      
                                      inline function newcombobox(newExpansion)
                                      {
                                      
                                             if(isDefined(newExpansion))
                                      
                                          {
                                              local cx = expHandler.getCurrentExpansion();
                                              sampleMaps = cx.getSampleMapList();
                                              sampleMapsed = cx.getSampleMapList();
                                              local expansionProps = cx.getProperties();
                                              local expName = expansionProps.Name;
                                      
                                              for (i = 0; i < sampleMapsed.length; i++)
                                              {
                                              sampleMapsed[i] = sampleMapsed[i].replace("{EXP::");
                                              sampleMapsed[i] = sampleMapsed[i].replace("}");
                                              sampleMapsed[i] = sampleMapsed[i].replace(expName);
                                      
                                              }
                                      
                                              SAMPLEBOX.set("items", "");
                                              SAMPLEBOX.set("items", sampleMapsed.join("\n"));
                                             
                                          }
                                          else
                                          {
                                              sampleMaps = Sampler.getSampleMapList();
                                              SAMPLEBOX.set("items", "");
                                              SAMPLEBOX.set("items", mySampleMapNames.join("\n"));
                                      
                                          }
                                      
                                      }
                                      
                                      expHandler.setExpansionCallback(newcombobox);
                                      
                                      newcombobox(undefined);
                                      

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

                                      B 2 Replies Last reply Reply Quote 2
                                      • B
                                        BWSounds @DanH
                                        last edited by BWSounds

                                        @danh
                                        Thank you!
                                        But im still having the same issue... when I do this

                                             //   sampleMapsed[i] = sampleMapsed[i].replace("{EXP::");
                                             //   sampleMapsed[i] = sampleMapsed[i].replace("}");
                                             //   sampleMapsed[i] = sampleMapsed[i].replace(expName);
                                        
                                        

                                        the samplemaps load up, but if I remove the

                                        //
                                        

                                        the samplemaps load up.... i'll dig around and mess with this a bit, maybe im missing something... thank you.

                                        1 Reply Last reply Reply Quote 0
                                        • B
                                          BWSounds @DanH
                                          last edited by

                                          @danh
                                          ok, after a few days I figured it mostly out, thank you.
                                          one issue still remains... once I switch back to "factory" my combobox doesn't populate those samplemaps... What could cause that?

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

                                            @bwsounds said in Sample map Expansion Tutorial:

                                            What could cause that?

                                            Show us some code

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

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

                                            21

                                            Online

                                            1.8k

                                            Users

                                            12.0k

                                            Topics

                                            104.2k

                                            Posts