From 8f5feec79f85025d5588798d739bd6b00f7bf812 Mon Sep 17 00:00:00 2001 From: "Andy Fillebrown (OSX)" Date: Mon, 1 Jun 2015 23:15:09 -0400 Subject: [PATCH] Fix MIDI pitch bend bug causing wrong bytes to be sent to Csound. --- Source/Plugin/CabbagePluginProcessor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Plugin/CabbagePluginProcessor.cpp b/Source/Plugin/CabbagePluginProcessor.cpp index 1aa1731..b9322fd 100644 --- a/Source/Plugin/CabbagePluginProcessor.cpp +++ b/Source/Plugin/CabbagePluginProcessor.cpp @@ -2130,8 +2130,10 @@ int CabbagePluginAudioProcessor::ReadMidiData(CSOUND* /*csound*/, void *userData } else if(message.isPitchWheel()) { + const int pitch_bend = message.getPitchWheelValue(); *mbuf++ = (unsigned char)0xE0 + message.getChannel()-1; - *mbuf++ = (unsigned char)message.getPitchWheelValue(); + *mbuf++ = (unsigned char)(pitch_bend & 0xFF); + *mbuf++ = (unsigned char)((pitch_bend >> 8) & 0xFF); cnt += 3; } -- 1.8.4.2