summaryrefslogtreecommitdiff
path: root/libs/evoral
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2012-10-12 05:58:47 +0000
committerHans Baier <hansfbaier@googlemail.com>2012-10-12 05:58:47 +0000
commit2625fd9be8304646d77e4f870d0b00e795ce886c (patch)
tree91407f62ebdd20ade926c43c27d19cd8db3f2380 /libs/evoral
parent617d291d1bd8a89e4132fec04541e6ec77733829 (diff)
fix issue 0005120: dont treat percussive mode differently than sustained mode except in GUI. Leaving out all note offs crashes LinuxSampler and totally drowns my Yamaha PSR-S900 by stealing all its available voices. Code is #ifdef-ed out until a more thorough discussion would conclude the removal of percussive mode from the MIDI model, which IMHO makes sense. I don't see any virtue in leaving out note offs since it only creates problems.
git-svn-id: svn://localhost/ardour2/branches/3.0@13251 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral')
-rw-r--r--libs/evoral/src/Sequence.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp
index 1b5683320c..d26d9d0023 100644
--- a/libs/evoral/src/Sequence.cpp
+++ b/libs/evoral/src/Sequence.cpp
@@ -338,7 +338,11 @@ Sequence<Time>::const_iterator::operator++()
}
// Use the next note off iff it's earlier or the same time as the note on
+#ifdef PERCUSSIVE_IGNORE_NOTE_OFFS
if (!_seq->percussive() && (!_active_notes.empty())) {
+#else
+ if ((!_active_notes.empty())) {
+#endif
if (_type == NIL || _active_notes.top()->end_time() <= earliest_t) {
_type = NOTE_OFF;
earliest_t = _active_notes.top()->end_time();
@@ -636,8 +640,9 @@ Sequence<Time>::end_write (StuckNoteOption option, Time when)
DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1 : end_write (%2 notes) delete stuck option %3 @ %4\n", this, _notes.size(), option, when));
+ #ifdef PERCUSSIVE_IGNORE_NOTE_OFFS
if (!_percussive) {
-
+ #endif
for (typename Notes::iterator n = _notes.begin(); n != _notes.end() ;) {
typename Notes::iterator next = n;
++next;
@@ -665,7 +670,9 @@ Sequence<Time>::end_write (StuckNoteOption option, Time when)
n = next;
}
+ #ifdef PERCUSSIVE_IGNORE_NOTE_OFFS
}
+ #endif
for (int i = 0; i < 16; ++i) {
_write_notes[i].clear();
@@ -907,13 +914,20 @@ Sequence<Time>::append_note_on_unlocked (NotePtr note, event_id_t evid)
add_note_unlocked (note);
+ #ifdef PERCUSSIVE_IGNORE_NOTE_OFFS
if (!_percussive) {
+ #endif
+
DEBUG_TRACE (DEBUG::Sequence, string_compose ("Sustained: Appending active note on %1 channel %2\n",
(unsigned)(uint8_t)note->note(), note->channel()));
_write_notes[note->channel()].insert (note);
+
+ #ifdef PERCUSSIVE_IGNORE_NOTE_OFFS
} else {
DEBUG_TRACE(DEBUG::Sequence, "Percussive: NOT appending active note on\n");
}
+ #endif
+
}
template<typename Time>
@@ -936,10 +950,12 @@ Sequence<Time>::append_note_off_unlocked (NotePtr note)
_edited = true;
+ #ifdef PERCUSSIVE_IGNORE_NOTE_OFFS
if (_percussive) {
DEBUG_TRACE(DEBUG::Sequence, "Sequence Ignoring note off (percussive mode)\n");
return;
}
+ #endif
bool resolved = false;