;@ map MIXPAN

;@ ins k k
;@ outs k k
opcode Fade1, 0, kkkkkk
  kPan,kmod,kin,kmodin,koutL,koutR xin
  kIn zkr kin
  kMod zkr kmodin

  kM = kmod * kMod ;* 1/64

  kPL table kPan + kM, giMIXPAN
  kPR table 127 - kPan - kM, giMIXPAN

  kL = kPL * kIn
  kR = kPR * kIn

  zkw kL, koutL
  zkw kR, koutR
endop

;@ ins a a
;@ outs a a
opcode Fade1, 0, kkkkkk
  kPan,kmod,kin,kmodin,koutL,koutR xin
  aIn zar kin
  aMod zar kmodin

  aM = kmod * aMod ;* 1/64

  aPL table kPan + aM, giMIXPAN
  aPR table 127 - kPan - aM, giMIXPAN

  aL = aPL * aIn
  aR = aPR * aIn

  zaw aL, koutL
  zaw aR, koutR
endop
