@y0g1 wrote:
cpu friendly ?
I doubt that this simple checking and accumulating is very expensive.
(in the other thread, in the screenshot I see many [fexpr~] that you could replace with [expr~] or other Vanilla objects.)
@ddw_music wrote:
should range from 0 to 479999 samples, but I actually get 479991.
Oh, this is very bad news! I always thought that phasor~ frequency would be spot on.
(There are very few people who understand [phasor~]s code, here is a thread https://forum.pdpatchrepo.info/topic/14523/90-second-limit-on-audio-buffers)
Ok, this means in Pd-world a sample-counter made with phasor~ would be bad design.
Here is one more patch, this circles between 0 and 255 and stops and resets when input sig == 0.
rpole~reset2.pd
@jameslo wrote:
signal changes to a non-zero value
This would require to add or subtract sth like the [rzero~ 1] [*~ 1e+32][clip~] trick in the inlet.
Edit: Now I realize that in case it stops at counting 0, it never restarts. Adding a [+~ 1] in the feedback-path should fix this.
2nd Edit: But then it's not cicling anymore...hmmm don't know how to fix this. Maybe instead [rzero~ 1] [*~1e+32][clip~] trick on the inlet to get one sample going.