diff options
author | nick_m <mainsbridge@gmail.com> | 2016-12-19 03:23:33 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-12-19 03:23:33 +1100 |
commit | 741df6e6ef13ffcac4c9b460f6086ccea1b09d7d (patch) | |
tree | 8a514d56d6193e409d314eca4c600da44d1da74a /libs/ardour/tempo.cc | |
parent | 448f921dd893f58b20683801db6806464520d49f (diff) |
there is no curve for identical note_types_per_minute values.
Diffstat (limited to 'libs/ardour/tempo.cc')
-rw-r--r-- | libs/ardour/tempo.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 9f724a3dca..f5b75eb5ee 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -426,6 +426,10 @@ https://www.zhdk.ch/fileadmin/data_subsites/data_icst/Downloads/Timegrid/ICST_Te double TempoSection::compute_c_func_pulse (const double& end_npm, const double& end_pulse) const { + if (note_types_per_minute() == end_npm) { + return 0.0; + } + double const log_tempo_ratio = log (end_npm / note_types_per_minute()); return (note_types_per_minute() * expm1 (log_tempo_ratio)) / ((end_pulse - pulse()) * _note_type); } @@ -438,6 +442,10 @@ TempoSection::compute_c_func_pulse (const double& end_npm, const double& end_pul double TempoSection::compute_c_func_minute (const double& end_npm, const double& end_minute) const { + if (note_types_per_minute() == end_npm) { + return 0.0; + } + return c_func (end_npm, end_minute - minute()); } |