JAM
Posted: Mon Apr 20, 2020 4:13 am
I'm trying to figure out what value JAM makes the ramp LFO restart at (high or low), and if it differs between forward ramp to reverse ramp. I wrote the following code to test both ways using POT0 to set the ramp direction, but the ramp doesn't seem to "jam"...
skp RUN, START
wldr 1, 0, 4096
START:
ldax POT0
sof 1, -0.5 ;find halfway
skp NEG, REV
FWD:
sof 0, -0.05 ;slow fwd ramp
skp 0, DONE
REV:
sof 0, 0.05 ;slow rev ramp
DONE:
wrax RMP1_RATE, 0 ;set ramp direction (and speed)
jam RMP1 ;restart ramp
cho rdal, RMP1 ;read ramp (should be start of ramp each time)
sof 1.999, 0 ;scale 0.5 magnitude ramp to 1.0
wrax DACR, 0 ;output to test result
skp RUN, START
wldr 1, 0, 4096
START:
ldax POT0
sof 1, -0.5 ;find halfway
skp NEG, REV
FWD:
sof 0, -0.05 ;slow fwd ramp
skp 0, DONE
REV:
sof 0, 0.05 ;slow rev ramp
DONE:
wrax RMP1_RATE, 0 ;set ramp direction (and speed)
jam RMP1 ;restart ramp
cho rdal, RMP1 ;read ramp (should be start of ramp each time)
sof 1.999, 0 ;scale 0.5 magnitude ramp to 1.0
wrax DACR, 0 ;output to test result