summaryrefslogtreecommitdiff
path: root/libs/evoral
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-11-27 17:25:42 +0100
committerRobin Gareus <robin@gareus.org>2016-11-27 17:25:42 +0100
commit2f30d763edafb1075c9f07f8bedf3af9d3adc13e (patch)
tree0ef6ba4695e4af2a66911a821b5dd8a0952a5cf4 /libs/evoral
parent9bf4f339b945b519e72de9370d8a542a51458d39 (diff)
Fix loading, recording & saving MIDI with PolyKeyPressure events.
GUI still does not handle this (neither automation lane, nor List Editor), but the file loads, plays and exports correctly.
Diffstat (limited to 'libs/evoral')
-rw-r--r--libs/evoral/src/Sequence.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp
index 283ea009a3..1d518c3f07 100644
--- a/libs/evoral/src/Sequence.cpp
+++ b/libs/evoral/src/Sequence.cpp
@@ -337,6 +337,7 @@ Sequence<Time>::const_iterator::operator++()
|| ev.is_pgm_change()
|| ev.is_pitch_bender()
|| ev.is_channel_pressure()
+ || ev.is_poly_pressure()
|| ev.is_sysex()) ) {
cerr << "WARNING: Unknown event (type " << _type << "): " << hex
<< int(ev.buffer()[0]) << int(ev.buffer()[1]) << int(ev.buffer()[2]) << endl;
@@ -573,6 +574,19 @@ Sequence<Time>::control_to_midi_event(
ev->buffer()[2] = (uint16_t(iter.y) >> 7) & 0x7F; // MSB
break;
+ case MIDI_CMD_NOTE_PRESSURE:
+ assert(iter.list.get());
+ assert(iter.list->parameter().channel() < 16);
+ assert(iter.list->parameter().id() <= INT8_MAX);
+ assert(iter.y <= INT8_MAX);
+
+ ev->set_time(Time(iter.x));
+ ev->realloc(3);
+ ev->buffer()[0] = MIDI_CMD_NOTE_PRESSURE + iter.list->parameter().channel();
+ ev->buffer()[1] = (uint8_t)iter.list->parameter().id();
+ ev->buffer()[2] = (uint8_t)iter.y;
+ break;
+
case MIDI_CMD_CHANNEL_PRESSURE:
assert(iter.list.get());
assert(iter.list->parameter().channel() < 16);