Hi guys, I'm trying to convert an old instrument to HISE and I'm running into a head scratcher as far as implementing Hi Hat choke.
I put together some code that allows the user to map their MIDI inputs for each kit-piece using an array for the source (the actual mapping in the samplemap) and the trigger (the assignable midi input).
// create source array (value is MIDI note)
reg kitSource = [];
kitSource[0] = 1; // defines kick main source
kitSource[1] = 2; // defines snare main source
kitSource[2] = 3; // defines snare rimshot source
kitSource[3] = 4; // defines snare crossstick source
kitSource[4] = 5; // defines snare rim source
kitSource[5] = 6; // defines hihats closed source
kitSource[6] = 7; // defines hihats open source
kitSource[7] = 8; // defines hihats pedal source
kitSource[8] = 9; // defines tom1 main source
kitSource[9] = 10; // defines tom2 main source
kitSource[10] = 11; // defines right_crash main source
kitSource[11] = 12; // defines right_crash choke source
kitSource[12] = 13; // defines right_crash bell source
kitSource[13] = 14; // defines left_crash main source
kitSource[14] = 15; // defines left_crash choke source
kitSource[15] = 16; // defines left_crash bell source
kitSource[16] = 17; // defines ride main source
kitSource[17] = 18; // defines ride bell source
kitSource[18] = 19; // defines ride crash source
kitSource[19] = 20; // defines ride choke source
kitSource[20] = 21; // defines china source
//create trigger array (value is MIDI input note)
reg kitTrigger = [];
kitTrigger[0] = 36; // defines kick main trigger
kitTrigger[1] = 38; // defines snare main trigger
kitTrigger[2] = 40; // defines snare rimshot trigger
kitTrigger[3] = 37; // defines snare cross stick trigger
kitTrigger[4] = 71; // defines snare rim trigger
kitTrigger[5] = 42; // defines hihats closed trigger
kitTrigger[6] = 46; // defines hihats open trigger
kitTrigger[7] = 44; // defines hihats pedal trigger
kitTrigger[8] = 48; // defines tom1 main trigger
kitTrigger[9] = 43; // defines tom2 main trigger
kitTrigger[10] = 57; // defines right_crash main trigger
kitTrigger[11] = 58; // defines right_crash choke trigger
kitTrigger[12] = 105; // defines right_crash bell trigger
kitTrigger[13] = 49; // defines left_crash main trigger
kitTrigger[14] = 50; // defines left_crash choke trigger
kitTrigger[15] = 93; // defines left_crash bell trigger
kitTrigger[16] = 51; // defines ride main trigger
kitTrigger[17] = 30; // defines ride bell trigger
kitTrigger[18] = 59; // defines ride crash trigger
kitTrigger[19] = 118; // defines ride choke trigger
kitTrigger[20] = 52; // defines china trigger
(Side note: I chose to map my samples the bottom of the keyboard because I can't find a way to prevent the midi passing through instead of being aliased to the trigger only. If you have a solution for that, please let me know! I tried Message.ignoreEvent but that only prevent the samples from playing. I think because of the for loop?)
In my onNote fuction I call this:
function onNoteOn()
{
//Console.print(Message.getNoteNumber());
for(var index = 0; index < 127; index++){
if(Message.getNoteNumber() == kitTrigger[index]){
Message.setNoteNumber(kitSource[index]);
}
}
}
I've found several solutions for choke groups on the forum but none that I could figure out on my own how to apply a choke group to my code. Any ideas?