HISE Logo Forum
    • Categories
    • Register
    • Login

    What is a sensible number of samplers in a single plugin?

    Scheduled Pinned Locked Moved General Questions
    33 Posts 6 Posters 1.5k 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.
    • clevername27C
      clevername27 @Orvillain
      last edited by

      @Orvillain Would love to check out what you're up to.

      1 Reply Last reply Reply Quote 0
      • O
        Orvillain @aaronventure
        last edited by Orvillain

        @aaronventure

        This sounds like an interesting path for exploration. But reading between the lines, this wouldn't give per-sample envelopes right? It might be a way to get per-voice envelopes, but that isn't quite the same thing no?

        I have finished the night with my prototype up and running, in some sense. I don't know what I did, but my project started to compile much quicker after a while, and I have managed to have 128 samplers loaded up at once with no more stability problems. I'm perplexed.

        @clevername27 - throw us a private message!

        LindonL 1 Reply Last reply Reply Quote 0
        • LindonL
          Lindon @Orvillain
          last edited by Lindon

          @Orvillain generally ----- 16 samplers is a point where HISE is comfortable, I once tried 32 samplers and HISE started to give up on me....but it depends on what's in each sampler..

          HISE Development for hire.
          www.channelrobot.com

          Christoph HartC 1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart @Lindon
            last edited by

            128 samplers is definitely overkill - the sampler module is designed for the purpose of streaming large sample sets so if you throw only a single one shot at it you’re definitely wasting a lot of resources (mostly RAM, take a look at your task manager after you created 128 instances)…

            Loopers are a bit less resource-hungry but if you want to scale that with a good performance you should look into creating a custom sample player with scriptnode. I‘ve created a drum plugin with 36 individual channels like this and the performance is very close to the optimum (which would be handcoded c++).

            O 1 Reply Last reply Reply Quote 1
            • O
              Orvillain @Christoph Hart
              last edited by

              @Christoph-Hart said in What is a sensible number of samplers in a single plugin?:

              128 samplers is definitely overkill - the sampler module is designed for the purpose of streaming large sample sets so if you throw only a single one shot at it you’re definitely wasting a lot of resources (mostly RAM, take a look at your task manager after you created 128 instances)…

              Loopers are a bit less resource-hungry but if you want to scale that with a good performance you should look into creating a custom sample player with scriptnode. I‘ve created a drum plugin with 36 individual channels like this and the performance is very close to the optimum (which would be handcoded c++).

              Nice one, cheers! I've not looked at script node yet, guess I'll start digging into that this week.

              O 1 Reply Last reply Reply Quote 0
              • O
                Orvillain @Orvillain
                last edited by

                Hmmm, So 128 ScriptNode Synths... each of them with a "file player" inside, gives about 500mb of RAM. Which isn't too bad I don't think.

                Building my own node network for the kind of playback sampler I am looking for, seems viable.

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

                  @Orvillain that's a lot of RAM. Will users only load a single instance per project?

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

                  O 1 Reply Last reply Reply Quote 0
                  • O
                    Orvillain @d.healey
                    last edited by

                    @d-healey said in What is a sensible number of samplers in a single plugin?:

                    @Orvillain that's a lot of RAM. Will users only load a single instance per project?

                    Well here an empty Groove Agent SE5 is coming in around 300mb by itself. I'd like to get that number down, sure. But 500mb is way more acceptable than the 3.2gb required to do this with the HISE Sampler.

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

                      @Orvillain yeah 300 is pretty chunky too. Do you really need 128?

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

                      O 1 Reply Last reply Reply Quote 0
                      • O
                        Orvillain @d.healey
                        last edited by

                        @d-healey

                        16 pads x 8 layers.

                        I noticed one thing though. If I put 8 file players in a single ScriptNode instance (rather than having 128 ScriptNode instances), then that seems to bring down the memory. Still doing more testing, but 128 file_player nodes, is showing the entire HISE memory footprint of 105mb. Which is a marked improvement!

                        I just need to see if I can get the functionality from the HISE file_player. For instance, right now I cannot see a way to stop it from looping.

                        Promising stuff though.

                        O 1 Reply Last reply Reply Quote 0
                        • O
                          Orvillain @Orvillain
                          last edited by

                          @Christoph-Hart

                          How can I tell a specific instance of a file_player within a ScriptNode, to load a file from an absolute path??

                          More to the point - how can I iterate through properties and functions for the ScriptNode instance, from my Interface onInit method?

                          Christoph HartC 1 Reply Last reply Reply Quote 0
                          • Christoph HartC
                            Christoph Hart @Orvillain
                            last edited by

                            @Orvillain it depends on the type of property. Parameter sliders need to be connected to a container meta parameter and can then be accessed through the usual HISE attribute system.

                            Any complex data (table, slider packs, audio files) need to be registered as external data slot and then can be modified using the scripting API (just like you would load a file into the inbuilt loop player.

                            gives about 500mb of RAM

                            This is way too much but you should be able to bring this down by lowering the voice limit. If you have 128 instances, you don't need 256 voice polyphony so with 16 voices per sampler you can cut it down significantly.

                            O 1 Reply Last reply Reply Quote 0
                            • O
                              Orvillain @Christoph Hart
                              last edited by

                              @Christoph-Hart

                              The way I'm thinking is I somehow need to travese down this tree:
                              container.chain.softbypass_switch9.sb_container.sb1.file_player

                              And that would allow me to do something like:

                              abs_path = FileSystem.fromAbsolutePath(file_obj.fileName);
                              parsed = [this_sampler.parseSampleFile(abs_path)];
                              file_player.loadSampleMapFromJSON(parsed);
                              

                              Or whatever the call is to load a file into the file_player.
                              Sort of pseudo code, similar to what I've been doing with the SAMPLER, but hope it makes sense.

                              If I do this:

                              const var ScriptnodeSynthesiser1 = Synth.getChildSynth("Scriptnode Synthesiser1");
                              const attr_count = ScriptnodeSynthesiser1.getNumAttributes();
                              
                              
                              for (i = 0; i < attr_count; i++)
                              {
                              	var attr = ScriptnodeSynthesiser1.getAttributeId(i);
                              	Console.print(attr);
                              }
                              

                              Then I just get these printed in the Console:
                              Interface: Gain
                              Interface: Balance
                              Interface: VoiceLimit
                              Interface: KillFadeTime
                              Interface: Sample Select

                              Sample Select is a custom meta parameter. So I'd already figured that bit out. Really what I'm looking to get is an object reference to the internal nodes within the ScriptNode.

                              8296692d-1be7-44a1-a253-eb3650b5b99e-image.png

                              This is where I'm currently at. You can see Sample Select at the top. You can also see that my file_player nodes are all set to an external audio file slot.

                              If you could help me get the object reference I'm looking for, I'm pretty sure I can figure the rest out from there. Does it have anything to do with ScriptnodeSynthesiser1.ScriptParameters; ?

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

                                Are you using the clone container? That might reduce some of the complexity

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

                                O 1 Reply Last reply Reply Quote 0
                                • O
                                  Orvillain @d.healey
                                  last edited by Orvillain

                                  @d-healey Not yet. It isn't really what I'm after right now. I'm just trying to make sure I understand how to iterate through the node tree, get and set data within it, and then I'll look at optimization and stuff later.

                                  I'm just trying to sus out how to achieve this before I invest too much time in it really.

                                  PS: Been rinsing your HISE videos on Youtube. I'm half way through the paint routines one, and have learnt a lot! Thanks very much!

                                  O 1 Reply Last reply Reply Quote 1
                                  • O
                                    Orvillain @Orvillain
                                    last edited by Orvillain

                                    @Orvillain

                                    Ahhhh.. I imagine I need to use Engine.getDspNetworkReference(String processorId, String id)
                                    in order to access the actual node network? I'll try that tomorrow.

                                    And obviousy then, I finally check the docs 🐶

                                    Link Preview Image
                                    HISE | Docs

                                    favicon

                                    (docs.hise.audio)

                                    I'll give this a thorough read tomorrow too. Looks like this is what I want.

                                    O 1 Reply Last reply Reply Quote 0
                                    • O
                                      Orvillain @Orvillain
                                      last edited by Orvillain

                                      @Christoph-Hart
                                      Could you let me know what I'm doing wrong here?

                                      var samplepath = "D:\Samples\Drums\Hits\Reverb Drum Machines\MXR Drum Computer\Reverb MXR Drum Computer Sample Pack_Audio Files\Reverb MXR Drum Computer Sample Pack_CHH.wav";
                                      
                                      const var s = Synth.getAudioSampleProcessor("Scriptnode Synthesiser1");
                                      const slot = s.getAudioFile(0);
                                      slot.loadFile("{XYZ::SingleSample}" + samplepath);
                                      

                                      I do actually see a change:
                                      1997ebb2-d818-4d39-9412-2c84db0465f7-image.png

                                      But it hasn't actually loaded it. Just applied a label.

                                      If I do this:

                                      var samplepath = "D:\Samples\Drums\Hits\Reverb Drum Machines\MXR Drum Computer\Reverb MXR Drum Computer Sample Pack_Audio Files\Reverb MXR Drum Computer Sample Pack_CHH.wav";
                                      
                                      const var s = Synth.getAudioSampleProcessor("Scriptnode Synthesiser1");
                                      const slot = s.getAudioFile(0);
                                      slot.loadFile(samplepath);
                                      

                                      Then HISE just crashes.

                                      And if I do this:

                                      const var samplepath = "D:\Samples\Drums\Hits\Reverb Drum Machines\MXR Drum Computer\Reverb MXR Drum Computer Sample Pack_Audio Files\Reverb MXR Drum Computer Sample Pack_CHH.wav";
                                      var abs_path = FileSystem.fromAbsolutePath(samplepath);
                                      
                                      var s = Synth.getAudioSampleProcessor("Scriptnode Synthesiser1");
                                      const slot = s.getAudioFile(0);
                                      slot.loadFile(abs_path);
                                      ;
                                      

                                      Then I get this:
                                      2f8dddfe-5019-43bf-98eb-f458d59224e4-image.png

                                      Again, it doesn't load the file... but does put an object reference in the filename box.

                                      O 1 Reply Last reply Reply Quote 0
                                      • O
                                        Orvillain @Orvillain
                                        last edited by

                                        Bah! Figured it out:
                                        c39aab47-627f-4854-8fdf-a4c927dda560-image.png

                                        You can see.. the filepath needed the backslashes escaping. I have to do this when using Python all the time, and it just occurred to me to try it in HISE too.

                                        Works fine. Sample loads. I've got enough to go on now!

                                        O 1 Reply Last reply Reply Quote 0
                                        • O
                                          Orvillain @Orvillain
                                          last edited by

                                          Actually @Christoph-Hart if you do see this, how can I disable looping on the file_player object?

                                          O 1 Reply Last reply Reply Quote 0
                                          • O
                                            Orvillain @Orvillain
                                            last edited by

                                            @Orvillain Just a note to self, looking through the source code I suspect there might be a setUseLoop bool on the sample itself. I'll look for that tomorrow. It could also be LoopEnabled, as that is listed under special parameters for the AudioLooper class.

                                            I'm sorta hoping those follow through to the file_player.

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

                                            28

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.8k

                                            Posts