mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-31 19:07:43 +01:00
Fix MIDI panic timestamp at cycle-end
Previousy stopping, locating or looping in the middle of an active MIDI note would generate unordered MIDI events on the port. "it's too late for this event". Usually caused by the MIDI state tracker adding a Note-Off at cycle end and then MidiPort::resolve_notes adding a panic message at cycle-start...
This commit is contained in:
parent
cf85399f38
commit
f4da0ff76d
1 changed files with 6 additions and 3 deletions
|
|
@ -273,10 +273,13 @@ MidiPort::flush_buffers (pframes_t nframes)
|
|||
|
||||
void* port_buffer = 0;
|
||||
|
||||
if (_resolve_required) {
|
||||
if (_resolve_required && (_global_port_buffer_offset + nframes) > 0) {
|
||||
port_buffer = port_engine.get_buffer (_port_handle, nframes);
|
||||
/* resolve all notes at the start of the buffer */
|
||||
resolve_notes (port_buffer, _global_port_buffer_offset);
|
||||
/* This is called from ARDOUR::PortManager::cycle_end() at which
|
||||
* point other MIDI data has already been written to the port.
|
||||
* So we "resolve notes" (panic) at the end of he buffer.
|
||||
*/
|
||||
resolve_notes (port_buffer, _global_port_buffer_offset + nframes -1);
|
||||
_resolve_required = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue