;@ map d CLA001
;@ map s 3 PANLOG PANLIN
;@ map d BUT002

;@ ins k k
;@ outs k k
opcode Pan, 0, kkkkkkk
  kmod,kPan,kLogLin, kin,kmodin,koutL,koutR xin
  kIn zkr kin
  kMod zkr kmodin

  kM = kmod * kMod * 1/64

; DON'T FORGET TO MAKE 103 and 104 TABLES>>
  if kLogLin != 0 goto Next
    kPL table kPan+kM, 103, 1
    kPR table (1-kPan-kM), 103, 1
    goto Over
  Next:
    kPL table kPan+kM, 104, 1
    kPR table (1-kPan-kM), 104, 1
  Over:

  kL = kPL * kIn
  kR = kPR * kIn

  zkw kL, koutL
  zkw kR, koutR
endop
