HISE Logo Forum
    • Categories
    • Register
    • Login

    Simultaneous RR Group Playback

    Scheduled Pinned Locked Moved General Questions
    22 Posts 4 Posters 1.3k 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.
    • E
      ericchesek
      last edited by

      Hi everyone,

      Is it possible for multiple RR groups to play back simultaneously in the same sampler?

      I am coming from the Kontakt world where the use of polyphonic variables is a thing, so multiple groups of samples can be triggered by specific MIDI notes with independent velocities and lengths. I am wondering if there is a better way to work with HISE. I am asking specifically for mapping acoustic drums with multiple articulations, microphones, round robins, and drum types.

      Thanks!

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

        @ericchesek Yes this is possible. Use the setMultiGroupIndex function

        24736836-e125-4594-aa32-bf703daf1e48-image.png

        You might be better off using a different sampler per drum type (depending on how many you need).

        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
          ericchesek @d.healey
          last edited by

          @d-healey
          Okay, this is good! Thanks!

          I also realized I could enable Group XF in the Sampler group settings and set the crossfade shapes to be a linear 0dB from 0% to 100%. I don't think it's as elegant of a solution.

          1 Reply Last reply Reply Quote 0
          • E
            ericchesek
            last edited by ericchesek

            @d-healey

            Now I'm a little confused about how the onNoteOn() callback deals with simultaneous notes. While playing straight simultaneous quarter notes on notes 36 and 37, the code below only plays RR group 1. This is obviously a pretty poor way of handling note mapping, but I'm just testing. :)

            function onNoteOn()
            {
            	switch (Message.getNoteNumber())
            	{
            		case 36:
            			Message.setNoteNumber(Math.randInt(0, 5));
            			Sampler.setMultiGroupIndex(1, true);
            			Sampler.setMultiGroupIndex(2, false);
            		case 37:
            			Message.setNoteNumber(Math.randInt(0, 5));
            			Sampler.setMultiGroupIndex(1, true);
            			Sampler.setMultiGroupIndex(2, false);
            	}
            }
            d.healeyD 1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey @ericchesek
              last edited by

              @ericchesek

              You first need to disable the built in RR behavior.

              In on init put Sampler.enableRoundRobin(false) replace "Sampler` with the reference to your sampler.

              Looking at your code though I would only expect group 1 to play since that's the only one you've set to true.

              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
                ericchesek @d.healey
                last edited by ericchesek

                @d-healey Woops, I made too many quick changes during testing.

                I have the Sampler.enableRoundRobin(false) in the init callback. Then with the intended code below, the second RR group is the only one that plays. I experimented with adding breaks to each case as well, and that doesn't do anything.

                Is a separate note on callback called for each simultaneous note, or is there a priority of some sort?

                function onNoteOn()
                {
                	switch (Message.getNoteNumber())
                	{
                		case 36:
                			Message.setNoteNumber(Math.randInt(0, 5));
                			Sampler.setMultiGroupIndex(1, true);
                			Sampler.setMultiGroupIndex(2, false);
                		case 37:
                			Message.setNoteNumber(Math.randInt(0, 5));
                			Sampler.setMultiGroupIndex(1, false);
                			Sampler.setMultiGroupIndex(2, true);
                	}
                }
                
                
                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @ericchesek
                  last edited by

                  @ericchesek

                  Why not enable all groups and put one sample in each group?

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

                  1 Reply Last reply Reply Quote 0
                  • E
                    ericchesek
                    last edited by

                    @d-healey

                    Doesn't that mean that all samples mapped to MIDI note 0 (for example) regardless of group will be played back if I write Message.setNoteNumber(0)? Ideally I would like to be able to map notes on any key in any group, then use scripting to determine which played key will trigger a single specific note and velocity in a single specific RR group where the sample is mapped.

                    If it's not possible, then I suppose the next thing to do is use multiple samplers.

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

                      @ericchesek I was assuming you only had 1 sample per note. If you have multiple then the group method is the way to go.

                      So back to your code above. Since you're only enabling one group at a time I think you can just use the standard setActiveGroup function and forget about the multi group thing.

                      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
                        ericchesek @d.healey
                        last edited by

                        @d-healey

                        Hmm this still isn't quite right. It works fine as long as no notes are played with simultaneous starts. As soon as two of those notes are played, only one of the groups plays back a sample. I simplified the code a bit below.

                        function onNoteOn()
                        {
                        	switch (Message.getNoteNumber())
                        	{
                        		case 36:
                        			Message.setNoteNumber(0);
                        			Sampler.setActiveGroup(1);
                        		case 38:
                        			Message.setNoteNumber(0);
                        			Sampler.setActiveGroup(2);
                        	}
                        }
                        
                        d.healeyD 1 Reply Last reply Reply Quote 0
                        • d.healeyD
                          d.healey @ericchesek
                          last edited by

                          @ericchesek Why are you setting the note number to 0?

                          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
                            ericchesek @d.healey
                            last edited by

                            @d-healey

                            I have samples mapped on MIDI note 0 on RR Group 1 and RR Group 2. I want to take a user input note of 36 and play the sample mapped to note 0 in RR Group 1. I also want to take a user input note of 38 and play the sample mapped to note 0 in RR Group 2.
                            If 36 and 38 are played together, then both samples in both RR groups should play back at the same time.
                            Then if a user actually plays MIDI note 0, I don't want the sampler to play back anything.

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

                              @ericchesek I get it now. What about using the velocity levels to map the samples instead of groups?

                              Here's an example test.zip I'm using notes 60, 61, and 62 in this example. Samples are mapped to note 0.

                              You can still use velocity to trigger different layers and control volume. Also remember that in the end none of this note manipulation stuff should be in your UI script - but while you're just testing it's fine.

                              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
                                ericchesek @d.healey
                                last edited by ericchesek

                                @d-healey
                                Thanks for the test.zip!
                                Using velocity levels may be the way to do it. Ultimately this is to try reducing CPU load where I can. I don't know how much extra CPU is used by stacking samplers. If the differences are negligible, using multiple samplers may result in less tricky scripting.

                                For example, something like Naughty Seal's Perfect drums is almost always <3% CPU on my MacBook Pro.
                                Handy Drums, which I believe was built with HISE, is down around 0.9% CPU.
                                Of course these numbers depend on the load each plugin is trying to pull, so these are just rough figures.

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

                                  @ericchesek The CPU overhead is not very drastic so anything < 16 samplers is perfectly fine for a drum plugin and using one sampler per drum type is definitely the way to go as it also allows you to independently mix them.

                                  However you definitely need to lower the voice count on each sampler (something like 32 should be plenty enough for most drum types and you can increase the voice count for cymbals or other drums which have a longer decay).

                                  E 1 Reply Last reply Reply Quote 0
                                  • E
                                    ericchesek @Christoph Hart
                                    last edited by ericchesek

                                    @Christoph-Hart Okay, that's good news. Does voice count in HISE include multi mics? So a drum with 10 mics playing back once will have a voice count of 1, or 10?

                                    Also, what happens if the sampler count increases above 16?

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

                                      @ericchesek 10 mics = 10 voices. More samplers = more resources.

                                      I did a test patch once with 60 samplers, all with a voice limit of 2, and it wasn't an issue but generally I like to have as few samplers as possible.

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

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

                                        @d-healey

                                        I'm more likely to need higher voice limits as opposed to more samplers, so perhaps I'll run a test of my own and report back.

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

                                          That‘s not entirely correct - if you use 10 mic positions and play one note then the voice counter in the Performance meter shows 10 voices but if you set the voice limit to 32, you can play 32 notes before it starts killing voices (and not 3).

                                          E 1 Reply Last reply Reply Quote 2
                                          • E
                                            ericchesek @Christoph Hart
                                            last edited by

                                            @Christoph-Hart

                                            More good news! :beaming_face_with_smiling_eyes:

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

                                            44

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            101.9k

                                            Posts