Browse Source

cmDspBuiltIn.c : Addded 'reset' input to cmDspMidiOut to implement all-notes-off.

master
kevin 11 years ago
parent
commit
f1123a8475
1 changed files with 16 additions and 1 deletions
  1. 16
    1
      dsp/cmDspBuiltIn.c

+ 16
- 1
dsp/cmDspBuiltIn.c View File

1092
   kPortMoId,
1092
   kPortMoId,
1093
   kStatusMoId,
1093
   kStatusMoId,
1094
   kD0MoId,
1094
   kD0MoId,
1095
-  kD1MoId
1095
+  kD1MoId,
1096
+  kResetMoId
1096
 };
1097
 };
1097
 
1098
 
1098
 cmDspClass_t _cmMidiOutDC;
1099
 cmDspClass_t _cmMidiOutDC;
1142
     { "status", kStatusMoId, 0,  0,  kInDsvFl | kUIntDsvFl, "MIDI status" },
1143
     { "status", kStatusMoId, 0,  0,  kInDsvFl | kUIntDsvFl, "MIDI status" },
1143
     { "d0",     kD0MoId,     0,  0,  kInDsvFl | kUIntDsvFl, "MIDI channel message d0" },
1144
     { "d0",     kD0MoId,     0,  0,  kInDsvFl | kUIntDsvFl, "MIDI channel message d0" },
1144
     { "d1",     kD1MoId,     0,  0,  kInDsvFl | kUIntDsvFl, "MIDI channel message d1" },
1145
     { "d1",     kD1MoId,     0,  0,  kInDsvFl | kUIntDsvFl, "MIDI channel message d1" },
1146
+    { "reset",  kResetMoId,  0,  0,  kInDsvFl | kTypeDsvMask,"All notes off" },
1145
     { NULL, 0, 0, 0, 0 }
1147
     { NULL, 0, 0, 0, 0 }
1146
   };
1148
   };
1147
 
1149
 
1195
       }
1197
       }
1196
       break;
1198
       break;
1197
 
1199
 
1200
+    case kResetMoId:
1201
+      {
1202
+        unsigned i;
1203
+        
1204
+        for(i=0; i<kMidiChCnt; ++i)
1205
+        {          
1206
+          cmMpDeviceSend(p->devIdx,p->portIdx,kCtlMdId,121,0); // reset all controllers
1207
+          cmMpDeviceSend(p->devIdx,p->portIdx,kCtlMdId,123,0); // turn all notes off
1208
+          cmSleepMs(15);
1209
+        }
1210
+      }
1211
+      break;
1212
+
1198
     default:
1213
     default:
1199
       cmDspSetEvent(ctx,inst,evt);
1214
       cmDspSetEvent(ctx,inst,evt);
1200
       break;
1215
       break;

Loading…
Cancel
Save