;GA_DEMO Echo;Pot0 = Reverb level;Pot1 = delay;pot2 = Echo level;memory declarations:mem edel 20000mem ap1 334mem ap2 556mem ap3 871mem lap1a 808mem lap1b 1934mem d1 2489mem lap2a 1016mem lap2b 1787mem d2 2287;register equates:equ mono reg0equ apout reg1equ lp1 reg2equ lp2 reg3equ revout reg4equ dout reg5equ dx reg6equ efil reg7;declare constants:equ kap 0.6 ;all pass coefficientequ krt 0.55 ;reverb timeequ krf 0.5 ;reverb lpf freqequ krs -0.6 ;reverb lpf shelfequ fbk 0;clear registers and initialize LFOs:skp run,endclrwrax lp1,0wrax lp2,0wrax efil,0wlds sin0,12,100endclr:;sum inputs to mono:rdax adcl,0.5rdax adcr,0.5wrax mono,0 rdax dout,fbkrdax mono,1wra edel,0;do reverb and put result in revout (after pot0 control):rdax mono,0.5rdax dx,0.5rda ap1#,kapwrap ap1,-kaprda ap2#,kapwrap ap2,-kaprda ap3#,kapwrap ap3,-kapwrax apout,0rda d2#,krtrdax apout,1rda lap1a#,kapwrap lap1a,-kaprda lap1b#,kapwrap lap1b,-kaprdfx lp1,krfwrlx lp1,krswra d1,0rda d1#,krtrdax apout,1rda lap2a#,kapwrap lap2a,-kaprda lap2b#,kapwrap lap2b,-kaprdfx lp2,krfwrlx lp2,krswra d2,1.99rda d1,1.99mulx pot0mulx pot0wrax revout,0;smooth reverb:cho rda,sin0,sin|reg|compc,lap1b+100cho rda,sin0,sin,lap1b+101wra lap1b+200,0cho rda,sin0,sin|reg|compc,lap2b+100cho rda,sin0,sin,lap2b+101wra lap2b+200,0;now get delay output, controlled by pot1:rdax pot1,1and %01111110_00000000_00000000 ;10mS incrementssof 0.55,0.05 ;range 50mS to 600mSwrax addr_ptr,0 ;write address pointerrmpa 1 ;read pointerrdfx efil,0.3wrlx efil,-1wrax dout,1mulx pot2 ;adjust level with pot2mulx pot2 ;square functionwrax dx,1 ;write level adjusted delay outrdax mono,1 ;pass inputrdax revout,1 ;add reverbsof 1,0.02wrax dacl,1sof 1,-0.04wrax dacr,0