summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_port.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-12-14 17:17:30 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-12-14 17:17:30 +0000
commit96585e532c879220057edd050806c823ed6e4c1d (patch)
treef476498ed64726e8196167cd278e35803da91ab0 /libs/ardour/midi_port.cc
parent60872a8504cccc0d7e6c2485af8c0362577f5723 (diff)
send sustain=off and all-notes-off when a MIDI track is muted (may fix #4295)
git-svn-id: svn://localhost/ardour2/branches/3.0@11005 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_port.cc')
-rw-r--r--libs/ardour/midi_port.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc
index 50d4ce64e8..9383bb237b 100644
--- a/libs/ardour/midi_port.cc
+++ b/libs/ardour/midi_port.cc
@@ -128,20 +128,16 @@ MidiPort::cycle_split ()
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] = { 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;
}
@@ -164,7 +160,7 @@ MidiPort::flush_buffers (pframes_t nframes, framepos_t /*time*/)
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) {