From 5d3cbd1f9f9f319c0a8f5c77b53f783076c8af8e Mon Sep 17 00:00:00 2001 From: Francois Best Date: Fri, 28 Oct 2016 09:13:06 +0200 Subject: [PATCH] #54: added overload of sendAfterTouch for poly. Deprecates sendPolyPressure. --- src/MIDI.h | 5 ++++- src/MIDI.hpp | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/MIDI.h b/src/MIDI.h index aa318cf..15fe359 100644 --- a/src/MIDI.h +++ b/src/MIDI.h @@ -79,10 +79,13 @@ public: inline void sendPolyPressure(DataByte inNoteNumber, DataByte inPressure, - Channel inChannel); + Channel inChannel) __attribute__ ((deprecated)); inline void sendAfterTouch(DataByte inPressure, Channel inChannel); + inline void sendAfterTouch(DataByte inNoteNumber, + DataByte inPressure, + Channel inChannel); inline void sendSysEx(unsigned inLength, const byte* inArray, diff --git a/src/MIDI.hpp b/src/MIDI.hpp index 57da760..57bdd32 100644 --- a/src/MIDI.hpp +++ b/src/MIDI.hpp @@ -251,6 +251,8 @@ void MidiInterface::sendControlChange(DataByte inControlNu \param inNoteNumber The note to apply AfterTouch to (0 to 127). \param inPressure The amount of AfterTouch to apply (0 to 127). \param inChannel The channel on which the message will be sent (1 to 16). + Note: this method is deprecated and will be removed in a future revision of the + library, @see sendAfterTouch to send polyphonic and monophonic AfterTouch messages. */ template void MidiInterface::sendPolyPressure(DataByte inNoteNumber, @@ -271,6 +273,20 @@ void MidiInterface::sendAfterTouch(DataByte inPressure, send(AfterTouchChannel, inPressure, 0, inChannel); } +/*! \brief Send a Polyphonic AfterTouch message (applies to a specified note) + \param inNoteNumber The note to apply AfterTouch to (0 to 127). + \param inPressure The amount of AfterTouch to apply (0 to 127). + \param inChannel The channel on which the message will be sent (1 to 16). + @see Replaces sendPolyPressure (which is now deprecated). + */ +template +void MidiInterface::sendAfterTouch(DataByte inNoteNumber, + DataByte inPressure, + Channel inChannel) +{ + send(AfterTouchPoly, inNoteNumber, inPressure, inChannel); +} + /*! \brief Send a Pitch Bend message using a signed integer value. \param inPitchValue The amount of bend to send (in a signed integer format), between MIDI_PITCHBEND_MIN and MIDI_PITCHBEND_MAX,