Simultaneous RR Group Playback
-
You first need to disable the built in RR behavior.
In
on init
putSampler.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.
-
@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); } }
-
Why not enable all groups and put one sample in each group?
-
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.
-
@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. -
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); } }
-
@ericchesek Why are you setting the note number to
0
? -
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. -
@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.
-
@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. -
@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).
-
@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?
-
@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.
-
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.
-
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).
-
More good news! :beaming_face_with_smiling_eyes:
-
I faced the same problem with function
setMultiGroupIndex
: no matter, what I try ‒ I hear all RR groups, that are mapped to the key.And I'm sure this function is what I need: I have halftone trills in groups 1-2 and wholetone trills in groups 3-4, and, while playing legato I want to choose between half and whole tone, based on intervals being played. It will be huge logic overhead, if splitting all such articulations to different samplers.
-
I've succeeded to do this with
setMultiGroupIndex
, but not withsetMultiGroupIndexForEventID
. But still looks fine. Maybe there is a sense to check the behavior of the last one?