maxchristensenaudio
Observant Sound
I'm working on a Kontakt6 sample library where I've made my own dynamic file browser and preset system. Currently I'm a bit stuck with my custom sample file browser.
I have several sample categories and sample layer buttons. Depending on which category button is active, the sample layer buttons will display different labels. That way I don't have to declare 100's of sample buttons. The problem is that I don't know how to tell the engine which sample button to activate and when. If sample_1 of category_1 has been assigned, then that button should ONLY display it's ON state when the category_1 button is active, and the category_1 samples are being displayed. I'm just unsure on how to write that...
My file browser UI for visual context
Below you can see how I tell my data array which sample has been assigned. Depending on what current_layer_side is, the idx will save the sample idx number either for the left or the right sample player. These last...value arrays get fed into a main preset array that gets saved as a data file.
I have several sample categories and sample layer buttons. Depending on which category button is active, the sample layer buttons will display different labels. That way I don't have to declare 100's of sample buttons. The problem is that I don't know how to tell the engine which sample button to activate and when. If sample_1 of category_1 has been assigned, then that button should ONLY display it's ON state when the category_1 button is active, and the category_1 samples are being displayed. I'm just unsure on how to write that...
My file browser UI for visual context
Below you can see how I tell my data array which sample has been assigned. Depending on what current_layer_side is, the idx will save the sample idx number either for the left or the right sample player. These last...value arrays get fed into a main preset array that gets saved as a data file.
// Select a sample layer for assignment
macro sample.select.action (control, sample)
// Triggered when pressing a sample layer button
// current_layer_side passed on sample.source.ui.action or preset load
on ui_control (control)
// turn off all active sample buttons ui_sample_button_IDs[i] -> value := 0
for i := 0 to num_elements(ui_sample_button_IDs) - 1
ui_sample_button_IDs[i] -> value := 0
end for
ui_sample_button_IDs[sample] -> value := 1
layer_button := sample
// If any sample category > 1st is active --> keep counting up layer button idx
// with all sample entries per previous category
if (sample_category > 0)
for i := 0 to sample_category - 1
layer_button := layer_button + arr_samples_per_cat[i]
end for
end if
// Remember assigned sample for data array
// idx[1] = selected sample L
// [cur_layer_s * layer_controlls] = either 0 or 1 * num of layer controls for R side
%arr_last_layer_values[1 + current_layer_side * layer_controlls] := layer_button
//call select.layer
//call close.file.browser
end on
end macro
Last edited: