// 3 byte pedal press for gesture. // Written by Steven Caldwell // 21-Oct-2019 - Fixed to accommodate Note off 0x80 with velocity 0x7F as a note release. // determine control gc=pp // determine MIDI Channel gb=oo&15 // Look for note-on or note off rr=oo&224 if rr==128 then ga=1 if rr==128 then Goto "note" // Look for CC rr=oo&176 if rr==176 then ga=2 if rr==176 then Goto "cc" Label "cc" // Press counter if qq>0 then gd=gd+1 // Release Counter if qq==0 then ge=ge+1 Goto "done" Label "note" rr=oo&240 rr=rr>>4 // increment down counter // if velocity is 0, then must be note off if qq==0 then skip next 2 rules // note off if rr==8 then skip next rule gd=gd+1 // increment up counter (note off) // If 8 or 9 with velocity 0 // Zero velocity is always note off if qq==0 then ge=ge+1 // if velocity 0, then don't do it again if qq==0 then skip next rule // must be 8 with velocity > 0, also note off (AKA APC MINI) // APC MINI sents not off with velocity 7F for up if rr==8 then ge=ge+1 Label "done"