Use of sah~ in adsr~ polysynth example, is it really necessary?
Jan 25 2009 | 1:13 am
I was looking at the polysynth example in the adsr~ help file. The second outlet is used to drive a sah~ that only lets a new frequency be set when an envelope starts attacking. That sounds reasonable in theory...
I was trying to make the simplest possible poly synth patch and I started out with this adsr~ example. I deleted the sah~ and had mtof go directly to the oscillator. I was trying to see if there is some case where that sah~ prevents something undesirable from happening. So I made my poly~ have only one voice and turned on voice stealing, but I can't really tell a difference between having and not having the sah~.
I can imagine some extreme example where for maybe one sample vector the pitch is wrong at the peak envelope amplitude. But then why is this example also using a [swap] for the midi input? If we just send the right outlet of the unpack directly to the [/ 127.] won't that go trigger the envelope first before the pitch is changed? So the ampltitude would jump to 0 and an instant later (but practically the same instant from the perspective of the Max scheduler?) the pitch will be changed. That seems fine to me, but I suppose the pitch could be set slightly too late? I can't imagine it would be noticeable though. I tried with attack 0 and I can't hear anything wrong. Maybe my ears are not discerning enough ;)
So sah~ is used to ensure the pitch change occrs *exactly* when the evelope starts, but I'm just wondering, how important is this really? It seems fine to omit it in practice, at least from my brief experiments. If someone can demonstrate a case where it fixes a noticeable problem, I'd be really interested.