What's new

Help for 4 triggers drums project

berto

Senior Member
Hello,

i'm trying to do a trigger system for my acoustic snare drum. I have four triggers on the snare (different positions) and i'd like to assign them to 4 different snare sounds (different position hits on same snare). The triggers are routed to a trigger box which turns the sound into midi notes.

When the Center snare trigger "hears" a hit, the other three triggers detect it as well, but i guess at a slightly softer volume, so my idea would be to tell kontakt that when it receives 4 notes at once, it only plays the one with a louder velocity...but that's the problem. I tried to do a kind of divisi script, where i collect the 4 notes velocity, then wait... but then if i sort the array from louder to softer, then i don't know anymore how to check what note generated that velocity...
i also tried to select the four notes and then if one note velocity is louder than the others, then play it... but it does not work..

how would you go about it?
any help very much appreciated.

B.
 
I'm not sure if this is the quickest way, but you could search(max_velocity) in the unsorted array, and the position would tell you the pitch. (assuming you receive the same four pitches all the time)
 
I'm not sure if this is the quickest way, but you could search(max_velocity) in the unsorted array, and the position would tell you the pitch. (assuming you receive the same four pitches all the time)
but the max velocity would be different every time... according to how hard the snare is hit...
you mean there is a way to get the highest value in an array?

yes the 4 pitches would be always together as all triggers would receive the hit sound...(hence theducking/gating kind of script )
 
sort first, then get the maximum, and search the unsorted for that position

something like:
unsorted_velocities(vel_1, vel_2, vel_3, vel_4) {put the four in the array} sorted_velocities(vel_1, vel_2, vel_3, vel_4) {put the same four in the other array} sort(sorted_velocities, 0) {sort to find the loudest} max_velocity := sorted_velocities(3) {grab the value of the loudest} position := search(unsorted_velocities, max_velocity) {find the index of the loudest}

the position is the index of the highest velocity

I haven't tested this, but in theory it should work.
It's also the kind of thing a better coder might do in fewer steps ? ... not sure.
 
Last edited:
Ok, I'm pretty sure this is quicker.
Assume the first position is the maximum, check each of the others, and update the position only if the value at that index is bigger.

position := 0 for index := 1 to 3 if(unsorted(index) > unsorted(position)) position := index end if end for
 
Last edited:
no actually the first position cannot be always the maximum... it is 4 triggers , so according to where the snare is hit (physically) a different trigger will have the loudest velocity... but i managed to do it with if statements and a very short wait (30) ... it is less elegant but it works, after collecting the 4 velocities, i did: if the index 1 is > all the others, play index one samples, if index 2 is > than all the rest, play index 2 samples... etc. thanks anyway for the help...
 
sort first, then get the maximum, and search the unsorted for that position

something like:
unsorted_velocities(vel_1, vel_2, vel_3, vel_4) {put the four in the array} sorted_velocities(vel_1, vel_2, vel_3, vel_4) {put the same four in the other array} sort(sorted_velocities, 0) {sort to find the loudest} max_velocity := sorted_velocities(3) {grab the value of the loudest} position := search(unsorted_velocities, max_velocity) {find the index of the loudest}

the position is the index of the highest velocity

I haven't tested this, but in theory it should work.
It's also the kind of thing a better coder might do in fewer steps ? ... not sure.
uh.. i did not see this post when i replied earlier....
thanks
 
The 2nd code just STARTS by assuming the first one is maximum, and then checks against the other three to find the real maximum. It's similar to the way you ended up doing it, although might be less code.
 
The 2nd code just STARTS by assuming the first one is maximum, and then checks against the other three to find the real maximum. It's similar to the way you ended up doing it, although might be less code.
thanks so much... greatly appreciated
 
Top Bottom