1+1 = 1?

    Jun 20 2013 | 10:07 am
    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!?!

    • Jun 20 2013 | 10:17 am
      Counter starts counting from 0 by default. You can change the minimum number using the "setmin" message
    • Jun 20 2013 | 10:33 am
      Thanks, but still not working. I have put setmin in teh patch and it still takes 2 key presses to make it register 1.....
    • Jun 20 2013 | 12:53 pm
      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:
    • Jun 20 2013 | 1:57 pm
      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.
    • Jun 20 2013 | 2:13 pm
      Try: [counter 1 0x7FFFFFFF]
    • Jun 20 2013 | 6:31 pm
      I tend to use the sync reset for this sort of thing:
      (and I'm sorry that there are so many quirks in counter. It was my first external, and my first C code)
    • Jun 20 2013 | 7:53 pm
      >> I tend to use the sync reset for this sort of thing
      Yes, so do I.
    • Jun 20 2013 | 9:36 pm
      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...
    • Jun 20 2013 | 10:13 pm
      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.
    • Jun 21 2013 | 7:41 am
      And "reset to number immediately" seems pretty self-explanatory to me.
    • Jun 21 2013 | 8:56 am
      Ok, this works for me like this :
      I wrote the previous post because it happened to me to get mad after trying all the solutions you proposed.