Stereo Panner Code
Posted: Sat Mar 23, 2013 9:04 pm
Fired up my dev board tonight, and "wrote" my first program. I took the Trem/Reverb from the ROM and stripped the reverb, made it stereo and drove channel 2 using an inverted LFO to make a stereo I/O panner.
Code: Select all
;Stereo Panner
;pot0 =
;pot1 = trem rate
;pot2 = trem depth
;
equ sigin reg1
equ trem reg2
equ tremr reg3
;
;set up lfo for reverb and tremelo, 0.5Hz, +/-20 samples:
skp RUN, start
wlds SIN1, 12, 32767
start:
;control and get tremelo sinwave:
rdax pot1, 1.0
mulx pot1
sof 0.4, 0.1 ; 5:1 range
wrax sin1_rate, 0
cho RDAL,SIN1
mulx pot2
sof 0.5, 0.5
wrax trem, -1
sof -1.0, .999
wrax tremr, 0
;
;do tremelo
rdax adcl, 1
mulx trem
wrax dacl, 0
;
rdax adcr, 1
mulx tremr
wrax dacr, 0