loop clicks

Software questions and issues with the FV-1

Moderator: frank

Post Reply
piv
Posts: 4
Joined: Sun Jan 25, 2009 12:39 pm
Location: Riga, Latvija

loop clicks

Post by piv »

Hi Frank, hi All,
I'm trying to make a Loop Effect, but there is a problem with "loop clicks". Does anybody know how to remove them? I will appreciate any help.
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

Well, need a bit more info. Can you post the code so we can see what you are doing?
Frank Thomson
Experimental Noize
piv
Posts: 4
Joined: Sun Jan 25, 2009 12:39 pm
Location: Riga, Latvija

Post by piv »

Hallo Frank,
here is a part of the code.

delay mem 4096

ldax POT2
sof 1,-1/128
skp NEG,LOOP

ldax ADCL
wra delay,0
skp ZRO,NEXT

LOOP:
rda delay#,0.99
wra delay,0

NEXT:
rda delay#,1
wrax DACL,1
wrax DACR,0

I would like to get a continuous sounding fragment,
but at the end and the beginning there are some clicks (loop clicks).
Is there a way to eliminate these clicks?
Maybe 2 parallel delay lines with time shift will solve the problem?
Thank you in advance!
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

OK, the click is from suddenly stopping the recording and just doing a playback. The click will cycle through the delay loop so what you will want to do is when you go from recording to play, fade out recording over a short time period and mix it with the loop output. Sort of like (sorry, can't write this in FV-1 code and try it at the moment):

if (recording) {
delay_in = ADCL
coef = 1.0
}

if (playback) {
temp = coef * ADCL
temp = temp + (1-coef)*delay_out
delay_in = 0.99 * temp
coef = 0.9 * coef
}

DACL = delay_out

Basically, when we go from record to playback, we keep recording for a short period, mixing the input with the output of the delay as coef decays from 1.0 to 0
Frank Thomson
Experimental Noize
piv
Posts: 4
Joined: Sun Jan 25, 2009 12:39 pm
Location: Riga, Latvija

Post by piv »

Thanks for your help! It seems to work fine. But I have one more idea and question... Is it possible to detect and write into the memory 1 signal period? I think this should completely remove these clicks.
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

In theory it is but there is no built in method to detect a single period of a signal, you would need to detect it in your code by watching for things like zero crossings or peaks.

And, keep in mind, that if the signal is not an integer divisor of the sample rate then you will still have a discontinuity in the waveform. I.e. if sample rate is 32000Hz and signal is 1000Hz that is ok as there are exactly 32 samples/period but if signal is 900Hz that is 35.5 samples/period so you have to use 35 or 36 to hold the signal. In either case there is a discontinuity. Also, you will need to adjust the length of the delay to hold exactly one period of the signal.
Frank Thomson
Experimental Noize
Post Reply