+MidiPort::resolve_notes (void* port_buffer, MidiBuffer::TimeType when)
+{
+ for (uint8_t channel = 0; channel <= 0xF; channel++) {
+
+ uint8_t ev[3] = { ((uint8_t) (MIDI_CMD_CONTROL | channel)), MIDI_CTL_SUSTAIN, 0 };
+
+ /* we need to send all notes off AND turn the
+ * sustain/damper pedal off to handle synths
+ * that prioritize sustain over AllNotesOff
+ */
+
+ if (port_engine.midi_event_put (port_buffer, when, ev, 3) != 0) {
+ cerr << "failed to deliver sustain-zero on channel " << (int)channel << " on port " << name() << endl;
+ }
+
+ ev[1] = MIDI_CTL_ALL_NOTES_OFF;
+
+ if (port_engine.midi_event_put (port_buffer, when, ev, 3) != 0) {
+ cerr << "failed to deliver ALL NOTES OFF on channel " << (int)channel << " on port " << name() << endl;
+ }
+ }
+}
+
+void
+MidiPort::flush_buffers (pframes_t nframes)