1+1 = 1?

Jun 20, 2013 at 3:07am

1+1 = 1?

Hi,

The attached patch counts space bar presses. However, it takes two presses to make the counter reach 1! I cant figure out what I’ve done wrong. any help please!?!

<code>

– Pasted Max Patch, click to expand. –

</code>

#253398
Jun 20, 2013 at 3:17am

Counter starts counting from 0 by default. You can change the minimum number using the “setmin” message

<code>

– Pasted Max Patch, click to expand. –

</code>

#253399
Jun 20, 2013 at 3:33am

Thanks, but still not working. I have put setmin in teh patch and it still takes 2 key presses to make it register 1…..

<code>

– Pasted Max Patch, click to expand. –

</code>

#253401
Jun 20, 2013 at 5:53am

Hi
not sure why that happens, but whenever I want to initalize a [counter] I always set it to my minimum via the 4th inlet:

<code>

– Pasted Max Patch, click to expand. –

</code>

Brendan

#253413
Jun 20, 2013 at 6:57am

yeah, “setmin $1″ looks broken, at least on 6.1.2

I hardly ever initialize counters – if I want to count from 1 and upwards I typically do [+ 1] after the counter.

#253419
Jun 20, 2013 at 7:13am

Try: [counter 1 0x7FFFFFFF]

#253425
Jun 20, 2013 at 11:31am

I tend to use the sync reset for this sort of thing:

<code>

– Pasted Max Patch, click to expand. –

</code>

(and I’m sorry that there are so many quirks in counter. It was my first external, and my first C code)

#253459
Jun 20, 2013 at 12:53pm

>> I tend to use the sync reset for this sort of thing

Yes, so do I.

#253475
Jun 20, 2013 at 2:36pm

Wetterberg, it was here prior to 6.12. I got mad with this in one on my patches, trying to figure out where my mistake was…
Chris : any chance you rewrite it ?
None of these three solutions works at first try : it only works once you have reset the counter for the first time. That means you have to launch it then reset it to get the desired behavior…

#253481
Jun 20, 2013 at 3:13pm

The maintenance of counter has been out of my hands since the 1990s.

I don’t see what the problem with initializing to a desired state with something like loadbang / loadmess is, and doesn’t Christopher’s [counter 1 0x7FFFFFFF] do it without any further initialization?

This sort of initialization is just part of the process, IMO.

#253483
Jun 21, 2013 at 12:41am

And “reset to number immediately” seems pretty self-explanatory to me.

#253517
Jun 21, 2013 at 1:56am

Ok, this works for me like this :
<code>

– Pasted Max Patch, click to expand. –

</code>

I wrote the previous post because it happened to me to get mad after trying all the solutions you proposed.

#253519

You must be logged in to reply to this topic.