diff options
author | Robin Gareus <robin@gareus.org> | 2016-05-25 17:52:50 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-05-25 17:52:50 +0200 |
commit | 6c502b8315bec6540e7ab94e2821e328b1f5af30 (patch) | |
tree | f5aa9923a11a5d87399239449ba3b113da497b1a /libs/ardour/transient_detector.cc | |
parent | 5550eebe2fde5c46a5e67613899699713a92e3c8 (diff) |
allow to configure transient detection sensitivity
NB. this does not yet re-analyze regions when the config changes
and is hence also not [yet] exposed in the GUI.
Diffstat (limited to 'libs/ardour/transient_detector.cc')
-rw-r--r-- | libs/ardour/transient_detector.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/ardour/transient_detector.cc b/libs/ardour/transient_detector.cc index 15b2a4ce08..31b5ab6a8b 100644 --- a/libs/ardour/transient_detector.cc +++ b/libs/ardour/transient_detector.cc @@ -86,11 +86,15 @@ TransientDetector::set_threshold (float val) } void -TransientDetector::set_sensitivity (float val) +TransientDetector::set_sensitivity (uint32_t mode, float val) { if (plugin) { - plugin->selectProgram ("Percussive onsets"); - plugin->setParameter ("sensitivity", val); + // see libs/vamp-plugins/OnsetDetect.cpp + //plugin->selectProgram ("General purpose"); // dftype = 3, sensitivity = 50, whiten = 0 (default) + //plugin->selectProgram ("Percussive onsets"); // dftype = 4, sensitivity = 40, whiten = 0 + plugin->setParameter ("dftype", mode); + plugin->setParameter ("sensitivity", std::min (100.f, std::max (0.f, val))); + plugin->setParameter ("whiten", 0); } } |