phasor~ count iterations (signal domain/thread)
hi, I'm trying to count past 0.9999... with phasor (actually with groove~'s second output). I want to count iterations. so when the loop is at it's end, it goes from eg 0.999... to 1.000..., rather than 0.000... and I'm controlling other audio processes, so I want to do it all with tilde objects.
I found a solution but I'm surprised how many objects it takes.I think this will work, but I'm really curious: Anyone have a simpler way? (the bangs at bottom were just to check that nothing weird happens at the loop point)

No, not really. Here's what i would cook up...
How about a simple [counter] ?

@MakePatchesNotWar I like that gen code, thanks!
@Sébastien Gay Thanks for the suggestion. I've been using a similar method, but I've run into problems that I think are the result of executing half of the logic at the signal level and half at the data level:
I'm adding the fractional value to the int, and at the moment that the counter increments, I will sometime run into a sequence like :
0.9997, 0.00002, 1.00004
I'm hoping that doing it all with audio objects will eliminate this.
this is all it needs to bang on loop turnover

depending what you want to count :
number of started or number of played loop iterations,
reset counter immediatelly or on next bang.
you can do whatever with bangs or increament
Thanks for the code simplification Source Audio,
I want a control signal that combines the groove sync value and the count of iterations.
I'm running a really heavy patch and running into strange timing issues, one of which happens here:
I want that control stream to look like: 0.99998 , 1.0000001, 1.000003
It sometimes ends up as 0.999998, 0.0000001, 1.000003
So I'm guessing thread priority under cpu load is affecting my results.I can't run in audio interrupt. I think my issue would be solved if the control signal was calculated entirely with signal objects.
I've got the basics working, so thanks for the help everyone (still working on reset and some modifications I need for my specific case):
