Counter carry bugs

Stefan Tiedje's icon

The carry outlets of counter show a misbehaviour:
The carry bang for the minimum is coming out of the third outlet instead
of the second, thus the third outlet will bang on maximum and minimum (2
times) and the minimum (second outlet) will never bang.

4.5.7 on Powerbook with OS X 10.4.5

Very obvious this needs a fix:

Max Patch
Copy patch and select New From Clipboard in Max.

--

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

-------------------------x----
--_____-----------|-----------
--(_|_ ----|-----|-----()----
-- _|_)----|-----()-----------
----------()------------x-----

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

mzed's icon

This works the way I would expect, switch the bangs for toggles in your patch (like in the help patch). Third outlet sends out a 1 when it hits the maximum and 0 when it goes to non-maximum. If you reverse it to count down, you'll see the same thing from outlet two.

I can't recall if counter ever worked some other way, but this seems fairly workable to me.

mzed

roger.carruthers's icon

You can also set counter's carry outs to output bangs instead of 0/1's by sending it a carrybang message.
I think this behaviour did change, albeit several versions ago; I have a dim memory of being confused by this myself once,
cheers
Roger

Stefan Tiedje's icon

Thanks for clarifying, I was confused by the hints of the outlets of the
object.

Stefan

--

[][] [][][] [][] [][][]
[][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

-------------------------x----
--_____-----------|-----------
--(_|_ ----|-----|-----()----
-- _|_)----|-----()-----------
----------()------------x-----

14, Av. Pr. Franklin Roosevelt,
94320 Thiais, France
Phone at CCMIX +33-1-57 42 91 09

ManuTheFrog's icon

Hello,
I have a question for [counter], to me it seems to work correctly, but there is something I do not understand. What does come out from the 3rd outlet "Carry (Counter Hit Maximum) Flag" ?

I'd like to treat this information, but I do not know what a "flag" represent.

The thing is that when I send a "bang" with a [button] to a [GSwitch] or [toggle] simply by clicking, their states change. But if I use what is going out from the 3rd outlet of [counter], it detects a "bang" in a [button], but it neither change [toggle] nor [GSwitch] values...

So, could you help me ? Thanks very much.
PS: English isn't my first language so please be cool ;)

roger.carruthers's icon

The default output for counter is a 1 when the counter
hits the maximum count, and 0 for any other value; a
toggle will change to it's 'on' state (ie. displaying
an 'x'), when it receives a 1, or on alternate bangs,
which is probably what was confusing you.
Counter can be set to output a bang instead of a 1,
on hitting the count maximum, by sending it a
'carrybang' message,
hth
Roger

ManuTheFrog's icon

cheers
I should have read more of this topic because you gave the answer just before (but I didn't understood).

Deftoner's icon
Max Patch
Copy patch and select New From Clipboard in Max.

I dont know if its a bug, or if i'm just stupid, but the 'carrybang' message doesnt seem to work.
The patch below should show the problem:

As u should see the carrybang message doesnt change the behavior of the counter...or am i doing something wrong?

Inear's icon

Hi, it doesn't work with the message "carrybang" but with "carryflag 1" or by setting the attribute in the inspector.