HISE Logo Forum
    • Categories
    • Register
    • Login

    Expansions sample maps

    Scheduled Pinned Locked Moved General Questions
    expansionssamplemapssampler
    17 Posts 2 Posters 434 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.
    • R
      rzrsharpeprod
      last edited by

      I have searched the forum as well as watching both of David's videos on expansions but I can't figure out what I need to do so hoping somebody can help me on here.

      I have a project and have added a couple of expansions to it, I followed David's video to setup a combo box selection for the expansion as well as editing the laf of the preset browser, all that works correctly but what I can't do is get the samplemaps to populate correctly in a combo box. By extension I also can't get the samplemap to be selected in the sampler.

      I have never really dabbled with expansions before and am finding it a little challenging. If somebody help me that would be great as I've been trying to figure this out for most of the week and have had varying degrees of success and failure.

      R 1 Reply Last reply Reply Quote 0
      • R
        rzrsharpeprod @rzrsharpeprod
        last edited by

        @rzrsharpeprod said in Expansions sample maps:

        I have searched the forum as well as watching both of David's videos on expansions but I can't figure out what I need to do so hoping somebody can help me on here.

        I have a project and have added a couple of expansions to it, I followed David's video to setup a combo box selection for the expansion as well as editing the laf of the preset browser, all that works correctly but what I can't do is get the samplemaps to populate correctly in a combo box. By extension I also can't get the samplemap to be selected in the sampler.

        I have never really dabbled with expansions before and am finding it a little challenging. If somebody help me that would be great as I've been trying to figure this out for most of the week and have had varying degrees of success and failure.

        To try and explain myself a bit better (as I was sitting in A&E in the early hours of this morning and didn't have access to any code)
        here is the code used to populate the expansions combobox

        //Expansions
        
        const var expHandler = Engine.createExpansionHandler();
        const var expansions = Engine.getExpansionList();
        const var expansionNames = [];
        
        for(e in expansions)
        {
        	var p = e.getProperties();
        	expansionNames.push(p.Name);
        }
        
        const var cmbExpansions = Content.getComponent("cmbExpansions");
        cmbExpansions.set("items", expansionNames.join("\n"));
        
        inline function oncmbExpansionsControl(component, value)
        {
        	expHandler.setCurrentExpansion(component.getItemText());
        };
        
        Content.getComponent("cmbExpansions").setControlCallback(oncmbExpansionsControl);
        

        How can I do something similar but for the samplemaps that are inside the expansion so that I can build presets with them?

        In the API there is

        Expansion.getSampleMapList
        

        but this give me an unknown function error and I can't see anything in the expansionHandler section relating to samplemaps so I am not sure how to call/reference them?

        What I would like to do is populate the 'regular samplemap' combo box with the factory samplemaps if no expansion is selected and then populate it with the expansion samplemaps if an expansion is loaded so I can build presets using them. I can do this via an if statement once I can call the expansion samplemaps but I am falling at that previous step.

        Unless I am being overly complicated and there is a much simpler solution that I am missing?

        Any advice & help is appreciated as my project has ground to a halt until I can solve this issue.

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

          @rzrsharpeprod said in Expansions sample maps:

          but this give me an unknown function erro

          Where did you use it? Expansion needs to be an expansion object (from your expansion list).

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

          R 2 Replies Last reply Reply Quote 0
          • R
            rzrsharpeprod @d.healey
            last edited by

            @d-healey

            In another inline function trying to call the current expansion using getCurrentExpansion (I'm not at my pc right now so I think it was that function)

            Do I need to replicate these vars from the expansions code I posted but for the sample maps?

            const var expansions = Engine.getExpansionList();
            const var expansionNames = [];

            As you can probably tell I'm a little lost after trying various combinations over the past week and getting mixed results.

            1 Reply Last reply Reply Quote 0
            • R
              rzrsharpeprod @d.healey
              last edited by

              @d-healey

              This is terrible coding I am aware but I am on about my 10th iteration of trying to get it to do something and ghot myself in a bit of a muddle.

              inline function oncmbSampleControl(component, value)
              {
              	local expansionToLoad = component.getItemText();	
              	
              	if(cmbExpansions.getValue() < 2) //1 is factory all expansions are 2 or higher
              	{
              	SampleMapSwitch.set("items", sampleMaps.join("\n"));
              	Sampler1.asSampler().loadSampleMap(sampleMaps[value-1]);
              	}
              	else
              	{
              	local cx = expHandler.getCurrentExpansion();
              	local xs = cx.getSampleMapList();
              	SampleMapSwitch.set("items", xs.join("\n"));
              	Sampler1.asSampler().loadSampleMap(xs[value]);
              	}
              
              };
              
              Content.getComponent("cmbSample").setControlCallback(oncmbSampleControl);
              

              This will not give the unknown function error but it also won't select the correct sample map.

              What it does do is take one from the same position in the factory list (I think) and loads that instead of an expansion samplemap.

              As an aside, it appears to load the expansion and shows the rest of the samplemaps from the expansion in the sampler, but it won't select them via the preset browser and they aren't listed in the samplemapswitch combo box, they only appear in the sampler itself as shown below
              a579dc26-97d7-4a2f-bed6-ca3d58689443-image.png

              Hopefully it is something very silly I have done and you can point it out as I am at a loss with it at the moment.

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

                @rzrsharpeprod

                SampleMapSwitch.set("items", xs.join("\n"));

                At this point what do you see in your combo box?

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

                R 1 Reply Last reply Reply Quote 1
                • R
                  rzrsharpeprod @d.healey
                  last edited by

                  @d-healey In the combobox itself just the factory/non expansion samplemaps populating the list and a seemingly random one is chosen - presumably it is actually in the same position number as the one I want it to load in the expansion.

                  The sampler itself looks like the screenshot so there is a disparity between what is in the combo box and what is in the sampler at this point which is not the case for the non expansion samplemaps

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

                    @rzrsharpeprod

                    First verify that cx does actually contain a reference to the current expansion.
                    Then verify the contents of xs.

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

                    R 1 Reply Last reply Reply Quote 1
                    • R
                      rzrsharpeprod @d.healey
                      last edited by

                      @d-healey I have moved cx to const var outside of the function or else it doesn't show up at all in the scriptwatchtable. Now that I have moved it it exists but is blank
                      957051f8-7948-4b5a-a972-257950cac961-image.png

                      As a result the combobox is now completely empty and I have these errors in the console
                      18f2fd7e-ad76-479e-911b-dcf9e1303982-image.png

                      So I guess the question is how do I get the var cx to populate correctly?

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

                        @rzrsharpeprod said in Expansions sample maps:

                        it doesn't show up at all in the scriptwatchtable.

                        Is your if statement else clause actually being triggered?

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

                        R 1 Reply Last reply Reply Quote 1
                        • R
                          rzrsharpeprod @d.healey
                          last edited by

                          @d-healey it should be I think as the cmbExpansion value is changing correctly which is the value that the if/else is looking at
                          If I choose the first entry in the combobox it looks like this
                          9aa2f913-5d21-4243-b00e-392f294e062d-image.png

                          and it changes accordingly if I choose another entry further down the list
                          473eee41-943f-4a1f-950d-acbe0b5dfdd7-image.png

                          That being said cx still doesn't show up in the scriptwatchtable if it is a local var in the else clause, should it?

                          Would it be easier if I made a minimal snippet or very light version on the project as I feel I have probably set something up fundamentally wrong and you won't be able to spot it from my poorly explained snippets of code above

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

                            @rzrsharpeprod said in Expansions sample maps:

                            Would it be easier if I made a minimal snippet or very light version on the project

                            Always

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

                            R 1 Reply Last reply Reply Quote 1
                            • R
                              rzrsharpeprod @d.healey
                              last edited by

                              @d-healey Ok thankyou. I have created a minimal project and sent it to you via DM

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

                                Sometimes to view local variables in the script watch table, you need to expand the function that they are in

                                e53c0e26-16df-4185-85a6-e2c795ecec03-image.png

                                HiseSnippet 1981.3oc0X80baaiDGz1rWDat9uoObuzaX8bOH0wipjrrcbZ6DYYI25oQIZjby0Yx0oGDInDtPBvADzw9RyLseitOB2Go7M3tE7OhfzxoJtIo2oGr4hcWfeX2E6t.iEbGRTDWfLrN6xPBx31lSujIWb7BLkgNc.x38LGQYz.rusjDIQ8uLDGEQbQFFa90JYLpsEJ42K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mm8uE+1a0vrWZ4wMWqxiu1w6MuT4aUS26kUzzFVcg7+w8y21LIMuspp7uWPcBOVc2p7JdlPYwoPq.ND8hianJ3lR2RQq.zTByMg3+.+xX1NuRphY6blHm7oB1aYembaJiMgqg.PNoqOenFsudHcDzvgBRP0u2JnL.6H3+nS5iOnv5sRFAPIK4U+qYNRQa2t5aMfPAP8peT8H+5S0UTryMUwcuoJ18lp3d2TE2+lp3A2TEuyuthp1INJVxCRSlhPiFOLM.zX3x.vMQ+W.ywUdvC
                                

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

                                R 1 Reply Last reply Reply Quote 1
                                • R
                                  rzrsharpeprod @d.healey
                                  last edited by

                                  Ah I see, so it was there just collapsed inside the function as it was created inside a function?

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

                                    @rzrsharpeprod Yes - although sometimes they don't show up in there either, no idea why.

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

                                    R 1 Reply Last reply Reply Quote 1
                                    • R
                                      rzrsharpeprod @d.healey
                                      last edited by

                                      @d-healey ah ok strange.

                                      Thankyou for your help as I now have it working properly and selecting the correct samplemaps.

                                      I've also got the expansion load working in daw as well so I can progress with my project which is great news.

                                      Thanks again, your help is always invaluable

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

                                      33

                                      Online

                                      1.7k

                                      Users

                                      11.7k

                                      Topics

                                      102.1k

                                      Posts