Need a 3th RAMP LFO for sample interpolation
Posted: Sat Dec 27, 2008 5:14 am
Hi,
I want to interpolate between two samples (bulding a continously varying delay). Best way should be using the RAMP LFO. At my application I need a 3th Delay and the two RAMP LFOs and SIN LFOs are already blocked for Delay 1&2. I found at in the OEM1_6Flanger a part, wich do the interpolation "diskret". But this programm needs 31 operations (of 128); thats to much !!!
Questions:
Is there another way for sample interpolation ?
How do the calc. for the pointer works (in both ways, using RAMP or diskret)
This is my example:
equ temp reg0 ;temp. Register
equ sample1 reg1
equ sample2 reg2
equ X_Fade reg3
Delay mem 32767 ;DelayLine
skp RUN,START
wldr rmp0,0,4096 ;DelayMemory=4096->max 125ms
wlds sin1,0,0
START:
ldax adcl
wra Delay,0
rdax pot0,0.5 ;read pot0 and scale to 0...0.5
wrax temp,0 ;save it, clear the ACC
;--------------------------------------------------------------------------------------
;calc. the Pointer - it works but i dont' know why
;--------------------------------------------------------------------------------------
cho rdal,rmp0 ;
rdax temp,-1 ;????
wrax rmp0_rate,0 ;
;--------------------------------------------------------------------------------------
;Use Chorus-Fuction and RAMP0-LFO as sample interpolator
;--------------------------------------------------------------------------------------
cho rda,rmp0,reg|compc,Delay ;Sample from Delay1 read,
cho rda,rmp0,0,Delay+1 ;Interpol. with Sample Delay+1
wrax dacr,0 ;output right, and clear ACC
;--------------------------------------------------------------------------------------
;Using SIN-LFO for interpolation. the next 5 lines do the same as above, ;but
;produce "glitches" when rotation the pot0 - why ????
;--------------------------------------------------------------------------------------
;rdax temp,1
;wrax sin1_range,0
;cho rda,sin1,cos|reg|compc,Delay
;cho rda,sin1,cos,Delay+1
;wrax dacl,0
;--------------------------------------------------------------------------------------
;found the following code in the OEM-Flanger,
;It makes sample interpolation without the CHO instruction
;produce also "glitches" when rotation the pot0 - why ????
;--------------------------------------------------------------------------------------
rdax temp,0.25 ;pot0 value, scale it cause addr_ptr ist 32768
;samples wide
;now pot0 produce a value from 0...0.125 =
;0....4096 samples
wrax addr_ptr,0 ;put into Addr_ptr
rmpa 1 ;read the sample
wrax sample1,0 ;save it, and clear ACC
or %00000000_00000001_00000000 ;put 1 into to ACC
rdax temp,0.25 ;add pot0 value
wrax addr_ptr,0 ;put into Addr_ptr
rmpa 1 ;read the next sample
wrax sample2,0 ;store it
;now derive an interpolation coefficient from LSBs of pointer:
rdax temp,0.25 ;the pot value
and %00000000_00000000_11111111 ;dont'know exactly what
;happens here, thing it blank out the
;"integer-part"
sof -2,0 ;this looks like a shifter,
sof -2,0 ;14 Bits
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof 1.9999,0 ;one more Bit ???
wrax X_Fade,0 ;store the X-Fade coefficient
;now interpolate between the two adjacent delay taps:
rdax sample2,1
rdax sample1,-1
mulx X_Fade ;crossfade with interpolation
rdax sample1,1
wrax dacl,0 ;Do you hear the glitches ???
;------ ENDE --------
I want to interpolate between two samples (bulding a continously varying delay). Best way should be using the RAMP LFO. At my application I need a 3th Delay and the two RAMP LFOs and SIN LFOs are already blocked for Delay 1&2. I found at in the OEM1_6Flanger a part, wich do the interpolation "diskret". But this programm needs 31 operations (of 128); thats to much !!!
Questions:
Is there another way for sample interpolation ?
How do the calc. for the pointer works (in both ways, using RAMP or diskret)
This is my example:
equ temp reg0 ;temp. Register
equ sample1 reg1
equ sample2 reg2
equ X_Fade reg3
Delay mem 32767 ;DelayLine
skp RUN,START
wldr rmp0,0,4096 ;DelayMemory=4096->max 125ms
wlds sin1,0,0
START:
ldax adcl
wra Delay,0
rdax pot0,0.5 ;read pot0 and scale to 0...0.5
wrax temp,0 ;save it, clear the ACC
;--------------------------------------------------------------------------------------
;calc. the Pointer - it works but i dont' know why
;--------------------------------------------------------------------------------------
cho rdal,rmp0 ;
rdax temp,-1 ;????
wrax rmp0_rate,0 ;
;--------------------------------------------------------------------------------------
;Use Chorus-Fuction and RAMP0-LFO as sample interpolator
;--------------------------------------------------------------------------------------
cho rda,rmp0,reg|compc,Delay ;Sample from Delay1 read,
cho rda,rmp0,0,Delay+1 ;Interpol. with Sample Delay+1
wrax dacr,0 ;output right, and clear ACC
;--------------------------------------------------------------------------------------
;Using SIN-LFO for interpolation. the next 5 lines do the same as above, ;but
;produce "glitches" when rotation the pot0 - why ????
;--------------------------------------------------------------------------------------
;rdax temp,1
;wrax sin1_range,0
;cho rda,sin1,cos|reg|compc,Delay
;cho rda,sin1,cos,Delay+1
;wrax dacl,0
;--------------------------------------------------------------------------------------
;found the following code in the OEM-Flanger,
;It makes sample interpolation without the CHO instruction
;produce also "glitches" when rotation the pot0 - why ????
;--------------------------------------------------------------------------------------
rdax temp,0.25 ;pot0 value, scale it cause addr_ptr ist 32768
;samples wide
;now pot0 produce a value from 0...0.125 =
;0....4096 samples
wrax addr_ptr,0 ;put into Addr_ptr
rmpa 1 ;read the sample
wrax sample1,0 ;save it, and clear ACC
or %00000000_00000001_00000000 ;put 1 into to ACC
rdax temp,0.25 ;add pot0 value
wrax addr_ptr,0 ;put into Addr_ptr
rmpa 1 ;read the next sample
wrax sample2,0 ;store it
;now derive an interpolation coefficient from LSBs of pointer:
rdax temp,0.25 ;the pot value
and %00000000_00000000_11111111 ;dont'know exactly what
;happens here, thing it blank out the
;"integer-part"
sof -2,0 ;this looks like a shifter,
sof -2,0 ;14 Bits
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof -2,0
sof 1.9999,0 ;one more Bit ???
wrax X_Fade,0 ;store the X-Fade coefficient
;now interpolate between the two adjacent delay taps:
rdax sample2,1
rdax sample1,-1
mulx X_Fade ;crossfade with interpolation
rdax sample1,1
wrax dacl,0 ;Do you hear the glitches ???
;------ ENDE --------