I'm trying to use a single ramp/lfo to do 2 different pitch shifts. However its not working....
The code uses ramp0 to shift an input by POT0 up or down, it then puts that into REG2
Then it "re REG's" ramp0 to shift the input value again up or down, but this time with ramp0 frequency half of the POT0 value.
This value is then added to REG2 and outputted. The goal is to have an up or down pitch shift but with an additional half-shift mixed in.
What happens when I try to introduce the second shifting, the entire effect is killed and its just audio in is output to audio out, if I take out the code with the second shifting it works as normal, IE pot0 shifts the input up and down
I know I could use ramp1 to accomplish this, but I'm REALLY hoping I can do so without. Thanks all.
My code:
; do next command only once
SKP RUN ,1
; Load RAMP generator with initial conditions
WLDR 0, 32767, 512
; read right channel input into ACC
LDAX ADCR
; Write ACC to delay memory location
WRA 0, 0.0
; Read register value, multiply by coefficient and add to ACC.
RDAX POT0, 1.0
; Multiply ACC by the coefficient value and add a constant (Scale and OFfset)
SOF 1.0, -0.5
; If ACC >= 0, skip the ACC*0.5 instruction
SKP GEZ,1
SOF 0.5, 0.0
; Write ACC to register, multiply ACC by coefficient
WRAX RMP0_RATE, 0
CHO RDA,2,REG | COMPC,0
CHO RDA,2,0,1
WRA 513,0.0
CHO RDA,2,COMPC | RPTR2,0
CHO RDA,2,RPTR2,1
CHO SOF,2,COMPC | NA,0.0
CHO RDA,2,NA,513
; Multiply ACC by the coefficient value and add a constant (Scale and OFfset)
SOF 0.5, 0
;Write ACC to register, multiply ACC by coefficient
WRAX REG2, 0
; Read register value, multiply by coefficient and add to ACC.
RDAX RMP0_RATE, 0.5, 0 ; THIS NO WORK
; Write ACC to register, multiply ACC by coefficient
WRAX RMP0_RATE, 0.0 ; THIS NO WORK
; new shift, does not work. Entire shifting stops and its just audio in = audio out
CHO RDA, 2, REG | COMPC, 0
CHO RDA, 2,0, 1
WRA 4097, 0.0
CHO RDA, 2, COMPC | RPTR2, 0
CHO RDA, 2, RPTR2,1
CHO SOF, 2, COMPC | NA, 0.0
CHO RDA, 2, NA,4097
; Multiply ACC by the coefficient value and add a constant (Scale and OFfset)
SOF 0.5, 0
;; Read register value, multiply by coefficient and add to ACC.
RDAX REG2, 1
; Write ACC to register, multiply ACC by coefficient
WRAX DACR,0.0000000000