maxchristensenaudio
Observant Sound
In my instrument I have a keyboard split mode and two sample layers that can either both be triggered by the same note or be split up,
so the left layer only plays on the left side of the keyboard, the right only on the right.
Having the keyboard split has been the standard during development, but now that I want to add the option to disable the split mode I'm having a tough time making Kontakt trigger both sample layers for the same note and I think it has something to do with how I handle NOTE_ID
Currently what's happening when the split mode is OFF, is that the left-layer will play, but the right one won't.
If I switch the positions and have play_right_note() come first in the script, then the right layer will play and the left one will not.
Any ideas?
Here's the script:
so the left layer only plays on the left side of the keyboard, the right only on the right.
Having the keyboard split has been the standard during development, but now that I want to add the option to disable the split mode I'm having a tough time making Kontakt trigger both sample layers for the same note and I think it has something to do with how I handle NOTE_ID
Currently what's happening when the split mode is OFF, is that the left-layer will play, but the right one won't.
If I switch the positions and have play_right_note() come first in the script, then the right layer will play and the left one will not.
Any ideas?
Here's the script:
Code:
on note
disallow_group($ALL_GROUPS)
if (btn_kb_split = 0) // If keyboard split mode is off
note_offset := -24 // Set the same startpoint for L & R for octave transposing
if (btn_layers_mute_l = 1) //If Waveplayer is on
play_left_note() // only allow group of current sample L
end if
if (btn_layers_mute_r = 1) //If Waveplayer is on
play_right_note() // only allow group of current sample R
end if
else
if ($EVENT_NOTE < 60) //Left side of the keyboard
if (btn_layers_mute_l = 1) //If Waveplayer is on
note_offset := -24 // Set the note offset for kb split mode
play_left_note() // only allow group of current sample L
end if
else
if (btn_layers_mute_r = 1) //If Waveplayer is on
note_offset := -72 // Set the note offset for kb split mode
play_right_note() // only allow group of current sample R
end if
end if
end if
end on
macro play_left_note
set_event_par_arr(EVENT_ID, $EVENT_PAR_ALLOW_GROUP, 1, arr_last_layer_values[SAMPLE_L_IDX])
change_note($EVENT_ID, $EVENT_NOTE + note_offset + (%arr_last_layer_values[6] * 12)) //-24
// Save & display current sample playback position
while ($NOTE_HELD = 1)
$play_pos_l := get_event_par($EVENT_ID,$EVENT_PAR_PLAY_POS)
set_ui_wf_property(waveform_l, $UI_WF_PROP_PLAY_CURSOR, 0, $play_pos_l)
wait (10000)
end while
end macro
macro play_right_note
set_event_par_arr(EVENT_ID, $EVENT_PAR_ALLOW_GROUP, 1, arr_last_layer_values[SAMPLE_R_IDX])
change_note($EVENT_ID, $EVENT_NOTE + note_offset + (%arr_last_layer_values[6 + NUM_LAYER_CONTROLS] * 12)) //-72
// Save & display current sample playback position
while ($NOTE_HELD = 1) //save & display current sample playback position
$play_pos_r := get_event_par($EVENT_ID,$EVENT_PAR_PLAY_POS)
set_ui_wf_property(waveform_r, $UI_WF_PROP_PLAY_CURSOR, 0, $play_pos_r)
wait (10000)
end while
end macro