summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-08-31 06:57:46 +1000
committernick_m <mainsbridge@gmail.com>2016-08-31 23:12:11 +1000
commite82482e8e9cb091bc38115ee3e6278b6fe6527b5 (patch)
tree8397013e65e9e8efaade7c3a330bab3a4f7604e0
parent5113a492e0b7ad6d9f3d871e9c0003a5246e67f5 (diff)
Fix incorrect inclusion of note_type in Tempo::pulses_per_minute().
-rw-r--r--libs/ardour/ardour/tempo.h2
-rw-r--r--libs/ardour/tempo.cc12
2 files changed, 7 insertions, 7 deletions
diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h
index ab52e8e839..ebc02284db 100644
--- a/libs/ardour/ardour/tempo.h
+++ b/libs/ardour/ardour/tempo.h
@@ -62,7 +62,7 @@ class LIBARDOUR_API Tempo {
double beats_per_minute () const { return _beats_per_minute; }
void set_beats_per_minute (double bpm) { _beats_per_minute = bpm; }
double note_type () const { return _note_type; }
- double pulses_per_minute () const { return _beats_per_minute / _note_type; }
+ double pulses_per_minute () const { return _beats_per_minute / 4.0; }
/** audio samples per beat
* @param sr samplerate
*/
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index 3229f8c7ba..2dad0bb354 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -1560,7 +1560,7 @@ TempoMap::tempo_at_frame_locked (const Metrics& metrics, const framepos_t& frame
}
if ((prev_t) && t->frame() > frame) {
/* t is the section past frame */
- const double ret_bpm = prev_t->tempo_at_frame (frame, _frame_rate) * prev_t->note_type();
+ const double ret_bpm = prev_t->tempo_at_frame (frame, _frame_rate) * 4.0;
const Tempo ret_tempo (ret_bpm, prev_t->note_type());
return ret_tempo;
}
@@ -1591,7 +1591,7 @@ framepos_t
TempoMap::frame_at_tempo_locked (const Metrics& metrics, const Tempo& tempo) const
{
TempoSection* prev_t = 0;
- const double tempo_ppm = tempo.beats_per_minute() / tempo.note_type();
+ const double tempo_ppm = tempo.beats_per_minute() / 4.0;
Metrics::const_iterator i;
@@ -1604,14 +1604,14 @@ TempoMap::frame_at_tempo_locked (const Metrics& metrics, const Tempo& tempo) con
continue;
}
- const double t_ppm = t->beats_per_minute() / t->note_type();
+ const double t_ppm = t->beats_per_minute() / 4.0;
if (t_ppm == tempo_ppm) {
return t->frame();
}
if (prev_t) {
- const double prev_t_ppm = prev_t->beats_per_minute() / prev_t->note_type();
+ const double prev_t_ppm = prev_t->beats_per_minute() / 4.0;
if ((t_ppm > tempo_ppm && prev_t_ppm < tempo_ppm) || (t_ppm < tempo_ppm && prev_t_ppm > tempo_ppm)) {
return prev_t->frame_at_tempo (tempo_ppm, prev_t->pulse(), _frame_rate);
@@ -1635,7 +1635,7 @@ TempoMap::tempo_at_beat (const double& beat) const
const TempoSection* prev_t = &tempo_section_at_beat_locked (_metrics, beat);
const double note_type = prev_t->note_type();
- return Tempo (prev_t->tempo_at_pulse (((beat - prev_m->beat()) / prev_m->note_divisor()) + prev_m->pulse()) * note_type, note_type);
+ return Tempo (prev_t->tempo_at_pulse (((beat - prev_m->beat()) / prev_m->note_divisor()) + prev_m->pulse()) * 4.0, note_type);
}
double
@@ -3567,7 +3567,7 @@ TempoMap::frames_per_beat_at (const framepos_t& frame, const framecnt_t& sr) con
}
if (ts_after) {
- return (60.0 * _frame_rate) / (ts_at->tempo_at_frame (frame, _frame_rate) * ts_at->note_type());
+ return (60.0 * _frame_rate) / (ts_at->tempo_at_frame (frame, _frame_rate) * 4.0);
}
/* must be treated as constant tempo */
return ts_at->frames_per_beat (_frame_rate);