implement muffling setter
[software/lv2-mdametapiano.git] / src / mdaPiano.cpp
index 9912c7569b5dfcf1cb4dfdcca0843595c586ff3b..a0154396dc1253a9cbf232c019244891b540bbce 100644 (file)
@@ -98,8 +98,13 @@ void mdaPiano::handle_midi(uint32_t size, unsigned char* data) {
       {
         case 0x01:  //mod wheel
         case 0x43:  //soft pedal
-          muff = 0.01f * (float)((127 - data[2]) * (127 - data[2]));
-          break;
+          {
+            float muff = 0.01f * (float)((127 - data[2]) * (127 - data[2]));
+            for (unsigned i = 0; i < NVOICES; ++i) {
+              voices[i]->set_muff(muff);
+            }
+            break;
+          }
 
         case 0x07:  //volume
           setVolume(0.00002f * (float)(data[2] * data[2]));