From a15a662bcf6de70cb379bfc582c349f7ff87ee27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sat, 13 Feb 2021 19:01:29 +0100 Subject: Add CLI parameter for position sample selection. --- drumgizmo/drumgizmoc.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drumgizmo/drumgizmoc.cc b/drumgizmo/drumgizmoc.cc index 159c533..c2641df 100644 --- a/drumgizmo/drumgizmoc.cc +++ b/drumgizmo/drumgizmoc.cc @@ -137,6 +137,8 @@ static std::string arguments() "Sample selection parameters:\n" " close: The importance given to choosing a sample close to\n" " the actual velocity value (after humanization). [0,1]\n" + " position: The importance given to choosing a sample close to\n" + " the actual position value (after humanization). [0,1]\n" " diverse: The importance given to choosing samples\n" " which haven't been played recently. [0,1]\n" " random: The amount of randomness added. [0,1]\n" @@ -560,6 +562,16 @@ int main(int argc, char* argv[]) } settings.sample_selection_f_close.store(val); } + else if(token.key == "position") + { + auto val = atof_nol(token.value.data()); + if(val < 0 || val > 1) + { + std::cerr << "position range is [0, 1].\n"; + return 1; + } + settings.sample_selection_f_position.store(val); + } else if(token.key == "diverse") { auto val = atof_nol(token.value.data()); -- cgit v1.2.3