Tooth pattern output question

I am trying to output simulated toothed wheel signals (crank and cam) and tested the patch below

It works ok at frequencies up to around 50hz but becomes erratic above that. If only a single output channel is used the frequency can be higher but again runs into some limitation which seems to be related to the clock minimum timing being 0.001. The timing resolution of the output pulses can be increased by upping the counter values but this has the effect of slowing down the loop. Is there a faster clock to use?

Is there a better way to do this in XOD? Your comments are appreciated.

Hello!

seems to be related to the clock minimum timing being 0.001

Yes. It is because the setTimeout function is operating in milliseconds.
At the moment, I am working on the additional API (it will probably be called setImmediate) that will not have that limitation and will allow creating a faster clock. It will be available soon.

4 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.