- // i guess this should do but i leave it off to test the rest first.
- //if (ev.time > offset && ev.time < offset+nframes)
- _buffer->push_back (ev);
+ for (pframes_t i = 0; i < event_count; ++i) {
+
+ jack_midi_event_t ev;
+
+ jack_midi_event_get (&ev, jack_buffer, i);
+
+ if (ev.buffer[0] == 0xfe) {
+ /* throw away active sensing */
+ continue;
+ }
+
+ /* check that the event is in the acceptable time range */
+
+ if ((ev.time >= (_global_port_buffer_offset + _port_buffer_offset)) &&
+ (ev.time < (_global_port_buffer_offset + _port_buffer_offset + nframes))) {
+ _buffer->push_back (ev);
+ } else {
+ cerr << "Dropping incoming MIDI at time " << ev.time << "; offset="
+ << _global_port_buffer_offset << " limit="
+ << (_global_port_buffer_offset + _port_buffer_offset + nframes) << "\n";
+ }
+ }
+
+ } else {
+ _buffer->silence (nframes);