


;----------------------------------------
;  Announce Voice
;
;
; PORT0 : 0-126 : DJ
;	    127 : ANN 
;		     
; PORT1 : ANN NUMBER (0-28)
;
;
; PORT7 : STACK WORK
; PORT6 : MODE NUMBER (0xff: STOP 0x00: Player
;		       0x01: D.J. 0x02: Ann)	
; PORT5 : HOLD MODE (RACE:00 OTHER:01)
;----------------------------------------

_VOICE_SE
    Bmode
;  		     pause,mono,pri,trs, pan,pow,fxmix,line
    multiparamset,    $00 ,$01, 15 , 0 , 64, 0,  0 ,  1

;   monomode,3	;	Sub limit + note mono
;   fxline,1	;Environment sound.
;   span,64
;   spanpow,0	;Change with span ?
;   strans,0
;   bankchg,BANK_VOICE
;   prg,	PRG_PERCUSSION
;   priority,14

   panmode,1
   evolume,127
   svolume,127

   sr_load,#$ff
   sr_portwrite,PORT6		;Reset Mode

;   allocvoice,1	

@_openwait
  waith,6
   sr_portread ,PORT0
   brN,@_openwait
;   allocvoice,1	
@_restart
   sr_portwrite,PORT7		;stack push
   sr_sbc,#126
   jump0,@_VSLAP_VOICE
   jumpP,@_ANN_VOICE		;if PORT0==127 this is ann voice.
   bprg,BANK_DJ,127	
;
;  Race or Other. (Fx Change.)
;
   sr_portread,PORT5 
   br0,@_RaceFx
@_MenuFx
   fxmix,16
   bra,@_FxExit
@_RaceFx    
   fxmix,60
@_FxExit

;------------------------------------ PlayerVoice Moved to plvoice.se 
;   sr_portread,PORT7
;   sr_sbc,#120
;   brN,@_DJMODESET
;@_PLAYERMODESET
;   sr_portread,PORT6
;   brN,@_PSET			;Free,You Can overray.
;   br0,@_PSET			;Player Voice,You Can overray.
;   bra,@_now_on			;1 or 2... Not on...
;@_PSET
;   sr_load,#00
;   bra,@_modeset
;@_DJMODESET
;------------------------------------ PlayerVoice Moved to plvoice.se 

   sr_load,#01
@_modeset
   sr_portwrite,PORT6

@_playstart
   sr_portread,PORT7		;stack pull   
   sr_store,0,@_Note(+1)
;   sr_portread ,PORT5
;   sr_store,0,@_Note(+3)	; PORT 5:Velocity 
   opennote, 0,@_Note_L
;  opennote, 1,@_Note_R

@_now_on
   waith,6
   chknote,0
   br0,@_check_int
@_stop
;   deallocvoice
   sr_load,#$ff			;Mode free
   sr_portwrite,PORT6
   bra,@_openwait   
@_check_int
   sr_portread, PORT0
   brN,@_now_on
   bra,@_restart	  




@_ANN_VOICE
   bprg,BANK_ANA,PRG_PERCUSSION
   fxmix,60
   sr_load,#$02
   sr_portwrite,PORT6		;Ann Mode Set.

   sr_portread,PORT1		; Annouce Number.	
   sr_portwrite,PORT7		;push
   sr_sbc,#26
   jumpP,@_AN_DACMODE
   sr_portread,PORT7		;pull
   sr_sbc,#16
   jumpP,@_AN_DEMO

@_AN_NORMAL
   bra,@_playstart      


;----------------------------  DAC MODE : PAN MOVE. 

@_AN_DACMODE			;Come 0,1,2
   tblset,@_DAC_TABLE
   sr_tblnopen,0
   wait,100
   bra,@_now_on

@_DAC_TABLE
#label @__STEREO,@__PHONE,@__NULL,@__MONO

@__STEREO
   killpan
   tieon 	
   npan,32
   bn2b0, 60,127,0		;Velo 127,Gate Max 
   npan,96
   bn2b0, 120,127,0		;Velo 127,Gate Max 
   fin

@__PHONE
   killpan
   tieon 	
   npan,32
   cn3b0w, 60,127,0		;Velo 127,Gate Max 
   npan,64
   cn3b0w, 30,127,0		;Velo 127,Gate Max 
   npan,96
   cn3b0w, 120,127,0		;Velo 127,Gate Max 
   fin

@__MONO
   killpan
   npan,64
   cs3b0w, 100,127,0		;Velo 127,Gate Max 
@__NULL
   fin
   


;----------------------------	DEMO "Welcome to" + " place "

@_AN_DEMO
  sr_load,#16
   sr_store,0,@_Note(+1)
   waitw,140
   closenote,0
   opennote, 0,@_Note_L
;   opennote, 1,@_Note_R
   waitw,135
   sr_portread,PORT7
   sr_store,1,@_Note(+1)
   opennote, 0,@_Note_L
;   opennote, 1,@_Note_R
   jump,@_now_on     

;----------------------------	Note


;@_Note_R
;   npan,96
;   bra,@_Note
@_Note_L
   npan,64
@_Note
   ntrans,0			;0-127 offset	
   killpan			;Ignore Percussion Pan
   p00b0w, 1200,127,0		;Velo 127,Gate Max 
   fin


@_VSLAP_VOICE
   bprg,BANK_VSVOICE,PRG_PERCUSSION
   fxmix,60
   sr_load,#$01
   sr_portwrite,PORT6		;VSLAP Mode Set.

   sr_portread,PORT2		;VS LAP FLAG.	
   br0,@_VSLAP_Direct
   sr_store,$ff,@_VsNote_3	;behine=0,ahead=1
   sr_portread,PORT1
   sr_store,  0,@_VsNote_2
   sr_extbl,@_VSSECTABLE
   sr_store,  0,@_VSLAP_SecWait2(+1);
   opennote,0,@_VsNote_1
   call @_VSLAP_Wait
   opennote,0,@_VsNote_2
   call @_VSLAP_SecWait
   bra,@_VSLAP_Exit
 
@_VSLAP_Direct
   sr_portread,PORT1
   sr_store,0,@_VsNote_3
@_VSLAP_Exit
   opennote,0,@_VsNote_3
   call ,@_VSLAP_Wait
   jump,@_openwait


@_VSLAP_SecWait
   wait,50
@_VSLAP_SecWait2
   wait,0
   fin
      

@_VSSECTABLE
#byte 0,0
#byte 5,10,20,30,0,20,0,20,20
#byte 30,20,50,50,55,65,75,50,75
   

@_VSLAP_Wait
   waith,8	
   chknote,0
   br0,@_VSLAP_Wait
   fin

@_VsNote_1
   p00b0(+20),100,127,0
   fin	

@_VsNote_2
   p00b0,110,127,0
   fin
  
@_VsNote_3
   p00b0w,400,127,0
   fin
   
