From f1123a8475a1e5997f9af50aff616c456e153442 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 17 Oct 2013 16:54:05 -0700 Subject: [PATCH] cmDspBuiltIn.c : Addded 'reset' input to cmDspMidiOut to implement all-notes-off. --- dsp/cmDspBuiltIn.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dsp/cmDspBuiltIn.c b/dsp/cmDspBuiltIn.c index 133f951..066675a 100644 --- a/dsp/cmDspBuiltIn.c +++ b/dsp/cmDspBuiltIn.c @@ -1092,7 +1092,8 @@ enum kPortMoId, kStatusMoId, kD0MoId, - kD1MoId + kD1MoId, + kResetMoId }; cmDspClass_t _cmMidiOutDC; @@ -1142,6 +1143,7 @@ cmDspInst_t* _cmDspMidiOutAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsign { "status", kStatusMoId, 0, 0, kInDsvFl | kUIntDsvFl, "MIDI status" }, { "d0", kD0MoId, 0, 0, kInDsvFl | kUIntDsvFl, "MIDI channel message d0" }, { "d1", kD1MoId, 0, 0, kInDsvFl | kUIntDsvFl, "MIDI channel message d1" }, + { "reset", kResetMoId, 0, 0, kInDsvFl | kTypeDsvMask,"All notes off" }, { NULL, 0, 0, 0, 0 } }; @@ -1195,6 +1197,19 @@ cmDspRC_t _cmDspMidiOutRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t } break; + case kResetMoId: + { + unsigned i; + + for(i=0; idevIdx,p->portIdx,kCtlMdId,121,0); // reset all controllers + cmMpDeviceSend(p->devIdx,p->portIdx,kCtlMdId,123,0); // turn all notes off + cmSleepMs(15); + } + } + break; + default: cmDspSetEvent(ctx,inst,evt); break;