Fix importing tempo-maps for non-integer pulsed time-signatures
authorRobin Gareus <robin@gareus.org>
Mon, 30 Oct 2017 21:24:21 +0000 (22:24 +0100)
committerRobin Gareus <robin@gareus.org>
Mon, 30 Oct 2017 21:24:21 +0000 (22:24 +0100)
gtk2_ardour/editor_audio_import.cc

index 2d668d214c2d7622d726d6d5e499f5b3d0f0a4fe..0ace7263e2091e17a80926ea6d002e8c2043d891 100644 (file)
@@ -290,9 +290,9 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf, samplepos_t pos)
                Timecode::BBT_Time bbt; /* 1|1|0 which is correct for the no-meter case */
 
                if (have_initial_meter) {
-                       new_map.add_tempo (tempo, (t->time_pulses/smf.ppqn()) / 4.0, 0, MusicTime);
+                       new_map.add_tempo (tempo, t->time_pulses/ (double)smf.ppqn() / 4.0, 0, MusicTime);
                        if (!(meter == last_meter)) {
-                               bbt = new_map.bbt_at_quarter_note ((t->time_pulses/smf.ppqn()));
+                               bbt = new_map.bbt_at_quarter_note (t->time_pulses/(double)smf.ppqn());
                                new_map.add_meter (meter, bbt, 0, MusicTime);
                        }
 
@@ -305,7 +305,7 @@ Editor::import_smf_tempo_map (Evoral::SMF const & smf, samplepos_t pos)
 
                last_meter = meter;
 
-               cerr << "@ " << t->time_pulses/smf.ppqn() << " ("
+               cerr << "@ " << t->time_pulses/(double)smf.ppqn() << " ("
                     << t->time_seconds << ") Add T " << tempo << " M " << meter << endl;
        }