CV gate to bang

Ok. i made a search with no results, so i’m sorry if this has been already covered. I think this should be a very straight forward patch but i’d like to know if i’m going the right way.

I’m trying to convert control voltage (gate or trigger) from an analog synth (CV) to a bang in Max (i’m using an Expert Sleepers module to send CV to my Mac, so that part is solved). My question is which should be the best way to go, now i’m using the if~ object connected to number~ at the moment it works, but not as accurate as i would like.

This is the patch, do you guys think this is the way to go? any suggestion?

Thank you in advance.

<code>

– Pasted Max Patch, click to expand. –

Copy all of the following text. Then, in Max, select New From Clipboard.

The long-short is that you’re downsampling to control-rate via number~ so you’re missing a lot of data. Do the comparison at signal-rate via thresh~ (two-stage threshold which will debounce) and detect the transition via edge~.

Also, if you’re working with a modular and Max, you might check out Stretta’s BEAP Modular project. It has some builtin tools for working with CV.

<code>

– Pasted Max Patch, click to expand. –

Copy all of the following text. Then, in Max, select New From Clipboard.