Decrease plugin initialization / load time



  • Hey guys,
    The plugins that I am developing require many samplers, as they are drum instruments, and that is possibly why my plugin takes a while to load. Once it loads, the GUI is presented and user is ready to play. However, this may take 15sec, which is unacceptable.

    Is there a way to present the GUI right away while everything else is loading in the background (and display text "loading")? Or is there a way to optimize the load time, so that it is much quicker?

    Thank you.



  • How many samplers?



  • @d-healey A lot. Maybe 50.



  • There's your problem. That's like opening 50 instances of Kontakt all at once. Why do you need so many?



  • @d-healey Each drum instrument requires a separate sampler in order to provide independent volume leveling and routing, unfortunately. Also, certain elements are spread across 2 samplers, splitting higher and lower velocities. Such are cymbals. The reason being is that louder notes need to be allowed to decay freely, while quieter notes continue to play. This is to avoid having them unnaturally choked by quieter notes. And you can't just increase the polyphony to get around this, as this would also raise the noise floor when samples are layered and cause the sound to unnaturally to build up.
    And there is also an advanced hi-hat with tip and edge, gradually going from tightly closed to completely open.
    All of this is to provide ultra-realistic playback and realism. If only there was a way built into HISE to route certain samples within a sampler to a group, which can then be given an output, I would be able to cut on a few samplers.
    So, there isn't a way to get around the long loading time? Is it possible to at least display the interface while this is going on in the background?



  • @gorangrooves Are the samplers preloaded with samples on initial load?



  • This is one of the current limitations of HISE and an area where Kontakt is a little ahead. Group FX, modulators, and routing would be really helpful for situations like this.

    Is it possible to at least display the interface while this is going on in the background?

    There is no setting for this that I know of.



  • Group FX, modulators, and routing would be really helpful for situations like this.

    Nah, that's just duplicating the existing structure. If you need to route a number of samples to a different modulator, FX chain or whatever, it's an own entity and deserves a dedicated module.

    Also, using many samplers is not particularly bad, you just need to make sure that you limit the voice amount in each Sampler to the lowest possible amount, because that's where the Sampler module sucks up resources (the rest is pretty trivial). So eg. for a closed hi hat sampler a voice amount of 5 or 6 voices together with the Kill second voice mechanism should be fine.

    If you leave the Sampler voice amount at its default level of 256 voices, then you'll have 50 * 256 voices = 12800 voices that need to be allocated. Each voice has two streaming buffer of 4096 samples and even with HLAC and just a single stereo mic, you're using 3.5GB of memory for one instance just for the internal streaming buffers (multiply this value for each mic position). And this does not include any preloaded samples or image resources, so I would say the 15 seconds loading time are your smallest problem πŸ™‚

    Try to go through every single sampler module and reduce the voice amount (and voice limit) to the very lowest number where you still don't hear notes being killed.



  • @Christoph-Hart said in Decrease plugin initialization / load time:

    Nah, that's just duplicating the existing structure. If you need to route a number of samples to a different modulator, FX chain or whatever, it's an own entity and deserves a dedicated module.

    I think there is a need for some flexibility in the structure. For example it seems inefficient to have to use 1 sampler per articulation just to have independent envelope control for each articulation. If I have 10 articulations then that's 10 samplers, but if groups could have their own envelopes I'd only need one sampler. One workaround is to store the values of the envelope for articulation and restore them when the articulation is switched, but that doesn't work if you want to stack articulations. And envelopes is just one example of where group level control is useful.



  • @LightandSound Yes, they are.

    @Christoph-Hart Thanks, Christoph. I have lowered the samplers' total voices. I am going through them all over again to double-check and tweak. While I set the maximum number of voice to 6-10, depending on the instrument, I find that for retrigger, the most natural-sounding setting is "do nothing". This should not affect the loading speed/ memory, right?
    I am a bit baffled by "amount" vs "soft limit" for voice settings. I am setting them to the same value.

    I will create a duplicate plugin with no sample maps to be loaded, but with the same number of samplers to see how that affects the loading time.

    Would it be the same to load a single sampler with a 12-voice limit as loading 2 samplers with a 6-voice limit?

    Another thought I had: when compiling a plugin in ProJucer, there is an option for JUCE splash screen. If I were to enable this, would this splash screen pop up before my plugin is loaded? If that were the case, could I edit the JUCE popup into my own to display "Please wait. Plugin loading..."?



  • I reduced the maximum number of voices to a minimum. The load time has been reduced to about 8sec, which is quite an improvement, but it is still long enough that it may spook users. Replacing JUCE splash screen would not achieve anything, since it is a small notice that comes up only once the plugin is fully loaded.
    So, the only other solution I can think of is to load the interface without any samples and present a popup screen with "LOAD SAMPLES" button. I am going to test the plugin without any sample maps assigned to see what that does to the load time.



  • @d-healey How would I go about loading the plugin with no sample maps, then clicking on the a button to recall them and load the samples?

    One approach I am thinking of is saving a present of the currently loaded sample maps. Then, removing all sample maps and saving a preset. On plugin load, the default preset would be the one with no sample maps and user would have to click on a button to apply the preset with sample maps. Is this the best way to go about it?



  • @gorangrooves said in Decrease plugin initialization / load time:

    And there is also an advanced hi-hat with tip and edge, gradually going from tightly closed to completely open.

    So "multiple samplers" isnt the way most instruments achieve this. Basically what you are saying (I think) is that each drum has multiple articulations - and most drum instruments use a single sampler with the articulation assigned to individual notes - you can still manage your note decay/velocity on a note by note basis if you wish - So in the end you only have as many samplers as you have "channels" in your mixer (usually 8 but 12 or 16 wouldn't be a problem..)



  • So in the end you only have as many samplers as you have "channels" in your mixer

    Well if you have release samples, you would use another sampler but run them through the same channel as the sustain (or whatever) samples, wouldn't you?

    But I get that it's pretty hard to make generic statements about how many Samplers to use for a particular project, but I can imagine that there's a possibility of using less than 50 samplers but achieve the same effect.

    Would it be the same to load a single sampler with a 12-voice limit as loading 2 samplers with a 6-voice limit?

    That's the real question here πŸ™‚ From a loading time perspective / memory consumption, it doesn't make a big difference whether you have 2x6 or 1x12 samplers, but if you use 12 samplers with one voice you get a worse performance than with 1 sampler.

    Anyways, a good idea is to load a basic sample set at the beginning (maybe purge a few mic positions in the default state), because my guess is that it's the sample loading that takes so much time. That being said, 8 seconds is not super unreasonable for a VST with a high sample count.



  • @Lindon I am aware that other drum samplers use a different note for each articulation. Just because others have done something in a particular way, it doesn't mean that is how it needs to be or that it is a good way to be. I find this to be a very impractical and messy way of doing this. I believe that what I designed is an improvement, an elegant, tidy, and logical solution. You could playback a groove, and use the mod wheel, set to cc4, to vary the openness of the hats. When you look at the piano roll, you don't see a mess of notes going all over the place, but just two notes with cc4 controller lane.

    @Christoph-Hart Thank you. After further tweaking, the initial load time (the very first time the plugin is ever initiated) is around 11 sec, while every subsequent time (even after the DAW is restarted) is about 5sec. I am going to experiment with putting hats tip and edge on a single sampler for each articulation and see if I can achieve the same playback. I believe I should be able to and that will allow me to cut 12 samplers out.
    If that cuts the load time to perhaps 3sec, I can forgo the initial loading of empty sample maps. Otherwise, that would be my solution.

    I was wondering, is it possible to have the plugin load an empty set of sample maps (preset #1), wait 0.3sec, then automatically load the full set of samples (preset #2)? Basically, automate the step where a user would have to press the button to load the preset #2 while displaying "loading samples...".



  • @gorangrooves said in Decrease plugin initialization / load time:

    @Lindon I am aware that other drum samplers use a different note for each articulation. Just because others have done something in a particular way, it doesn't mean that is how it needs to be or that it is a good way to be. I find this to be a very impractical and messy way of doing this. I believe that what I designed is an improvement, an elegant, tidy, and logical solution. You could playback a groove, and use the mod wheel, set to cc4, to vary the openness of the hats. When you look at the piano roll, you don't see a mess of notes going all over the place, but just two notes with cc4 controller lane.

    Err, you dont see that if you have note-2-articulation maps either. Its an internal re-mapping. I used it all the time in the DrumDrops plug-ins, where you can use a cc value to open/close the hi-hats too.

    Message.setNoteNumber() - is your friend here.

    But hey you may well have an elegant solution, but it seems to be an elegant solution with a loading issue. Just pointing out a way to do this that removes your problem - if its not for you then - sure please feel free to ignore what I say and work out your own solution.



  • Message.setNoteNumber() - is your friend here.

    Message.setTransposeAmount is your real friend if you donβ€˜t want to handle the note off manually πŸ™‚



  • @Christoph-Hart said in Decrease plugin initialization / load time:

    Message.setNoteNumber() - is your friend here.

    Message.setTransposeAmount is your real friend if you donβ€˜t want to handle the note off manually πŸ™‚

    pwnd again...



  • @Lindon If I understand correctly, for the end-user, the experience would be identical as what I have now, but things would just be laid out differently inside the plugin back-end?



  • @gorangrooves Probably possible with the timer callback, just stop the timer after you're done (regarding loading after a short interval)


Log in to reply
 

7
Online

703
Users

2.8k
Topics

23.7k
Posts