phasor issue

drewmcm's icon

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...

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

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

any help appreciated

thanks

drew

Alexis Baskind's icon

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.

Alexis

drewmcm's icon

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

thanks

drew

drewmcm's icon

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?

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

and I have managed to attach,