summaryrefslogtreecommitdiff
path: root/libs/evoral
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-08-18 09:44:20 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-08-19 08:32:44 -0400
commitd6691a80e97ba6edf0d324f24a64cae581575a95 (patch)
tree9f0cddbda3586606ba3633ca04c38784becc17a6 /libs/evoral
parentc229e31720013e5147efe2929204faee476bfe2d (diff)
attempt to handle poly-pressure (polyphonic aftertouch) similarly to other MIDI messages
Diffstat (limited to 'libs/evoral')
-rw-r--r--libs/evoral/evoral/MIDIEvent.hpp7
-rw-r--r--libs/evoral/src/SMF.cpp1
-rw-r--r--libs/evoral/src/Sequence.cpp2
3 files changed, 7 insertions, 3 deletions
diff --git a/libs/evoral/evoral/MIDIEvent.hpp b/libs/evoral/evoral/MIDIEvent.hpp
index 00e8577cda..1ce7074788 100644
--- a/libs/evoral/evoral/MIDIEvent.hpp
+++ b/libs/evoral/evoral/MIDIEvent.hpp
@@ -71,7 +71,7 @@ public:
inline bool is_pitch_bender() const { return (type() == MIDI_CMD_BENDER); }
inline bool is_pgm_change() const { return (type() == MIDI_CMD_PGM_CHANGE); }
inline bool is_note() const { return (is_note_on() || is_note_off()); }
- inline bool is_aftertouch() const { return (type() == MIDI_CMD_NOTE_PRESSURE); }
+ inline bool is_poly_pressure() const { return (type() == MIDI_CMD_NOTE_PRESSURE); }
inline bool is_channel_pressure() const { return (type() == MIDI_CMD_CHANNEL_PRESSURE); }
inline uint8_t note() const { return (this->_buf[1]); }
inline void set_note(uint8_t n) { this->_buf[1] = n; }
@@ -92,7 +92,8 @@ public:
| (0x7F & this->_buf[1]) ); }
inline uint8_t pgm_number() const { return (this->_buf[1]); }
inline void set_pgm_number(uint8_t number) { this->_buf[1] = number; }
- inline uint8_t aftertouch() const { return (this->_buf[1]); }
+ inline uint8_t poly_note() const { return (this->_buf[1]); }
+ inline uint8_t poly_pressure() const { return (this->_buf[2]); }
inline uint8_t channel_pressure() const { return (this->_buf[1]); }
inline bool is_channel_event() const { return (0x80 <= type()) && (type() <= 0xE0); }
inline bool is_smf_meta_event() const { return this->_buf[0] == 0xFF; }
@@ -112,7 +113,7 @@ public:
case MIDI_CMD_BENDER:
return pitch_bender_value();
case MIDI_CMD_NOTE_PRESSURE:
- return aftertouch();
+ return poly_pressure();
case MIDI_CMD_CHANNEL_PRESSURE:
return channel_pressure();
default:
diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp
index 45109b50e5..65304c4e4d 100644
--- a/libs/evoral/src/SMF.cpp
+++ b/libs/evoral/src/SMF.cpp
@@ -338,6 +338,7 @@ SMF::append_event_delta(uint32_t delta_t, uint32_t size, const uint8_t* buf, eve
bool const store_id = (
c == MIDI_CMD_NOTE_ON ||
c == MIDI_CMD_NOTE_OFF ||
+ c == MIDI_CMD_NOTE_PRESSURE ||
c == MIDI_CMD_PGM_CHANGE ||
(c == MIDI_CMD_CONTROL && (buf[1] == MIDI_CTL_MSB_BANK || buf[1] == MIDI_CTL_LSB_BANK))
);
diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp
index 19a0fb1409..c578a9ebec 100644
--- a/libs/evoral/src/Sequence.cpp
+++ b/libs/evoral/src/Sequence.cpp
@@ -933,6 +933,8 @@ Sequence<Time>::append(const Event<Time>& event, event_id_t evid)
ev.time(), double ((0x7F & ev.pitch_bender_msb()) << 7
| (0x7F & ev.pitch_bender_lsb())),
evid);
+ } else if (ev.is_poly_pressure()) {
+ append_control_unlocked (Parameter (ev.event_type(), ev.channel(), ev.poly_note()), ev.time(), ev.poly_pressure(), evid);
} else if (ev.is_channel_pressure()) {
append_control_unlocked(
Parameter(ev.event_type(), ev.channel()),