Is there a way to clear (instantaneously) a delay line?
-
Clearing delay lines
-
ok It is best to precise wich delay of course.
for the "delwrite~"-"delread~" pairs, the only way, is to multiply the out of the delread by [*~] like this :
inlet~
|
delwrite~
delread~
|
| number (0 to stop, 1 to start)
| |
*~
]
outlet~
it's like a spigot for signal in fact, the spigot~ object exist here if you prefer :
http://ydegoyon.free.fr/software.html
at the bottom of the page -
thanks giair,
however there's another little problem.
I'm using a 20 seconds delay.
Multiplying by zero the output, I hear no sound from the delay, and that's OK. But when I multiply by one again, I hear the previous 20 seconds recorded !
My necessity is to clear those "dirty" 20 seconds, so to restart cleanly, and hear the output only after the delay time.
Anyone ever had the same problem? -
ok, maybe use the [*~] before the delwrite~ too.
And you must wait delay the both [*~] by your delay time.
May be if you want to start (for a delay time = 20msec):
*~ 1 to delwrite
delay 20
*~ 1 to delread
no ? -
you might need to use a set up that involves using two (or more) separate delay lines and swapping back and forth between them at the moment you want to 'clean' the delay. here's how it would work:
assume two delwrite~ obects with delay lines named a and b. matching these two delwrite~s are two delread~s. each of these four objects can be 'turned on' or 'muted' (using the method supplied above by giair). muting a delwrite~ object technically means muting the audio going into to the object.
the initial state of the patch would [delwrite~ a] and [delread~ a] turned on and [delwrite~ b] and [delread~ b] muted. when you want to clear the delay line, you would mute [delwrite~ a] and [delread~ a]. at that point you can turn on the 'b' delay line objects. you can switch back and forth between your two delay lines cleanly if you wait an amount of time greater than the length of the delay.
in the case that your delay time is longer than the time you want to wait, you would have to use another delay line. the downside of this is that the control gets a little bit more complicated. if this is something you might apply, check miller puckette's book (pdf available on his website i think) and look at the chapter on polyphonic synthesizers. polyphonic synths require some form of voice allocation and you might be able to use some of pd's voice allocation support to help manage your delay lines, because it is a fairly similar process.
i hope this made sense. i don't think it's as confusing as it sounds, but it is hard to put into words. if you understand what i mean, but aren't sure how to implement it, i could probably post an example; just let me know.
--zac -
Zac, if you could post an example, I'll appreciate very much.
The point from which I started this topic was just that I had to wait 20 seconds to have the delay line cleared, and I wonder if there is something similar to MAX/MSP "clear" message to the "tapin~" object. It could be a feature request... -
rcoco, here's a little patch i drew up that allows you to swap back and forth between two delay lines, which i believe is the same as clearing a single delay line. as far as i know, there is no method or message you can send to a delwrite~ or delread~ to do this automatically, but i'll take a look at the source code and try to verify that. let me know if you have any questions about the patch.
[url=http://www.geocities.com/z_fron/cleardelay.pd.txt ]http://www.geocities.com/z_fron/cleardelay.pd.txt
(the .txt extension is because geocities won't let me upload a file with the .pd extension, so just rename it or else you can open it directly in Pd)
one note about this patch---it doesn't account for a delay line with a feedback loop, but you could probably modify it to support feedback loops.
--zac -
Many thanks, zac.
-
I had the same need: to "clear" a delayline without waiting.
Thanks! -
from memory, there is a way to do this with tables too, right?