summaryrefslogtreecommitdiff
path: root/gtk2_ardour/tempo_curve.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-09-05 16:28:46 +1000
committernick_m <mainsbridge@gmail.com>2016-09-05 16:28:46 +1000
commit74a604d261b1ecb0f20ee0c69aef7648da3a1d86 (patch)
treec12bf9fecfe8781833a876fa5120326904983e60 /gtk2_ardour/tempo_curve.cc
parentdd7c0cca6c749a2177212e9a7b3dd4eca5e5dd74 (diff)
Fix the tempo note-type hallucination.
- after reports that a tempo with non-4.0 note type would produce a ramp in the preceding section, an incorrect assumption was made leading to a bogus 'fix' that redefined Tempo's pulses_per_minute(). the real fix was simple: the ramp's function constant was calculated using the note type of the proceding tempo rather than the current one. - this patch reverts e82482e8e9c and a4d67279e0086258 and maintains the old definition of Tempo::pulses_per_minute()
Diffstat (limited to 'gtk2_ardour/tempo_curve.cc')
-rw-r--r--gtk2_ardour/tempo_curve.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/gtk2_ardour/tempo_curve.cc b/gtk2_ardour/tempo_curve.cc
index 7f13e17d24..6cc0fbc7fd 100644
--- a/gtk2_ardour/tempo_curve.cc
+++ b/gtk2_ardour/tempo_curve.cc
@@ -121,7 +121,7 @@ TempoCurve::set_position (framepos_t frame, framepos_t end_frame)
points->push_back (ArdourCanvas::Duple (0.0, curve_height));
if (end_frame == UINT32_MAX) {
- const double tempo_at = _tempo.tempo_at_frame (frame, editor.session()->frame_rate()) * 4.0;
+ const double tempo_at = _tempo.tempo_at_frame (frame, editor.session()->frame_rate()) * _tempo.note_type();
const double y_pos = (curve_height) - (((tempo_at - _min_tempo) / (_max_tempo - _min_tempo)) * curve_height);
points->push_back (ArdourCanvas::Duple (0.0, y_pos));
@@ -133,7 +133,7 @@ TempoCurve::set_position (framepos_t frame, framepos_t end_frame)
framepos_t current_frame = frame;
while (current_frame < (end_frame - frame_step)) {
- const double tempo_at = _tempo.tempo_at_frame (current_frame, editor.session()->frame_rate()) * 4.0;
+ const double tempo_at = _tempo.tempo_at_frame (current_frame, editor.session()->frame_rate()) * _tempo.note_type();
const double y_pos = max ((curve_height) - (((tempo_at - _min_tempo) / (_max_tempo - _min_tempo)) * curve_height), 0.0);
points->push_back (ArdourCanvas::Duple (editor.sample_to_pixel (current_frame - frame), min (y_pos, curve_height)));
@@ -141,7 +141,7 @@ TempoCurve::set_position (framepos_t frame, framepos_t end_frame)
current_frame += frame_step;
}
- const double tempo_at = _tempo.tempo_at_frame (end_frame, editor.session()->frame_rate()) * 4.0;
+ const double tempo_at = _tempo.tempo_at_frame (end_frame, editor.session()->frame_rate()) * _tempo.note_type();
const double y_pos = max ((curve_height) - (((tempo_at - _min_tempo) / (_max_tempo - _min_tempo)) * curve_height), 0.0);
points->push_back (ArdourCanvas::Duple (editor.sample_to_pixel ((end_frame - 1) - frame), min (y_pos, curve_height)));