What is wrong with this? Want function to go back to 0

Jiegel's icon

Okay, here is a sample patch that a Max genius (who you have all heard of) put together for me in about 10 seconds. (please read down)

Max Patch
Copy patch and select New From Clipboard in Max.

notice that when you click the toggle button, the function graph always starts and ends at 0 (thus avoiding pops/clicks due to overlap.

I essentially copied it directly into another patch, changed random to drunk, and changed the "/" number to related to the metronome speed (which is variable).

So WHY ON EARTH isn't my version going back to zero? Here is the code copied from my patch:

Max Patch
Copy patch and select New From Clipboard in Max.

ch's icon

Hi,

So WHY ON EARTH isn't my version going back to zero?

It does.

put a print out of your messages [$1 0.] and you will see some messages like that :

print: 82899. 0.

So if you set the "hi domain display value (X-axis)" of your functions to something like 100000., you'll see it is actually going down to zero... :)

Jiegel's icon

Hmm..you're right. But then why is it still clicking when it plays? How would I go about changing it to, say, lop off the first 20 milliseconds on both ends? I'm sorry to be a pest but this piece of the patch is beyond my understanding...

Emmanuel Jourdan's icon
Max Patch
Copy patch and select New From Clipboard in Max.

it probably makes clicks if you trigger your function too early.

Jiegel's icon

it has something to do with the fact that my patch uses DRUNK instead of RANDOM. Can anyone tell me why that would be? Literally if i change absolutely nothing but swap drunk and random for one another it only works for random. Can anyone suggest proper range / step sizes for me to go with on drunk to make it so it never clips like that?

ch's icon

as the range of your [drunk] is 1000, you should first try to divide its output by 1000. and not by 570. Does that solve the issue?