Metronome, Timer, pulse at regular intervals: sending serial commands at regular intervals

fl0's picture

I'm trying to send a serial command through the Kineme Serial Out patch at regular intervals but can't find how to generate a regular time base.

Right now, I'm using an interpolation patch that feeds into three conditional patches into a mathematical expression. See the attached picture.

Is there a better way to do this? Am I missing something?

Thanks!

PreviewAttachmentSize
Screen shot 2010-03-14 at 7.02.02 PM.png
Screen shot 2010-03-14 at 7.02.02 PM.png71.42 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

usefuldesign.au's picture
Re: Metronome, Timer, pulse at regular intervals: sending ...

The range patch or math and math expression patches using modulo. This what you mean?

PreviewAttachmentSize
Interval timer.qtz18.27 KB

fl0's picture
Re: Metronome, Timer, pulse at regular intervals: sending ...

I don't quite understand your posted example but I thank you for leading me in the right direction:

Since I'm running at 60fps and need to send serial commands at roughly 30fps, I can live with doing a modulo 2 on the frames patch. It works a lot better than my old mess of connections.

Thanks again!

usefuldesign.au's picture
Re: Metronome, Timer, pulse at regular intervals: sending ...

Lol — study them!

Ignore the display macros, they add the function of turning a one quick pulse into a longer pulse that is usable for displaying or whatever.

I've reposted with Math, Math Expression and JS patches to do Modulo.

Why does Math expression evaluate to an integer, while JS and Math patches evaluate to the complete "remainder"?! Anybody?

PreviewAttachmentSize
Interval timer i.qtz26.67 KB

waxtastic's picture
Re: Metronome, Timer, pulse at regular intervals: sending ...

There is also the private Signal patch.

PreviewAttachmentSize
signal.png
signal.png27.17 KB

smokris's picture
Re: Metronome, Timer, pulse at regular intervals: sending ...

usefuldesign.au wrote:
Why does Math expression evaluate to an integer, while JS and Math patches evaluate to the complete "remainder"?! Anybody?

Correct, the Mathematical Expression patch performs integer modulus, while Math performs floating point modulus — this is known behavior.

smokris's picture
Re: Metronome, Timer, pulse at regular intervals: sending ...

...and the LFO patch, when set to Square or PWM mode.