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.
loop clicks
Moderator: frank
Well, need a bit more info. Can you post the code so we can see what you are doing?
Frank Thomson
Experimental Noize
Experimental Noize
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!
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!
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
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
Experimental Noize
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.
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
Experimental Noize