Delay with modulation

Algorithm development and general DSP issues

Moderator: frank

alpignolo
Posts: 20
Joined: Tue May 27, 2014 8:40 am

Delay with modulation

Post by alpignolo »

Some ideas for made a Delay with modulation? Chorus or vibrato similar to the functions of Mamory Man...
Can be done varying the delay time through an LFO?
Thanks
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

Already a lot of code examples for that on the Spin website. See the "Free DSP Programs" and "Knowledge Base" sections.
Frank Thomson
Experimental Noize
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Post by Digital Larry »

Don't forget to read AN-0001 too, which explains use of the Sin/Cos LFOs for delay sweeping, and the ramp LFOs for pitch shifting (you could probably safely skip that for now).

http://www.spinsemi.com/Products/appnot ... N-0001.pdf
alpignolo
Posts: 20
Joined: Tue May 27, 2014 8:40 am

Post by alpignolo »

ok, I have seen the information but i have a question to ask.
The method for obtaining a chorus through Sin/Cos LFOs sweeping, is applicable only for short delay (4096)? I would like to apply the method to a variable delay of up to a second. It's possible?
Thanks
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Post by Digital Larry »

I'm not familiar with the Memory Man. If you sweep through the entire range of memory you'll get some crazy pitch bending. There is no harm in trying it!

If you want "chorusing" attached to a longer variable delay, then I'd make it in two sections.

Something like this:

Code: Select all

;  Program: Render Block exported from SpinCAD Designer
;------ Input
;------ Pot 0
;------ Pot 1
;------ Scale/Offset
RDAX POT0,1.0000000000
SOF 0.9000000000,0.1000000000
WRAX REG0,0.0000000000
;------ Feedback Output
;------ Pot 2
;------ Scale/Offset
RDAX POT2,1.0000000000
SOF -0.8500000000,0.9400000000
WRAX REG2,0.0000000000
;------ Mixer 2-1
RDAX ADCL,0.5000000000
WRAX REG3,0.0000000000
RDAX REG1,0.5000000000
MULX POT1
RDAX REG3,1.0000000000
WRAX REG3,0.0000000000
;------ Servo Delay
RDAX REG3,1.0000000000
WRA 0,0.0
CLR
OR $007FFF00
MULX REG0
RDFX REG5,0.0012500000
WRAX REG5,1.0000000000
SOF 0.9749755859,0.0000305176
WRAX ADDR_PTR,0.0000000000
RMPA 1.0
WRAX REG4,0.0000000000
;------ LFO 0
SKP RUN ,1
WLDS 0,146,17088
RDAX POT2,0.2857142857
WRAX SIN0_RATE,0.0000000000
RDAX REG2,0.5215002899
WRAX SIN0_RANGE,0.0000000000
CHO RDAL,0
SOF 0.5000000000,0.5000000000
WRAX REG6,0.0000000000
CHO RDAL,8
SOF 0.5000000000,0.5000000000
WRAX REG7,0.0000000000
;------ Servo Delay
RDAX REG4,1.0000000000
WRA 31949,0.0
CLR
OR $007FFF00
MULX REG6
RDFX REG9,0.0012500000
WRAX REG9,1.0000000000
SOF 0.0209960938,0.9750061035
WRAX ADDR_PTR,0.0000000000
RMPA 1.0
WRAX REG8,0.0000000000
;------ Mixer 2-1
RDAX ADCL,0.5000000000
WRAX REG10,0.0000000000
RDAX REG8,0.5000000000
RDAX REG10,1.0000000000
WRAX REG10,0.0000000000
;------ FB In 1
RDAX REG4,1.7600000000
WRAX REG1,0.0000000000
;------ Mixer 2-1
RDAX ADCL,0.5000000000
WRAX REG11,0.0000000000
RDAX REG10,0.5000000000
RDAX REG11,1.0000000000
WRAX REG11,0.0000000000
;------ Output
RDAX REG11,1.0000000000
WRAX DACL,0.0000000000
RDAX REG11,1.0000000000
WRAX DACR,0.0000000000
Pot 0 = delay time
Pot 1 = delay feedback
Pot 2 = chorus LFO speed/inverse LFO width

You have to make some tradeoffs as the Memory Man (I looked it up) has 6 knobs.

There are also a few questions, such as:

Does the input signal get chorused, or only the delay? In this case the input signal is dry to the output mixer.
Sweetalk
Posts: 141
Joined: Thu Oct 15, 2009 5:13 am

Post by Sweetalk »

In the Memory Man (and other analog delays with modulation) only the delayed signal gets modulated.
alpignolo
Posts: 20
Joined: Tue May 27, 2014 8:40 am

Post by alpignolo »

ok Digital Larry, it's good idea.
I have tried your code but the sound of repeats is a bit distorted, as if they were in clip.
What could be the reason?

thanks
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Post by Digital Larry »

Maybe the gain is too hot, look for this line and reduce the 1.000 to 0.5 or lower, see if it helps...

Code: Select all

;------ Servo Delay 
RDAX REG3,1.0000000000 
There is a similar line at the beginning of the chorus block (also a servo delay) but I think it uses REG4.... and since these two stages are in series it is hard to tell where the distortion is occurring.

This line controls the feedback gain (currently 1.76), but reducing it will reduce the amount of feedback as well. That's why I suggest initially to reduce the gain coming into the delay line.

Code: Select all

;------ FB In 1 
RDAX REG4,1.7600000000 
WRAX REG1,0.0000000000 
This may not be a final answer though. You might want to go all the way back to the input gain, which is currently set to 0.5.

Code: Select all

;------ Mixer 2-1 
RDAX ADCL,0.5000000000 
alpignolo
Posts: 20
Joined: Tue May 27, 2014 8:40 am

Post by alpignolo »

i have tried to change all gain levels but the problem persists.
It's like a zip noise, similar to a slight aliaser in the background to the note.
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Post by Digital Larry »

I'm not really sure! If I have time I'll check it this weekend. I do know that using RMPA for chorusing is not the ideal approach.
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

If the code is doing a linear change between values then it is zipper noise, add smoothing to the changing values.
Frank Thomson
Experimental Noize
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Post by Digital Larry »

frank wrote:If the code is doing a linear change between values then it is zipper noise, add smoothing to the changing values.
Thanks Frank - this delay block does include a smoother, although choosing the optimum coefficient may remain to be done. The other thing that crossed my mind is that my SOFs which calculate the boundaries of various memory buffers may be off slightly and so one routine is actually occasionally reading the end of a different buffer.
alpignolo
Posts: 20
Joined: Tue May 27, 2014 8:40 am

Post by alpignolo »

I have try to change the coefficient of the smoother, but the problem persist.
Digital Larry
Posts: 338
Joined: Mon Nov 12, 2012 1:12 pm
Contact:

Post by Digital Larry »

Sorry I haven't had time to investigate this. So I'll theorize about it.

If you are using a RMPA delay block for flanging (as in this case), at some point the algorithm is going to jump from one sample to the next. Smoothing the control input simply serves to make these jumps smaller, but the minimum jump is still going to be 1 sample.

At 32768 kHz each sample is about 0.03 milliseconds, which doesn't sound like much. Nevertheless, I have found that at the short delay times used in flanging, I don't seem to get "much" flanging effect using this block, and at slow sweeps I seem to be able to hear noticeable small, but abrupt tonal changes when this happens.

When you use the CHO RDA instructions instead, every sample gets something like 256 extra interpolation points between the actual samples.

Some day before too long, I will actually implement both an LFO delay block and the "real" servo delay block which uses the ramp LFO and the CHO RDA instructions as well. When that day comes we can do a comparison test to see if that was the issue.

To check whether possibly my calculation of the scale/offset prior to RMPA is causing issues by reading from the wrong buffer, you could try this:

For this line:

Code: Select all

SOF 0.9749755859,0.0000305176


Decrease the scale parameter slightly, say, down to 0.96. This will give you nearly the entire delay range you had before but there will be a little "safety zone" before the next buffer (which is the flange buffer).
alpignolo
Posts: 20
Joined: Tue May 27, 2014 8:40 am

Post by alpignolo »

i have tried to decrease down to 0.96 or less, but there is still the zip noise.
:roll:
Post Reply