diff options
author | nick_m <mainsbridge@gmail.com> | 2015-12-21 07:14:10 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-05-27 23:38:09 +1000 |
commit | 9eeccf0c17094708996c3c491f265877b04199fe (patch) | |
tree | acd02a15e757e43502921bbeca089b144a8290d4 /libs/ardour | |
parent | 2d649ceac1633b3ea7d770a13944c7b6a1161e9b (diff) |
Tempo ramps - port audio unit and midi clock slave.
- untested.
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/audio_unit.cc | 4 | ||||
-rw-r--r-- | libs/ardour/midi_clock_slave.cc | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc index 15b63c8f37..6a927680aa 100644 --- a/libs/ardour/audio_unit.cc +++ b/libs/ardour/audio_unit.cc @@ -1810,8 +1810,8 @@ AUPlugin::get_musical_time_location_callback (UInt32* outDeltaSampleOffsetToNe *outDeltaSampleOffsetToNextBeat = 0; } else { *outDeltaSampleOffsetToNextBeat = (UInt32) - floor (((Timecode::BBT_Time::ticks_per_beat - bbt.ticks)/Timecode::BBT_Time::ticks_per_beat) * // fraction of a beat to next beat - metric.tempo().frames_per_beat (_session.frame_rate())); // frames per beat + double beat_frac_to_next = (Timecode::BBT_Time::ticks_per_beat - bbt.ticks) / Timecode::BBT_Time::ticks_per_beat ; + tmap.frame_at_beat (tmap.beat_at_frame (_session.transport_frame() + input_offset) + beat_frac_to_next); } } diff --git a/libs/ardour/midi_clock_slave.cc b/libs/ardour/midi_clock_slave.cc index 8c95272fde..44bb31e05c 100644 --- a/libs/ardour/midi_clock_slave.cc +++ b/libs/ardour/midi_clock_slave.cc @@ -83,7 +83,7 @@ void MIDIClock_Slave::calculate_one_ppqn_in_frames_at(framepos_t time) { const Tempo& current_tempo = session->tempo_map().tempo_at(time); - double frames_per_beat = current_tempo.frames_per_beat(session->frame_rate()); + double frames_per_beat = session->tempo_map().frames_per_beat_at (time, session->frame_rate()); double quarter_notes_per_beat = 4.0 / current_tempo.note_type(); double frames_per_quarter_note = frames_per_beat / quarter_notes_per_beat; |