Compare commits
3 Commits
be5c64f737
...
4339e3c729
Author | SHA1 | Date |
---|---|---|
Ben Loftis | 4339e3c729 | |
Ben Loftis | f7abe8dacd | |
Ben Loftis | 0cfbc64e54 |
|
@ -1027,13 +1027,20 @@ RegionMotionDrag::collect_ripple_views ()
|
|||
|
||||
_editor->get_regionviews_at_or_after (_primary->region()->position(), copy);
|
||||
|
||||
TimeAxisView *primary_tav = &_primary->get_time_axis_view();
|
||||
|
||||
for (RegionSelection::reverse_iterator i = copy.rbegin(); i != copy.rend(); ++i) {
|
||||
if (!_editor->selection->regions.contains (*i)) {
|
||||
_views.push_back (DraggingView (*i, this, &(*i)->get_time_axis_view()));
|
||||
TimeAxisView *tav = &(*i)->get_time_axis_view();
|
||||
if (_editor->should_ripple_all() || tav == primary_tav) {
|
||||
if (!_editor->selection->regions.contains (*i)) {
|
||||
_views.push_back (DraggingView (*i, this, &(*i)->get_time_axis_view()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_editor->get_markers_to_ripple (_primary->region()->playlist(), _primary->region()->position(), ripple_markers);
|
||||
if (_editor->should_ripple_all()) {
|
||||
_editor->get_markers_to_ripple (_primary->region()->playlist(), _primary->region()->position(), ripple_markers);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -9497,6 +9497,7 @@ Editor::do_ripple (boost::shared_ptr<Playlist> target_playlist, timepos_t const
|
|||
timepos_t
|
||||
Editor::effective_ripple_mark_start (boost::shared_ptr<Playlist> target_playlist, timepos_t pos)
|
||||
{
|
||||
#if 0 /* I do not agree with this behavior - at the very least it ignores regions on *other* tracks and the markers that might be associated with them -Ben */
|
||||
/* in the target playlist, find the region before the target
|
||||
* (implicitly given by @param at. Allow all markers that occur between
|
||||
* the end of the region and @param at to move too. This is
|
||||
|
@ -9516,6 +9517,7 @@ Editor::effective_ripple_mark_start (boost::shared_ptr<Playlist> target_playlist
|
|||
if (last_region_end_before_at < pos) {
|
||||
pos = last_region_end_before_at.increment();
|
||||
}
|
||||
#endif
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
|
|
@ -1612,18 +1612,10 @@ AudioTrigger::estimate_tempo ()
|
|||
}
|
||||
}
|
||||
|
||||
/* We don't have too many good choices here. Triggers can fire at any
|
||||
* time, so there's no special place on the tempo map that we can use
|
||||
* to get the meter from and thus compute an estimated bar count for
|
||||
* this region. Our solution for now: just use the first meter.
|
||||
*/
|
||||
|
||||
if (text_tempo < 0) {
|
||||
|
||||
breakfastquay::MiniBPM mbpm (_box.session().sample_rate());
|
||||
|
||||
mbpm.setBPMRange (metric.tempo().quarter_notes_per_minute () * 0.75, metric.tempo().quarter_notes_per_minute() * 1.5);
|
||||
|
||||
_estimated_tempo = mbpm.estimateTempoOfSamples (data[0], data.length);
|
||||
|
||||
//cerr << name() << "MiniBPM Estimated: " << _estimated_tempo << " bpm from " << (double) data.length / _box.session().sample_rate() << " seconds\n";
|
||||
|
@ -1642,6 +1634,24 @@ AudioTrigger::estimate_tempo ()
|
|||
/* fractional beatcnt */
|
||||
double maybe_beats = (seconds / 60.) * _estimated_tempo;
|
||||
double beatcount = round (maybe_beats);
|
||||
|
||||
/* the vast majority of third-party clips are 1,2,4,8, or 16-bar 'beats'.
|
||||
* Given no other metadata, it makes things 'just work' if we assume 4/4 time signature, and power-of-2 bars (1,2,4,8 or 16)
|
||||
* TODO: someday we could provide a widget for users who have unlabeled, un-metadata'd, clips that they *know* are 3/4 or 5/4 or 11/4 */
|
||||
{
|
||||
double barcount = round (beatcount/4);
|
||||
if (barcount <= 18) { /* why not 16 here? fuzzy logic allows minibpm to misjudge the clip a bit */
|
||||
for (int pwr = 0; pwr <= 4; pwr++) {
|
||||
float bc = pow(2,pwr);
|
||||
if (barcount <= bc) {
|
||||
barcount = bc;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
beatcount = round(barcount * 4);
|
||||
}
|
||||
|
||||
double est = _estimated_tempo;
|
||||
_estimated_tempo = beatcount / (seconds/60.);
|
||||
DEBUG_TRACE (DEBUG::Triggers, string_compose ("given original estimated tempo %1, rounded beatcnt is %2 : resulting in working bpm = %3\n", est, _beatcnt, _estimated_tempo));
|
||||
|
@ -1650,8 +1660,6 @@ AudioTrigger::estimate_tempo ()
|
|||
set_follow_length(Temporal::BBT_Offset( 0, rint(beatcount), 0));
|
||||
}
|
||||
|
||||
/* use initial tempo in map (assumed for now to be the only one */
|
||||
|
||||
#if 0
|
||||
cerr << "estimated tempo: " << _estimated_tempo << endl;
|
||||
const samplecnt_t one_beat = tm->bbt_duration_at (timepos_t (AudioTime), BBT_Offset (0, 1, 0)).samples();
|
||||
|
|
Loading…
Reference in New Issue