HISE Logo Forum
    • Categories
    • Register
    • Login

    Expansions + Preset Browser

    Scheduled Pinned Locked Moved General Questions
    expansionspreset browser
    11 Posts 2 Posters 703 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 @trillbilly
      last edited by

      @trillbilly have you not scripted anything for switching expansions? The preset browser won’t do anything but show the expansions presets.

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

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

        @trillbilly check this thread: https://forum.hise.audio/topic/6021/expansion-samplemaps-not-loading/16?_=1661332321392

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

        trillbillyT 1 Reply Last reply Reply Quote 0
        • trillbillyT
          trillbilly @DanH
          last edited by trillbilly

          @DanH Great, thank you. I wrongly assumed the preset browser fully connected to each expansion file since the Expansions column was now added.

          I've got most of the code working with my project. Im able to get background image to switch and expansions to switch no problem, much appreciated!

          1. I did run into an issue with samplemaps loading when I have multiple samplers. I have 4 samplers at the moment and the code compiles fine but the samplemaps do not populate my comboboxes. As a matter of fact, the samplemaps show in the expansion/samplemaps project folder but not in the sampler samplemaps dropdown when the corresponding expansion is chosen.

          2. Also, although I can get my background to switch, I cant seem to get my knobs that are images to switch as well. I thought scripted them the same way as the "backgroundImage" but maybe I missed something. Ill go back and look into that more.

          Can you spot where Im destroying my SampleSelection comboboxes?

          //EXPANSION SETUP
          const var SampleSelection0 = Content.getComponent("SampleSelection0");
          const var SampleSelection1 = Content.getComponent("SampleSelection1");
          const var SampleSelection2 = Content.getComponent("SampleSelection2");
          const var SampleSelection3 = Content.getComponent("SampleSelection3");
          
          const var ExpansionSelector = Content.getComponent("ExpansionSelector");
          
          const var expHandler = Engine.createExpansionHandler();
          
          const var expansions = expHandler.getExpansionList();
          
          expHandler.setAllowedExpansionTypes([expHandler.FileBased, 
                                               expHandler.Intermediate, 
                                               expHandler.Encrypted]);
                                               
          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"));
          
          // 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();
          
          const var Image1 = Content.getComponent("Image1");
          
          var backgroundImage = "";
          
          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);
          
                  }
                 
                  SampleSelection0.set("items", "");
                  SampleSelection0.set("items", sampleMapsed.join("\n"));
                  SampleSelection1.set("items", "");
                  SampleSelection1.set("items", sampleMapsed.join("\n"));
                  SampleSelection2.set("items", "");
                  SampleSelection2.set("items", sampleMapsed.join("\n"));
                  SampleSelection3.set("items", "");
                  SampleSelection3.set("items", sampleMapsed.join("\n"));
                  backgroundImage = newExpansion.getWildcardReference("background.png");
          
                 
          
              }
              
              else
              
              {
                  sampleMaps = Sampler.getSampleMapList();
                  SampleSelection0.set("items", "");
                  SampleSelection0.set("items", sampleMaps.join("\n"));
                  SampleSelection1.set("items", "");
                  SampleSelection1.set("items", sampleMaps.join("\n"));
                  SampleSelection2.set("items", "");
                  SampleSelection2.set("items", sampleMaps.join("\n"));
                  SampleSelection3.set("items", "");
                  SampleSelection3.set("items", sampleMaps.join("\n"));
                  backgroundImage = "{PROJECT_FOLDER}halo_logo_200.png";
          
          
              }
              
              Image1.set("fileName", backgroundImage);
          
              
          }
          
          expHandler.setExpansionCallback(newcombobox);
          
          newcombobox(undefined);
          
          const var Sampler0 = Synth.getChildSynth("Sampler0")
          const var Sampler1 = Synth.getChildSynth("Sampler1")
          const var Sampler2 = Synth.getChildSynth("Sampler2")
          const var Sampler3 = Synth.getChildSynth("Sampler3")
          
          inline function onSampleSelection0Control(component, value)
          {
          	Sampler0.loadSampleMap(sampleMaps[value-1]);
          };
          
          Content.getComponent("SampleSelection0").setControlCallback(onSampleSelection0Control);
          
          inline function onSampleSelection1Control(component, value)
          {
          	Sampler1.loadSampleMap(sampleMaps[value-1]);
          };
          
          Content.getComponent("SampleSelection1").setControlCallback(onSampleSelection1Control);
          
          inline function onSampleSelection2Control(component, value)
          {
          	Sampler2.loadSampleMap(sampleMaps[value-1]);
          };
          
          Content.getComponent("SampleSelection2").setControlCallback(onSampleSelection2Control);
          
          inline function onSampleSelection3Control(component, value)
          {
          	Sampler3.loadSampleMap(sampleMaps[value-1]);
          };
          
          Content.getComponent("SampleSelection3").setControlCallback(onSampleSelection3Control);
          
          trillbillyT 1 Reply Last reply Reply Quote 0
          • trillbillyT
            trillbilly @trillbilly
            last edited by

            Also, strange behavior...

            Now that Ive entered this code and removed my previous Samplemap + Combobox script, my Module Tree keeps greying out and forcing HISE to crash.

            Has anyone ever experienced this?

            HISEerror.jpg

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

              @trillbilly the code from that thread is for switching expansions with a combobox rather than using the preset browser. The callback is for the combobox, and that callback populates the sampler comboboxes. I never tried it with the preset browser.

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

              trillbillyT 1 Reply Last reply Reply Quote 0
              • trillbillyT
                trillbilly @DanH
                last edited by

                @DanH Yes, I changed to using a Combobox.

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

                  @trillbilly ok two things I can spot right now, firstly my sampler combobox callback looks like this:

                  inline function onSAMPLEBOX1Control(component, value)
                  {
                  	Sampler1.asSampler().loadSampleMap(sampleMaps[value-1]);
                  };
                  
                  Content.getComponent("SAMPLEBOX1").setControlCallback(onSAMPLEBOX1Control);
                  

                  and second the reference to your background image in the 'else' part of the Expansion combobox callback is wrong:

                  backgroundImage = "{PROJECT_FOLDER}halo_logo_200.png";
                  

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

                  trillbillyT 1 Reply Last reply Reply Quote 0
                  • trillbillyT
                    trillbilly @DanH
                    last edited by

                    @DanH Ahhh, great eye. I pulled the comobox callback from my previous version trying to save time....tisk tisk.

                    Ok, so Ive changed both of these issues and get the same result.

                    Again, my samplemaps arent even showing in the sampler dropdown. It allowed me to create them but it will not show them or load them.

                    It seems all expansions are sharing a preset folder as well. All presets show for each expansion, even presets made from a different expansion.

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

                      @trillbilly Hmmmm, it's really hard to tell without seeing the whole project. Feel free to DM it over, I'll try to look this week if I find time.

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

                      trillbillyT 1 Reply Last reply Reply Quote 0
                      • trillbillyT
                        trillbilly @DanH
                        last edited by

                        @DanH No problem, Ill get it sent your way ASAP. Its super appreciated!

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

                        16

                        Online

                        1.7k

                        Users

                        11.8k

                        Topics

                        102.6k

                        Posts