;@ ins k k
;@ outs k
opcode CtrlSend, 0, kkkkkk
  kCtrl, kVal, kCh, ksend, kvalue, kout xin

    kSend zkr ksend
    kValue zkr kvalue
    kOut init 0
    kSend trigger kSend, 0, 0

    kValue limit kVal + kValue * 127, 0, 127
    kTrig changed kValue, kSend
    if (kTrig == 0) goto Halt
    	midiout 176, kCh, kCtrl, kValue ; GENERIC CC MESSAGE
      kOut = 1
  Halt:
    zkw kOut, kout
    kOut = 0 ; reset after send
  endop
