;@ map AMPEXP CLA001 AMPEXP
;@ map BUT003

;@ ins k k k k k k k k k
;@ outs k
opcode Mix81B, 0, kkkkkkkkkkkkkkkkkkkk
	kLev1,kLev2,kLev3,kLev4,kLev5,kLev6,kLev7,kLev8,kEL,kpad,ki1,ki2,ki3,ki4,ki5,ki6,ki7,ki8,kic,ko xin
	k1 zkr ki1
	k2 zkr ki2
	k3 zkr ki3
	k4 zkr ki4
	k5 zkr ki5
	k6 zkr ki6
	k7 zkr ki7
	k8 zkr ki8
	k9 zkr kic

	; Pad =				0, -6, -12 dB
	kP[] fillarray 1,0.5,0.25

	if kmod == 1 goto Out
		kLev1 table kLev1, giAMPEXP
		kLev2 table kLev2, giAMPEXP
		kLev3 table kLev3, giAMPEXP
		kLev4 table kLev4, giAMPEXP
		kLev5 table kLev5, giAMPEXP
		kLev6 table kLev6, giAMPEXP
		kLev7 table kLev7, giAMPEXP
		kLev8 table kLev8, giAMPEXP
		goto Next
	Out:
		kLev1 table kLev1, giCLA001
		kLev2 table kLev2, giCLA001
		kLev3 table kLev3, giCLA001
		kLev4 table kLev4, giCLA001
		kLev5 table kLev5, giCLA001
		kLev6 table kLev6, giCLA001
		kLev7 table kLev7, giCLA001
		kLev8 table kLev8, giCLA001
	Next:
	kout = k9 + (k1*kLev1+k2*kLev2+k3*kLev3+k4*kLev4+k5*kLev5+k6*kLev6+k7*kLev7+k8*kLev8)*kP[kpad]
	kout limit kout, -4, 4
	zkw kout, ko
endop

;@ ins a a a a a a a a a
;@ outs a
opcode Mix81B, 0, kkkkkkkkkkkkkkkkkkkk
	kLev1,kLev2,kLev3,kLev4,kLev5,kLev6,kLev7,kLev8,kmod,kpad,ki1,ki2,ki3,ki4,ki5,ki6,ki7,ki8,kic,ko xin
	a1 zar ki1
	a2 zar ki2
	a3 zar ki3
	a4 zar ki4
	a5 zar ki5
	a6 zar ki6
	a7 zar ki7
	a8 zar ki8
	a9 zar kic

	; Pad =				0, -6, -12 dB
	kP[] fillarray 1,0.5,0.25

	if kmod == 1 goto Out
		kLev1 table kLev1, giAMPEXP
		kLev2 table kLev2, giAMPEXP
		kLev3 table kLev3, giAMPEXP
		kLev4 table kLev4, giAMPEXP
		kLev5 table kLev5, giAMPEXP
		kLev6 table kLev6, giAMPEXP
		kLev7 table kLev7, giAMPEXP
		kLev8 table kLev8, giAMPEXP
		goto Next
	Out:
		kLev1 table kLev1, giCLA001
		kLev2 table kLev2, giCLA001
		kLev3 table kLev3, giCLA001
		kLev4 table kLev4, giCLA001
		kLev5 table kLev5, giCLA001
		kLev6 table kLev6, giCLA001
		kLev7 table kLev7, giCLA001
		kLev8 table kLev8, giCLA001
	Next:
	aout = a9 + (a1*kLev1+a2*kLev2+a3*kLev3+a4*kLev4+a5*kLev5+a6*kLev6+a7*kLev7+a8*kLev8)*kP[kpad]
	aout limit aout, -4, 4
	zaw aout, ko
endop
