summaryrefslogtreecommitdiff
path: root/drumgizmo
diff options
context:
space:
mode:
authorAndré Nusser <anusser@mpi-inf.mpg.de>2021-02-13 19:01:29 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2024-07-22 11:29:48 +0200
commitddd12cae8a21eba52a4d8fae9dced18878e0e055 (patch)
tree45f2a75b9abc64a4d98c154edda60a72b3db95c0 /drumgizmo
parentb5f155ee26df89e7447735e37d1f9c7ffd877843 (diff)
Add CLI parameter for position sample selection.
Diffstat (limited to 'drumgizmo')
-rw-r--r--drumgizmo/drumgizmoc.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/drumgizmo/drumgizmoc.cc b/drumgizmo/drumgizmoc.cc
index bca55d2..62b527e 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"
@@ -615,6 +617,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());