HISE Logo Forum
    • Categories
    • Register
    • Login

    Expansion Content not loading in DAW project file?

    Scheduled Pinned Locked Moved General Questions
    15 Posts 2 Posters 141 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 @Elezeid
      last edited by

      @Elezeid Have you enabled saveInPreset for your expansion selector?

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

      E 1 Reply Last reply Reply Quote 0
      • E
        Elezeid @d.healey
        last edited by

        @d-healey Yes, and that works as intended.

        It's only when saving a project within a DAW and reopening it, the sound produced by the plugin comes from the factory content - despite the expansion content being visibly loaded in the samplemap dropdowns. The sound produced is only updated if the user clicks the already selected preset (or another preset).

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

          Where are you putting this code?

          ExpansionSelector.setValue(1); // Sets to first entry (1-based)
          ExpansionSelector.changed();
          

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

          E 1 Reply Last reply Reply Quote 0
          • E
            Elezeid @d.healey
            last edited by

            @d-healey

            This comes after things like expansion handler, samplers, and their associated combo boxes. Though I think it's worth mentioning that even with this code commented out entirely, the issue remains.

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

              @Elezeid If that code is within on init then it won't do anything so you can remove it.

              Make a new minimal project with two expansions and a factory preset. Use a waveform generator rather than a sampler, and something visual on the interface, like a knob, so you can tell exactly which expansion/preset has loaded.

              See if you can recreate the problem with that scenario. If you can then you can send me that minimal project and I can take a look.

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

              E 1 Reply Last reply Reply Quote 0
              • E
                Elezeid @d.healey
                last edited by

                @d-healey

                Thanks David. I'm happy to do this, though I want to point out that the issue that I'm having is very specific to samples. My plugin is a rompler essentially, and the trouble is that the wrong samplemaps are loading in. Without a sampler, there would be no way for me to debug this.

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

                  @Elezeid Oh so everything else in the preset is loaded correctly, it's just the samples that aren't?

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

                  E 1 Reply Last reply Reply Quote 0
                  • E
                    Elezeid @d.healey
                    last edited by

                    @d-healey

                    Yes exactly, the combo boxes that populate with the samplemaps are showing the correct content, but the audio remains factory unless you choose a preset from the expansion - even if the current preset is already from the expansion. It's like the plugin can't access samplemaps from expansions until the user manually selects them.

                    So in short, it looks like this:

                    1. User chooses a preset from an expansion
                    2. Expansion loads and works correctly (including samples/samplemaps)
                    3. User saves their project and closes the DAW
                    4. User opens the DAW and loads the same project
                    5. Plugin loads all parameters correctly on the interface, including expansion sample maps
                    6. Audio produced by plugin is from Factory sample maps
                    7. User clicks on the preset that is already currently selected
                    8. Correct samples now play (rinse and repeat)
                    d.healeyD 1 Reply Last reply Reply Quote 0
                    • d.healeyD
                      d.healey @Elezeid
                      last edited by

                      @Elezeid Ok, in that case make the minimal project as above, but with a sampler and a couple of sample maps to demonstrate the issue.

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

                      E 1 Reply Last reply Reply Quote 1
                      • E
                        Elezeid @d.healey
                        last edited by

                        @d-healey

                        Thanks for your willingness to help David. I just made a dummy project for testing. Here's what happened:

                        Factory: 2 presets and 2 sample maps
                        Expansion 1: 2 presets and 2 sample maps
                        Expansion 2: 2 presets and 2 sample maps

                        Exported to VST3, created a DAW project and...

                        No issue. The problem is totally absent! I'm not completely certain as to why, but I suspect maybe it has something to do with where the code is in the hierarchy.

                        Thanks for guiding me through this, I think I have the necessary tools to get across the finish line without pestering you any further! Just in case, here is the code for the dummy plugin.

                        Content.getComponent("knbDum").setControlCallback(onknbDumControl);
                        
                        // The sampler references
                        const var Sampler1 = Synth.getSampler("Sampler1");
                        
                        // The ComboBoxes for Expansions
                        const var ExpansionSelector = Content.getComponent("ExpansionSelector");
                        
                        // The ComboBoxes for SampleMaps
                        const var cmbSampleMap = Content.getComponent("cmbSampleMap");
                        
                        // Expansions Handler Create
                        const var expHandler = Engine.createExpansionHandler();
                        
                        // Expansion Types Allowed
                        expHandler.setAllowedExpansionTypes([expHandler.FileBased, 
                                                             expHandler.Intermediate, 
                                                             expHandler.Encrypted]);
                                                             
                        // Expansions list retrieve
                        const var expansionList = expHandler.getExpansionList();
                        
                        
                        // Extract names of the expansions
                        const var expansionNames = [];
                        
                        // Add “Factory Content” as the first option
                        expansionNames.push("Factory Content");
                        
                        // Add all available expansions
                        for (e in expansionList)
                        {
                            expansionNames.push(e.getProperties().Name);
                        }
                        
                        // Fill the Expansion ComboBox
                        ExpansionSelector.set("items", expansionNames.join("\n"));
                        
                        // Global variable for saving the current expansion
                        const var currentExpansion = -1;
                        
                        // Help function for updating all SampleMap ComboBoxes
                        inline function updateAllSampleMapComboBoxes()
                        {
                            // Empty all SampleMap ComboBoxes
                            cmbSampleMap.set("items", "");
                            
                            local actualValue = ExpansionSelector.getValue() - 1;
                            
                            if (actualValue == 0) // "Factory Content"
                            {
                                // Use the embedded SampleMaps for “Factory Content”
                                local maps = Sampler.getSampleMapList();
                                local mapItems = maps.join("\n");
                                cmbSampleMap.set("items", mapItems);
                            }
                            else if (actualValue > 0 && actualValue <= expansionList.length)
                            {
                                // For expansion, load the SampleMaps of the selected expansion
                                local exp = expansionList[actualValue - 1]; // -1 because 0-based index
                                
                                // Set the expansion as active
                                Engine.setCurrentExpansion(exp.getProperties().Name);
                                
                                // Get the SampleMap list of this expansion
                                local maps = exp.getSampleMapList();
                                local mapItems = maps.join("\n");
                                
                                // Set the displayed names in all ComboBoxes
                                cmbSampleMap.set("items", mapItems);
                            }
                        }
                        
                        // Callback for Expansions-ComboBox
                        inline function onExpansionSelectorControl(component, value)
                        {
                            updateAllSampleMapComboBoxes();
                        }
                        
                        // Callbacks for SampleMap-ComboBoxes
                        inline function oncmbSampleMapControl(component, value)
                        {
                            if (value > 0)
                            {
                                // Get the SampleMap name from the ComboBox
                                local mapName = component.getItemText();
                                
                                // Load the SampleMap into Sampler1
                                Sampler1.loadSampleMap(mapName);
                            }
                        }
                        
                        
                        // Set the callbacks
                        ExpansionSelector.setControlCallback(onExpansionSelectorControl);
                        cmbSampleMap.setControlCallback(oncmbSampleMapControl);
                        
                        // Initialize with Factory Content
                        //ExpansionSelector.setValue(1); // Sets to first entry (1-based)
                        //ExpansionSelector.changed();
                        

                        Thanks again! If I run into more hurdles with this issue I'll return to this thread.

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

                          @Elezeid Nice! This is why I like minimal projects, they help to quickly find if the issue is the project or something more general to HISE. Good luck.

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

                          E 1 Reply Last reply Reply Quote 1
                          • E
                            Elezeid @d.healey
                            last edited by

                            @d-healey

                            In case anyone else should ever run into this problem here is the solution (I'm kicking myself).

                            The Expansion Selector has to be higher than the sample map selector in the UI tree.
                            That's it.

                            That's why the minimal project worked, and that change seems to have completely fixed it in my main project.

                            Thanks again for all your help. Hopefully this will help someone in the future!

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

                            20

                            Online

                            1.9k

                            Users

                            12.2k

                            Topics

                            106.5k

                            Posts