Forums > MaxMSP

phasor issue

December 19, 2013 | 5:38 pm

hi thee,

why would I get a [nan] in my float from the output of a phasor?
It starts off working ok, but after changing some parameters in the patch it starts to output the nan.

I’m using phasor to control playback of the loop in grainstretch~.
phasor controls set position message so i can create loops from waveform~, it also sends line message back to waveform~ to display position.

I keep getting a nan from the output of the phasor after stopping sample, then going back to play again…

here’s the phas subpatch part of the main patch
also attaching a tif of the problem


– Pasted Max Patch, click to expand. –


any help appreciated



December 22, 2013 | 3:23 am

Hi Drew,

I don’t think I ever had any problems with phasor~ sending out NaNs. I’m not able to reproduce your problem with the patch you joined either. Your description of the problem is not precise enough: which part of the patch is producing the NaN? Is the number~ already sending out NaNs? When does it happen? For which values of the parameters?

The only thing that I see in your patch that could produce a NaN is the division above the phasor~: if you divide by 0 (size=0), then normally you should get an +/- Inf at the output of the divisor. But in this case, I would not be astonished that you get NaNs there sometimes.

Also, if I were you I would not use the second outlet of number~ to convert signal to control, as you cannot really control when it happens (you can only control the interval). If you really need to control your granular synthesizer with non-signal values as grainstretch~ needs, you should consider using objects like snapshot~: basically it does what the second output of number~ does, but now you can control when.


December 22, 2013 | 2:37 pm

thanks alexis

your right, the patch itself doesn’t produce the problem, it’s only when used with the sampler patch. Not sure why yet.

The complete patch is too big to attach here, but I could dropbox, or even email to you n case you were interested in looking



December 22, 2013 | 4:33 pm

i think the problem, is when sample loads speed is set to 0 and that means phasor~ sends NaN. The thing is when you adjust speed from 0 it won’t start phasor again, just stays stuck on NaN.

I there any way to reset phasor or to trigger to start again or stop NaN symbol?

and I have managed to attach,


– Pasted Max Patch, click to expand. –


Viewing 4 posts - 1 through 4 (of 4 total)