Missing frames with Count CHOP

Hi there,

a CHOP Beat or a stream of CHOP values coming from elsewhere feeding a CHOP Counter…

I want my counter to count each time values cross a threshold.
For instance, my ramp goes from 0. to 1.
So I set up the Trigger Threshold counter to 0.999

And I miss counting things especially if stream is fast.
I think it is probably related to sampling rate. Of course, putting 0.95 works better, but this is a work around I’d like to avoid, especially if I want to count (and trigger things, maybe) accurately at the moment when the ramp, or the stream cross 1.

Anyone on this ?

Count CHOP is notoriously un-reliable in my experience. I almost always end up setting up at the very least a CHOP execute script with my own counting functionality, but if i need total reliability and I know I’ll be dropping frames / running with realtime on (timeslicing) than I typically try to find a way to use a Timer CHOP onDone callback to do counting as those callbacks will reliably run even if frames and/or samples are dropping. Kind of a pain I know, maybe others have better ideas of how to get more reliable functionality out of the Count CHOP though.

1 Like

Got it.

I will will test Timer CHOP with onDone() callback.

Thanks a lot.

If your input signal is a ramp, you can try and set the count to increase on decreasing numbers and set threshold to 0.5

Thanks @Achim, and indeed, if I wanted to have a master “counter” and get the pulse on its end, I use a maths that could phase it in order to have my count CHOP threshold at 0.5 and it is ok.

@archo-p, would you have an example of callback ? I’m just missing the way i python for generating a raw sample at the output of the Timer. Thanks a lot.

Here is a very basic Chop Exec DAT counter.
Indeed, it doesn’t seem to miss anything !!
Even with very fast counting.

I’d like to reuse it, globalize it a bit (like with custom variables like counting direction, maximum and minimum values etc). Need to check out how to reuse codes / nodes. And actually, maybe it is not the right way to do as the export way (here the channel I want to count) would make it hard to reuse, I think.

A more op-centric approach might be to use a speed CHOP. The first input to your speed chop is the rate of increase. For example an input value of 1 will increase the output value at 1 unit per second. You can then constrain this to an integer by using a math CHOP.

@archo-p’s approach of using a timer CHOP is also a great way for having a count that increases over time.