Round Robin in Single Group?
Hello friends, I need your help!
I've set up a group in Kontakt named "SCT" with samples for 127 velocity layers. Each layer has 9 round robin samples. The sample names look like this: 'SCT_C3_109_109_rr9' - where 'SCT' is the group, 'C3' is the note, '109' is the velocity layer, and 'rr9' indicates its position in the round robin cycle.
Can I apply round robin within this single group in Kontakt? If so, could someone share a KSP script example? If not, any alternative suggestions would be appreciated.
Comments
-
I'm sure it would be possible with a script. A pretty large and complex task.
And entirely unnecessary. Move your samples into 9 groups, according to 'rr1-9', Windows Explorer should make this reasonably easy (do a search for rr1, rr2 .... etc' then drag and drop) and set Group Start Options for each to round robin 1-9. If there are other groups in the instrument, move them to another Instrument with the same channel number.
0 -
Thank you for you answer stephen24
I am aware of this method you are mentioning, but is this how the good libraries approach it ?
I am trying to figure out how to build a drum library, never seen a pro and commercial library with multiple instruments, its always a single UI, so they achieving this using only one instance of instrument.
0 -
It is not large task at all and absolutely necessary if you want to keep your group count down for better maintainability of your code and instrument.
Here's one way to do it, a minimal example to build from:
Say you have samples for one note, 5 velocity layer and 5 round robins.
One way to distribute these files in a group would be having all notes for RR1 in the velocity addresses 1,2,3,4,5. Meaning that
velo address 1 = velocity 1, RR1;
VA 2 = velocity 2, RR1;
VA 3 = velocity 3, RR1;
VA 4 = velocity 4, RR1;
VA 5 = velocity 5, RR1;
Then, you offset the velocity address by 10 for the next RR, so
velo address 11 = velocity 1, RR2;
VA 12 = velocity 2, RR2;
VA 13 = velocity 3, RR2;
VA 14 = velocity 4, RR2;
VA 15 = velocity 5, RR2;
and so on until you reach 5 round robins. Of course you will want to use LUA to map these samples.
in your note callback, you will need a play_note( ) that in the velocity value will receive
10*round_robin + velocity
where round_robin is a value from 0 to 4 you have to manage (and do it cycled or random) and velocity is a translation of EVENT_VELOCITY to the 1 - 5 range as
velocity := real+to_int((4.0/127.0)*int_to_real(EVENT_VELOCITY)) + 1
( this is one of the ways, there are other math expressions that will give you other value conversion curves)
That's the gist of it.
1 -
Thank you for you time and effort to explain me the concept, Gablux,
I am a little new to KSP, i tried to create something out of your example but got nothing that is working,
If you have something ready, can you please copy/paste it so I can get my head around it?
0 -
absolutely necessary if you want to keep your group count down for better maintainability of your code and instrument.
Bit baffled by this. Could you explain?
Certainly it's a lot easier if the number of velocity layers X the number of round robins is 128 or less. Come to think of it, 128/9 is 14, enough layers for most purposes - you don't really need 127?
If you want to do it this way, as the man says, it's just a matter of mapping 9 blocks of 14 velocity layers across the velocity range, and doing a bit of arithmetic to find the right sample. {Played velocity (0-127) divided by 9 (0-14)} + {rr number -1 (0-8) X 14}. You'll need a variable to keep track of your rr number, incremented each time. When testing, you can see which sample is playing by a little red dot in the Mapping Editor. Remember it'll affect all the groups in the instrument, unless you write extra code. If you're interested in getting to know KSP, this would be a good exercise.
Far simpler to do what I suggested and use the facilities that the Kontakt wizards wrote specially for you. (I was quite wrong about the other groups - they could stay in the same instrument with different Group Start Options provided you want only one round robin)
1 -
Thank you stephen24
I have 9 samples (purposed as round robins) for each one of the 127 velocity layers (1143 samples total) all of them in a single group. I want to apply the round robin in a single group level, that's the only thing I care to do.
If there is a way to to achieve this please let me know.
0 -
How many different pitches does each velocity layer need?
0 -
The funny thing about all this is
When things start getting more complicated as far as mapping a large amount of samples and engineering the groups layout, yes you will need a bit more knowledge for that, like LUA scripting for the mapping and KSP concepts that go beyond the 101. Which makes me think of the meme above. All jokes aside, I encourage everyone to keep learning programming and coding concepts to tasks that seem exoterical and mysterious become more and more a second nature.
This round robin + multiple velocities done in just one group is certainly not 101 but also not rocket science.
@stephen24 when instruments have multiple microphones and multiple articulations, if you distribute round robins in different groups, you multiply the number of groups of the whole instrument by the number of RRs present in each articulation, when you go over the hundreds mark it already starts to be a pain in the ass to manage all that. Hence I prefer reducing the group cou
1 -
sigh, I wrote a long answer and for some reason the post comment didn't work.
basically @stephen24, when an instrument has multiple microphones, articulations, RRs, velocities, depending on your group strategy, the group count can go easily to the thousands rendering it harder to manage the whole thing. So I like the approach above and similar approaches to reduce group count whenever possible as much as possible.
0 -
Hi medusa
I am not sure if I understand your question, by pitches you mean whats the key range spread?
If yes, then all of the mentioned samples are to single key.
0 -
In order to grasp concepts, I always start with a minimal example on a fresh new NKI.
In this case it would be: 2 RRs. Just 2 wav files, one put on velocity 1 (min to max) and the other on velocity 11 (min to max).
First thing to understand is that the defined velocity will act as an address for your script to find the samples. How do you do that in script?
You have to ignore the incoming midi event on the note callback:
on note ignore_event($EVENT_ID) ...
and use a play_note () function inside the note callback to access that velocity address as:
on note ignore_event($EVENT_ID) play_note($EVENT_NOTE, $velocity_address, 0, -1)
However, you need to set that velocity address based on, at this point, 2 things:
The addresses you are using (1 and 11) and how you want to alternate between these samples. Because we only have 2 samples, it is just a either one or another situation:
on note ignore_event($EVENT_ID) if ($velocity_address = 1) $velocity_address := 11 else $velocity_address := 1 end if play_note($EVENT_NOTE, $velocity_address, 0, -1)
This is the minimal example possible.
From here you can add a second velocity layer (not to be confused with velocity based sample addressing). How?
on velocity 1, put a wav file for your sample RR1, velo 1
on velocity 2, put a wav file for your sample RR1, velo 2
on velocity 11, put a wav file for your sample RR2, velo 1
on velocity 12, put a wav file for your sample RR2, velo 2
Now how do you access velocity 2 of these samples? Again a minimal example:
on note ignore_event($EVENT_ID) if ($EVENT_VELOCITY < 64) $velocity := 0 else $velocity := 1 end if if ($velocity_address = 1) $velocity_address := 11 else $velocity_address := 1 end if play_note($EVENT_NOTE, $velocity_address + $velocity, 0, -1)
Again, this is just alternating between 2 RRs and 2 velocities.
When you have 14 RRs and 12 Velocities what do you do?
Well, let's not get too crazy yet as 12*14 = 168 and that would need more than the 127 addresses available.
Let's say you have 5 RRs and 5 Velocities.
The RR offset has to be at minimum 5.
So if your first sample is at velocity address 1, the RR2 first sample will be at 1 + 5 = 6.
And so on, RR3 at 1 + 5*2, RR4 at 1 + 5*3 etc. notice the pattern here?
RRn start index is 1 + (number of RRs)*(n-1)
Then the velocities:
velocities for RR1 will be on the addresses 1,2,3,4,5.
velocities for RR2 will be on the addresses 6,7,8,9,10
and so on.
How do you select the RR?
there's different approaches, cycling and random.
Cycling:
{ in the note callback. $RR_index starts at zero when declared } play_note($EVENT_NOTE, 1 + 5*$RR_index + $velocity, 0, -1) inc($RR_index) if ($RR_index > 4) $RR_index := 0 end if
Random:
{ in the note callback. $RR_index starts at zero when declared } play_note($EVENT_NOTE, 1 + 5*$RR_index + $velocity, 0, -1) $RR_last_index := $RR_index while($RR_index = $RR_last_index $RR_index := random(0,4) end while { this while prevents the random index to be equal to the last RR index }
This should help to get you started.
- G
1 -
@Gablux once again thank you so much!
I need to review your approach tomorrow with clearer head but from what I understand, you treat the velocity addresses as we normally would treat Kontak's groups.
This is indeed very creative and a clever way to approach it, but isn't limiting the actual velocity layers/rr one can use?
if I understand it correctly the max amount of samples the group can contain so this strategy would work is 127x2 with 63 actual velocity layers and 2 rr for each layer.
I was hoping somehow the script to look for the names of the samples to detect a token-number that indicates the number in the round/random robin order in the actual $EVENT_VELOCITY value. This way we would have the usual 127 layers with infinite rr for each layer.
0 -
Obviously some people thrive on complexity. I prefer a simple life, so my contribution will be a bit shorter.
Map each of your 9 round robin sets of samples in their velocity layers to a single note, so the 9 notes are adjacent. Turn off Tracking (Source Module). A simple script will change whatever note you play to each one of these 9 notes in turn. Your round robin variable, holding the note number, will need to be initialised to the lowest note, then incremented each time so you cycle through the 9 notes, then re-initialised on the 9th.
Hint: if you use set_event_par the whole business part of the script will take 2 lines. Remember it'll affect all the groups in the instrument unless you write code to prevent it. Let us know if you get stuck.
An unusual setup. I'd love to know what sort of instrument this is, and how you will control it with MIDI messages. (Would it be easier to play if you exchanged velocity value and note number in the scheme - 127 notes instead of 127 velocity values?)
1 -
Sorry missed your last post. Are you trying to solve an actual problem, or to establish a generic method?
As I mentioned previously, what you suggest could probably be done but would be pretty complicated. KSP cannot read a sample name, only compare its name with a string which you provide. So you would have to create a string array of 9 rrs ("rr1", "rr2" ... etc) and another of 127 velocity levels, concatenate each combination in turn together with any other text in your sample name, use the string to get the sample number with find_zone, which you put in a 9X127 integer array which your script can then refer to when you play a note.
I suppose once you've done it, you have a generic code which you can easily modify for any dimensions. Keep us informed.
1
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 60 NI News
- 771 Tech Talks
- 4K Native Access
- 16.3K Komplete
- 2K Komplete General
- 4.3K Komplete Kontrol
- 5.6K Kontakt
- 1.6K Reaktor
- 376 Battery 4
- 834 Guitar Rig & FX
- 425 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.7K Maschine
- 7.2K Traktor
- 7.2K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators