http://www.spinsemi.com/knowledge_base/ ... ngle_waves
Code: Select all
skp run,1 ;establish LFO on first sample cycle only
wldr rmp0,10,4096 ;set values for rate and range
cho rdal,rmp0 ;read LFO saw wave, accumulator value will range from 0 to 0.5
sof 1,-0.25 ;offset by -0.25, giving a saw wave that ranges from -0.25 to +0.25
absa ;make negative values positive, making the result a triangle.4096 : [0 to 0.5] range output
2048 : [0 to 0.25] range output
1024 : [0 to 0.125] range output
512 : [0 to 0.0625] range output
If I wanted to keep track of the RPTR2 (address + half ramp). Would this be sufficient?
Code: Select all
skp run,1 ;establish LFO on first sample cycle only
wldr rmp0,10,4096 ;set values for rate and range
cho rdal,rmp0 ;read LFO saw wave, accumulator value will range from 0 to 0.5
sof 1, -0.25 ; - 0.25
skp GEZ, 1 ; if negative :
sof 1, 0.5 ; + 0.5