DIYstompboxes.com

DIY Stompboxes => Digital & DSP => Topic started by: Boner on December 05, 2022, 08:37:20 PM

Title: is it possible to "REG" a single sin/ramp multiple times in the FV-1
Post by: Boner on December 05, 2022, 08:37:20 PM
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
Title: Re: is it possible to "REG" a single sin/ramp multiple times in the FV-1
Post by: ElectricDruid on December 06, 2022, 02:07:02 AM
The problem is that it's not the *instantaneous* ramp LFO rate that sets the shift. You can't just tweak the rate and then get a different pitch shift. You need to think about *how* the shift is produced to work out whether what you're trying to do is possible. Have a read of Spin's notes about it again:

http://spinsemi.com/Products/appnotes/spn1001/AN-0001.pdf

It is possible to generate a ramp wave at half the frequency of another by scaling it, and offsetting every other wavecycle. Perhaps something like that would be possible to give you the index you need for your half-shift?

HTH,
Tom
Title: Re: is it possible to "REG" a single sin/ramp multiple times in the FV-1
Post by: octfrank on December 06, 2022, 09:31:49 AM
Ramp/LFO are only updated once per sample period so you cannot just change the coefficient and get a new frequency in the same sample period. You would need to use 2 different ones or as Electric Druid says come up with a way to scale/shift the ramp to generate the shape you need for the second one.

Most likely you will need to use both ramps to do what you want as shifting is a complex mix of 2 pointers and cross fading.
Title: Re: is it possible to "REG" a single sin/ramp multiple times in the FV-1
Post by: Boner on December 06, 2022, 09:49:30 AM
Quote from: ElectricDruid on December 06, 2022, 02:07:02 AM

It is possible to generate a ramp wave at half the frequency of another by scaling it, and offsetting every other wavecycle. Perhaps something like that would be possible to give you the index you need for your half-shift?

HTH,
Tom

Oh thats a good idea!!! Looks like that is a way to do it.

Thank you both