MIDI debugging.
authorRobin Gareus <robin@gareus.org>
Sat, 30 Sep 2017 20:44:44 +0000 (22:44 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 30 Sep 2017 20:44:44 +0000 (22:44 +0200)
libs/ardour/disk_reader.cc
libs/ardour/midi_port.cc

index 47cdc81ad259d4e0697c028349618a32ac86c2ad..6cb6bfcbd900b71c00ee8a8ff09fb005d425bbef 100644 (file)
@@ -1351,9 +1351,25 @@ DiskReader::get_midi_playback (MidiBuffer& dst, samplecnt_t nframes, MonitorStat
                dst.merge_from (*target, nframes);
        }
 
-       //cerr << "======== POST ========\n";
-       //_midi_buf->dump (cerr);
-       //cerr << "----------------\n";
+#if 0
+       if (!target->empty ()) {
+               cerr << "======== MIDI OUT ========\n";
+               for (MidiBuffer::iterator i = target->begin(); i != target->end(); ++i) {
+                       const Evoral::Event<MidiBuffer::TimeType> ev (*i, false);
+                       cerr << "MIDI EVENT (from disk) @ " << ev.time();
+                       for (size_t xx = 0; xx < ev.size(); ++xx) {
+                               cerr << ' ' << hex << (int) ev.buffer()[xx];
+                       }
+                       cerr << dec << endl;
+               }
+               cerr << "----------------\n";
+       }
+#endif
+#if 0
+       cerr << "======== MIDI Disk Buffer ========\n";
+       _midi_buf->dump (cerr);
+       cerr << "----------------\n";
+#endif
 }
 
 /** @a start is set to the new sample position (TIME) read up to */
index 4a6cc3a3af7aa6e81c64271dcb7b9d8754e92601..a6553b7fb679c1eefe73e40f048f4a79761fd475 100644 (file)
@@ -143,7 +143,11 @@ MidiPort::get_midi_buffer (pframes_t nframes)
                                    (timestamp >= (_global_port_buffer_offset + _port_buffer_offset + nframes))) {
                                        cerr << "Dropping incoming MIDI at time " << timestamp << "; offset="
                                                << _global_port_buffer_offset << " limit="
-                                               << (_global_port_buffer_offset + _port_buffer_offset + nframes) << "\n";
+                                               << (_global_port_buffer_offset + _port_buffer_offset + nframes)
+                                               << " = (" << _global_port_buffer_offset
+                                               << " + " << _port_buffer_offset
+                                               << " + " << nframes
+                                               << ")\n";
                                        continue;
                                }