summaryrefslogtreecommitdiff
path: root/src/settings.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-06-15 20:15:07 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-07-15 18:56:00 +0200
commitbe9fe821ff1689ece9ee6433fcf42ec316e0aaad (patch)
tree96ae9a9e52539c32b37d8f9805cf4a458125033a /src/settings.h
parent3e003e674b31ca1308f5c32125f5a2152e773f17 (diff)
PoC for humanisation visualiser.
Diffstat (limited to 'src/settings.h')
-rw-r--r--src/settings.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/settings.h b/src/settings.h
index f044bae..9d225b0 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -79,6 +79,9 @@ struct Settings
Atomic<float> velocity_modifier_weight{velocity_modifier_weight_default};
Atomic<float> velocity_stddev{velocity_stddev_default}; // [0.5; 3.0]
+ // Current velocity offset - for UI
+ Atomic<float> velocity_modifier_current{1.0f};
+
Atomic<bool> enable_velocity_randomiser{false};
Atomic<float> velocity_randomiser_weight{0.1f};
@@ -121,6 +124,9 @@ struct Settings
//! 1: never
static float constexpr latency_regain_default = 0.9f;
Atomic<float> latency_regain{latency_regain_default};
+
+ // Current latency offset - for UI
+ Atomic<int> latency_current{0};
};
//! Settings getter class.
@@ -146,6 +152,7 @@ struct SettingsGetter
SettingRef<float> velocity_modifier_falloff;
SettingRef<float> velocity_modifier_weight;
SettingRef<float> velocity_stddev;
+ SettingRef<float> velocity_modifier_current;
SettingRef<bool> enable_velocity_randomiser;
SettingRef<float> velocity_randomiser_weight;
@@ -169,6 +176,7 @@ struct SettingsGetter
SettingRef<int> latency_laid_back;
SettingRef<float> latency_stddev;
SettingRef<float> latency_regain;
+ SettingRef<int> latency_current;
SettingsGetter(Settings& settings)
: drumkit_file(settings.drumkit_file)
@@ -188,6 +196,7 @@ struct SettingsGetter
, velocity_modifier_falloff{settings.velocity_modifier_falloff}
, velocity_modifier_weight{settings.velocity_modifier_weight}
, velocity_stddev{settings.velocity_stddev}
+ , velocity_modifier_current{settings.velocity_modifier_current}
, enable_velocity_randomiser{settings.enable_velocity_randomiser}
, velocity_randomiser_weight{settings.velocity_randomiser_weight}
, samplerate{settings.samplerate}
@@ -205,6 +214,7 @@ struct SettingsGetter
, latency_laid_back{settings.latency_laid_back}
, latency_stddev{settings.latency_stddev}
, latency_regain{settings.latency_regain}
+ , latency_current{settings.latency_current}
{
}
};
@@ -233,6 +243,7 @@ public:
Notifier<float> velocity_modifier_falloff;
Notifier<float> velocity_modifier_weight;
Notifier<float> velocity_stddev;
+ Notifier<float> velocity_modifier_current;
Notifier<bool> enable_velocity_randomiser;
Notifier<float> velocity_randomiser_weight;
@@ -256,6 +267,7 @@ public:
Notifier<int> latency_laid_back;
Notifier<float> latency_stddev;
Notifier<float> latency_regain;
+ Notifier<int> latency_current;
void evaluate()
{
@@ -281,6 +293,7 @@ public:
EVAL(velocity_modifier_falloff);
EVAL(velocity_modifier_weight);
EVAL(velocity_stddev);
+ EVAL(velocity_modifier_current);
EVAL(enable_velocity_randomiser);
EVAL(velocity_randomiser_weight);
@@ -304,6 +317,7 @@ public:
EVAL(latency_laid_back);
EVAL(latency_stddev);
EVAL(latency_regain);
+ EVAL(latency_current);
}
SettingsNotifier(Settings& settings)