Hi,
I started learning Pd couple of weeks ago. I'm going through the on-line tutorials by Kreidler. It's going pretty well so far...
I couldn't figure out his Karplus-Strong algorithm. It's 3.4.2.10. I guess I don't really understand the exact behavior of vd~ and delwrite~. I have few questions and hopefully some of you would find the time to answer.
1. why does vd~ object has a creation argument of 100 in the first place? Doesn't the inlet determine the delay time? in this case it set to 14, so isn't the delay time 14?
2. The loadbang object activates the vd~ before I run the patch, and before the buffer was created. Shouldn't the buffer be announced before the vd~ begins?
3. This is something general: Is vd~ a loop object? In the previous examples there was always phasor~ It is easy to understand that there is a loop where a wave operates as a sound generator. Is that the case with vd~ and delread~ as well? what exactly makes the loop go in 3.4.2.10?
hope to find some answers here. Thanks for you all!
yMotion
-
Vd~
-
1. i've never seen vd~ with a 2nd creation argument before. The first creation argument is of course the buffer name, but i think this second creation argument is just gibberish. It's not really an 'error' because it won't hurt your patch, but it does nothing and means nothing. As far as i know, vd~ only takes one creation argument, everything after that will just be ignored.
2. not sure which loadbang you're talking about
3. vd~ stands for "variable delay", so that's all it does. it plays back the buffer specified in [delwrite~] after a period of ~n ms. This delay time is set by the signal coming into [vd~]. So, for example If you just send a normal phasor~ directly into [vd~] then really not much will happen, because you'd just be changing the delay between 0 and 1 ms. This is equivalent to playing back the buffer with the tiniest of tiny vibrato's.
When it gets interesting, is when you use vd~ to change the delay time by much more than 1ms while the patch runs. The end result of this is much like slowing down or speeding up a tape recorder - you get variations in pitch, basically.What the Karplus-Strong algorithm does, then, is to send FEEDBACK into this process. That's what 'makes the loop go'. If you look at that patch again, follow the signal chain and you will see what is happening. The [noise~] goes into the buffer. Then the buffer is played back (at a variable rate) by vd~. After that, there is some averaging process (not sure about that bit, but it's basically a lowpass filter, i guess) and then the signal is multiplied by about 0.99 and then sent back into the original [delwrite~] object, where it gets read by the vd~ again, etc...that's your feedback loop, and that's what makes the loop go.
incidentally, i think there's another error in that patch as well. The [dac~] should come BEFORE the 'damping factor' calculation, otherwise, with low damping, you also get low volume.
Oh, and just in case the terminology is confusing: "damping" and "feedback amount" are two sides of the one coin in this case. I prefer to use the term 'feedback' because it more clearly expresses what is happening. 90% feedback = 10% damping, etc.
-
Hi mod. Thanks a lot for your detailed reply! I got it now.
Concerning the [loadbang] I was referring to the first (or second) patch of 3.4.2.10. I guess you read the third one...
Once I open the patch, I get an error message "vd~: no such delwrite~" I think it's because vd~ receives a bang before the buffer was set, right? -
ymotion: Double check that [vd~] and [delwrite~] have the same name. That error should only come up if you have a [vd~] that doesn't share its argument with a [delwrite~]. The buffer gets set when [delwrite~] is instantiated, which will happen before the [loadbang].
mod: The filtering is actually a resonant comb-filter, not lowpass. Basically, what happens is all the frequencies that are harmonic to the delay length remain while the rest get filtered out. Pretty fucking clever if you ask me.
-
wow, yeah that IS cool.
i need to learn more about filters. wanna chuck up a list of good resources?
-
A filter tutorial has been rattling around in my head. I'll throw something up eventually.
-
Hi Maelstrom, thanks for clarifying. The error is gone now.
yMotion