Tempo ramps - fix thinko in a could-be-more-efficient manner.
- some form of 'no time' now functions correctly between audio locked meters.
This commit is contained in:
@@ -1255,7 +1255,12 @@ TempoMap::recompute_meters (Metrics& metrics)
|
||||
for (Metrics::const_iterator mi = metrics.begin(); mi != metrics.end(); ++mi) {
|
||||
if ((meter = dynamic_cast<MeterSection*> (*mi)) != 0) {
|
||||
if (prev_m) {
|
||||
const double beats_in_m = (meter->pulse() - prev_m->pulse()) * prev_m->note_divisor();
|
||||
double beats_in_m;
|
||||
if (meter->position_lock_style() == MusicTime) {
|
||||
beats_in_m = (meter->pulse() - prev_m->pulse()) * prev_m->note_divisor();
|
||||
} else {
|
||||
beats_in_m = ((pulse_at_frame_locked (metrics, meter->frame()) - prev_m->pulse()) * prev_m->note_divisor()) - prev_m->beat();
|
||||
}
|
||||
accumulated_bars += (beats_in_m + 1) / prev_m->divisions_per_bar();
|
||||
}
|
||||
if (meter->position_lock_style() == AudioTime) {
|
||||
@@ -2009,7 +2014,12 @@ TempoMap::solve_map (Metrics& imaginary, MeterSection* section, const Meter& mt,
|
||||
MeterSection* m;
|
||||
if ((m = dynamic_cast<MeterSection*> (*i)) != 0) {
|
||||
if (prev_ms) {
|
||||
const double beats_in_m = (m->pulse() - prev_ms->pulse()) * prev_ms->note_divisor();
|
||||
double beats_in_m;
|
||||
if (m->position_lock_style() == MusicTime) {
|
||||
beats_in_m = (m->pulse() - prev_ms->pulse()) * prev_ms->note_divisor();
|
||||
} else {
|
||||
beats_in_m = ((pulse_at_frame_locked (imaginary, frame) - prev_ms->pulse()) * prev_ms->note_divisor()) - prev_ms->beat();
|
||||
}
|
||||
accumulated_bars += (beats_in_m + 1) / prev_ms->divisions_per_bar();
|
||||
}
|
||||
if (m == section){
|
||||
@@ -2086,7 +2096,12 @@ TempoMap::solve_map (Metrics& imaginary, MeterSection* section, const Meter& mt,
|
||||
MeterSection* m;
|
||||
if ((m = dynamic_cast<MeterSection*> (*i)) != 0) {
|
||||
if (prev_ms) {
|
||||
double const beats_in_m = (m->pulse() - prev_ms->pulse()) * prev_ms->note_divisor();
|
||||
double beats_in_m;
|
||||
if (m->position_lock_style() == MusicTime) {
|
||||
beats_in_m = (m->pulse() - prev_ms->pulse()) * prev_ms->note_divisor();
|
||||
} else {
|
||||
beats_in_m = ((pulse_at_frame_locked (imaginary, m->frame()) - prev_ms->pulse()) * prev_ms->note_divisor()) - prev_ms->beat();
|
||||
}
|
||||
accumulated_beats += beats_in_m;
|
||||
accumulated_bars += (beats_in_m + 1) / prev_ms->divisions_per_bar();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user