void
MidiPort::resolve_notes (void* jack_buffer, MidiBuffer::TimeType when)
{
- uint8_t ev[3];
-
- ev[2] = 0;
-
for (uint8_t channel = 0; channel <= 0xF; channel++) {
- ev[0] = (MIDI_CMD_CONTROL | 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
*/
- ev[1] = MIDI_CTL_SUSTAIN;
-
if (jack_midi_event_write (jack_buffer, when, ev, 3) != 0) {
cerr << "failed to deliver sustain-zero on channel " << channel << " on port " << name() << endl;
}
}
void
-MidiPort::flush_buffers (pframes_t nframes, framepos_t time)
+MidiPort::flush_buffers (pframes_t nframes)
{
if (sends_output ()) {
if (_resolve_required) {
/* resolve all notes at the start of the buffer */
resolve_notes (jack_buffer, 0);
- _resolve_required= false;
+ _resolve_required = false;
}
for (MidiBuffer::iterator i = _buffer->begin(); i != _buffer->end(); ++i) {
<< ev.time() << " > " << _global_port_buffer_offset + _port_buffer_offset << endl;
}
} else {
- cerr << "drop flushed event on the floor, time " << ev.time()
- << " < " << _global_port_buffer_offset + _port_buffer_offset << endl;
+ cerr << "drop flushed event on the floor, time " << ev
+ << " to early for " << _global_port_buffer_offset + _port_buffer_offset << endl;
}
}
}