On Wed, Apr 28, 2010 at 09:10:53AM -0700, Benoît Fortier wrote:
Thank you, I didn't knew about the one block delay. Problem solved very elegantly indeed!
However the problem is not really solved, only "delayed". :) Your phasor~'s frequency will not change when it is at zero, but at least 1 sample or in Pd even one block later (so usually 64 samples) when the phasor~ is already at a value different from 0.
This affects certain algorithms more than others, but you have to be aware of it. Here's Miller's notes from http://crca.ucsd.edu/~msp/techniques/latest/book-html/node96.html about the issue:
Having the oscillator's phase control the updating of its own frequency is an example of feedback, which in general means using any process's output as one of its inputs. When processing digital audio signals at a fixed sample rate (as we're doing), it is never possible to have the process's current output as an input, since at the time we would need it we haven't yet calculated it. The best we can hope for is to use the previous sample of output--in effect, adding one sample of delay. In block environments (such as Max, Pd, and Csound) the situation becomes more complicated, but we will delay discussing that until the next chapter (and simply wish away the problem in the examples at the end of this one).
A [phasor~] with a builtin [samphold~] on its own output could be a nice external.
Frank Barknecht Do You RjDj.me? _ ______footils.org__