summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-05-27 06:48:45 +1000
committernick_m <mainsbridge@gmail.com>2016-05-27 23:38:18 +1000
commit73db86bf4973bf935693c39846698d29906c9982 (patch)
treec88c7b286d5be46760a9c3a73125563be046a12b /libs
parentaad7b129b63d337a093c05006f345a2a7b06effc (diff)
Tempo ramps - add a gradient limit to the ramp, more comments.
- things are fine without this, but overall it feels slicker with a linit.
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/tempo.h4
-rw-r--r--libs/ardour/tempo.cc9
2 files changed, 11 insertions, 2 deletions
diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h
index 52c4d04b82..08c2eec4dd 100644
--- a/libs/ardour/ardour/tempo.h
+++ b/libs/ardour/ardour/tempo.h
@@ -394,7 +394,7 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
/* TEMPO- AND METER-SENSITIVE FUNCTIONS
- bbt_time(), beat_at_frame(), frame_at_beat(), frame_time()
+ bbt_at_frame(), frame_at_bbt(), beat_at_frame(), frame_at_beat()
and bbt_duration_at()
are all sensitive to tempo and meter, and will give answers
that align with the grid formed by tempo and meter sections.
@@ -445,12 +445,12 @@ class LIBARDOUR_API TempoMap : public PBD::StatefulDestructible
framepos_t framepos_minus_beats (framepos_t, Evoral::Beats) const;
Evoral::Beats framewalk_to_beats (framepos_t pos, framecnt_t distance) const;
- std::pair<double, framepos_t> predict_tempo_position (TempoSection* section, const Timecode::BBT_Time& bbt);
void gui_move_tempo (TempoSection*, const framepos_t& frame);
void gui_move_meter (MeterSection*, const framepos_t& frame);
bool gui_change_tempo (TempoSection*, const Tempo& bpm);
void gui_dilate_tempo (TempoSection* tempo, const framepos_t& frame, const framepos_t& end_frame, const double& pulse);
+ std::pair<double, framepos_t> predict_tempo_position (TempoSection* section, const Timecode::BBT_Time& bbt);
bool can_solve_bbt (TempoSection* section, const Timecode::BBT_Time& bbt);
PBD::Signal0<void> MetricPositionChanged;
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index 2b5aac45f7..646a15b6f3 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -1926,6 +1926,7 @@ TempoMap::check_solved (const Metrics& metrics) const
continue;
}
if (prev_t) {
+ /* check ordering */
if ((t->frame() <= prev_t->frame()) || (t->pulse() <= prev_t->pulse())) {
return false;
}
@@ -1936,6 +1937,14 @@ TempoMap::check_solved (const Metrics& metrics) const
return false;
}
}
+
+ /* gradient limit - who knows what it should be?
+ things are also ok (if a little chaotic) without this
+ */
+ if (fabs (prev_t->c_func()) > 200.0) {
+ //std::cout << "c : " << prev_t->c_func() << std::endl;
+ return false;
+ }
}
prev_t = t;
}