Initialise logic/counter object to 0


#1

Is there a way to have the counter object initialise to 0 ?
had a peek in the code and "count" does get set to = 0 in the init code, however in my patch i have 2 counter objects and both initialise to 1 on startup of the patch, any ideas ?


#2

Try using the loadbang object connected to the reset inputs of the counters? Worth a shot.

Sounds like the object is "detecting" a false pulse some how.


#3

yeah as @adnauseam said a const/i set to one patched into the reset inlet should do it.


#4

thank you guys! especially @adnauseam that sorted it right out, didnt know it existed either until now :slight_smile:


#5

Adding the const/i is a dirty hack you can find in help files, but it works only if you nail the execution order.

Also, the counter object actually initializes to 0 at startup, however if you use a square lfo to drive the counter, after the first k-rate cycle of the program (pretty quickly, then) the output of the square lfo goes to 1, and the counter advances by 1.


#6

if you use a square lfo to drive the counter

that is exactly what im doing haha, spot on! using the square lfo to drive 2 cycling banks of LED'S, will investigate the const/i tomorrow see if that makes things better


#7

Another way would be to modify the square lfo so that it maintains its initial output (0) for one lfo cycle before the output changes, rather than just one k-rate cycle. Alternatively, modify the lfo so that its initial state is 1 rather than 0, and add an inverter to the output so that the input to the counter really is 0 for one cycle.

Or in practice, create a copy of the lfo object with a modified output, as there are likely other situations where you would want the original behavior. Or add more outputs to the lfo with the different characteristics.