HISE Logo Forum
    • Categories
    • Register
    • Login

    How to make modules in expansions?

    Scheduled Pinned Locked Moved General Questions
    2 Posts 2 Posters 114 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.
    • CasmatC
      Casmat
      last edited by Casmat

      Hey guys!

      I'm trying to add expansions to my player instrument, but the thing is that the expansions should be modules. Basically, my player interface has multiple parameter knobs, the main being three gain knobs for three "morph" layers. Each expansion/instrument put out would have three of these "morph" layers included in each expansion. Let's say I'm putting out a piano instrument. In the expansion, I'd be adding three different sound layers (previously I created each sound layer with their own sampler instance). How do I make it so that the player would be in total using three samplers, but the sounds get swapped out for each layer in the expansions if that makes any sense. Basically, all the expansions would have is the sample files, sample mapping, and other info (pictures and data). The UI info would be mainly handled by the player and the expansions contain a set of 3 "samples". How would I go about doing such a thing? Is it even possible?

      i make music

      ? 1 Reply Last reply Reply Quote 0
      • ?
        A Former User @Casmat
        last edited by

        @Casmat If I understood right - you can use

        const myCoolSampleMap = "{EXP::myCoolExpansion}myCoolSampleMap";
        
        SamplerA.asSampler().loadSampleMap(myCoolSampleMap );
        

        If you want this sample-loading handled automatically when an Expansion is loaded, you need to add it to the expansion's loading method, something like:

        const expHandler = Engine.createExpansionHandler();
        
        inline function loadSamples()
        {
            local sampleMap = "{EXP::myCoolExpansion}myCoolSampleMap"; //better ways to do this, note the EXP::expansion wildcard
        
            SamplerA.asSampler().loadSampleMap(sampleMap);
        }
        
        function expCallback()
        { 
            currentExpansion = expHandler.getCurrentExpansion(); //useful to access subfolders ie "the better way" to do the above method :)
            loadSamples();
        }
        
        expHandler.setExpansionCallback(expCallback); //calls our functions when we change expansions
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        45

        Online

        1.7k

        Users

        11.7k

        Topics

        101.9k

        Posts