mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 02:56:35 +01:00
Fix time skew after MIDI recording (added missing conversion from delta time to audio frames).
Fix crash bug in MIDI recording. git-svn-id: svn://localhost/ardour2/trunk@1980 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
cc18cf3516
commit
0605f98fdc
3 changed files with 11 additions and 4 deletions
|
|
@ -790,10 +790,17 @@ SMFSource::load_model(bool lock)
|
|||
nframes_t time = 0;
|
||||
MidiEvent ev;
|
||||
|
||||
// FIXME: assumes tempo never changes after start
|
||||
const double frames_per_beat = _session.tempo_map().tempo_at(_timeline_position).frames_per_beat(
|
||||
_session.engine().frame_rate());
|
||||
|
||||
int ret;
|
||||
while ((ret = read_event(ev)) >= 0) {
|
||||
time += ev.time;
|
||||
ev.time = time;
|
||||
|
||||
ev.time = (nframes_t)(ev.time * frames_per_beat / (double)_ppqn);
|
||||
|
||||
if (ret > 0) { // didn't skip (meta) event
|
||||
//cerr << "ADDING EVENT TO MODEL: " << ev.time << endl;
|
||||
_model->append(ev);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue