summaryrefslogtreecommitdiff
path: root/libs/ardour/tempo.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-01-06 22:50:34 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-01-06 22:50:34 +0000
commitc7b7cb9a3199d9c4b0fa04ff8765046b0d7aaad0 (patch)
tree87303a68a1ee28ad97a8341d25d4588b52ca0785 /libs/ardour/tempo.cc
parent161c33a84fc504042b6e68e06866ce09623dde6d (diff)
re-adjust computation of non-beat aligned tempo change
git-svn-id: svn://localhost/ardour2/branches/3.0@11179 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/tempo.cc')
-rw-r--r--libs/ardour/tempo.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index 5e694b1541..5ad947ed68 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -830,6 +830,8 @@ TempoMap::recompute_map (bool reassign_tempo_bbt, framepos_t end)
}
_extend_map (tempo, meter, next_metric, current, current_frame, end);
+
+ dump (cerr);
}
void
@@ -939,8 +941,15 @@ TempoMap::_extend_map (TempoSection* tempo, MeterSection* meter,
/* set tempo section location based on offset from last beat */
- double bar_offset_in_beats = (ts->bar_offset() * meter->divisions_per_bar()) - 1;
- bar_offset_in_beats -= current.beats;
+ double bar_offset_in_beats = 1 + (ts->bar_offset() * meter->divisions_per_bar());
+
+ /* we've already advanced
+ * current.beats, but we want
+ * the previous beat's value
+ */
+
+ bar_offset_in_beats -= current.beats - 1;
+
tempo->set_frame (current_frame + (bar_offset_in_beats * beat_frames));
/* advance to the location of the new (adjusted) beat */