unfinished de enumeration

This commit is contained in:
Kieran McAuliffe 2024-07-24 19:31:08 +02:00
parent 8381daf468
commit f9a8c05955
2 changed files with 12 additions and 0 deletions

View File

@ -30,6 +30,16 @@ function EnumeratorRow(props){
};
}
function denumerate(inval, count, keys, vals){
let output;
for (let i=0; i < count; i++){
if (inval === vals[i]){
output = (parseFloat(keys[i]) + parseFloat(keys[i+1])) / 2; // linear interpolate
}
}
return output;
}
function enumerate(name, inval, count, keys, vals){
let output = "OUT OF RANGE";

View File

@ -157,6 +157,8 @@ function MasterLfoHandler(){
let name = event.detail[0];
let val = event.detail[1];
// NEED TO CHECK FOR INDEX OF THIS NAME IN ENUM MATRIX, AND IF IT IS THERE IT SHOULD DENUMERATE
// if none of the LFOs use this param, then we send it straight to the enum
let i = 0;