Forums > MaxMSP

0 – 1 – 0 with one bang or integer change

November 3, 2008 | 1:42 pm

Dear Max user,

I am wondering which is the fasters way of getting a change from 0 to 1 then back to 0 in a number box?

0 – 1 – 0
A numberbox change should open a gate whenever the number changes.
Instead of the toggle I would like to have something which changes from 0 to 1 and back to 0 with one bang.

Is there a nice object somewhere?
Help appreciated!

all the best,
Krisztian


November 3, 2008 | 2:04 pm

! use [trigger] on the output of the gate to close the gate before passing the data


November 3, 2008 | 2:06 pm

Have a look to the match object.

ej

On 3 nov. 08, at 14:42, tedor wrote:

>
> Dear Max user,
>
> I am wondering which is the fasters way of getting a change from 0
> to 1 then back to 0 in a number box?
>
> 0 – 1 – 0
> A numberbox change should open a gate whenever the number changes.
> Instead of the toggle I would like to have something which changes
> from 0 to 1 and back to 0 with one bang.
>
> Is there a nice object somewhere?
> Help appreciated!
>
> all the best,
> Krisztian


November 3, 2008 | 2:13 pm

On 3 nov. 08, at 14:42, tedor wrote:
>
> I am wondering which is the fasters way of getting a change from 0
> to 1 then back to 0 in a number box?

[t 0 1 0] ?

> 0 – 1 – 0
> A numberbox change should open a gate whenever the number changes.

But what is supposed to close the gate? If you want to have data going
thru it, [t 0 1 0] may be too fast… You may close when dsomething
gos thru the gate (using something like [t l 0] with 0 connected to
the gate control inlet).

_____________________________
Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl

http://www.crfmw.be/max


November 3, 2008 | 3:09 pm

if it is the changing number you want to pass
all you need is [change]

otherwise
this try this
#P window setfont "Sans Serif" 9.;
#P number 88 306 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 107 199 27 196617 i;
#P newex 88 260 29 196617 t i 0;
#P newex 89 170 31 196617 t b 1;
#P newex 88 228 29 196617 gate;
#P number 89 111 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 89 140 40 196617 change;
#P comment 138 201 100 196617 data to pass;
#P connect 5 0 7 0;
#P connect 4 1 3 0;
#P connect 6 0 3 1;
#P connect 3 0 5 0;
#P fasten 5 1 3 0 112 290 76 290 76 222 93 222;
#P connect 4 0 6 0;
#P connect 1 0 4 0;
#P connect 2 0 1 0;
#P window clipboard copycount 8;


November 5, 2008 | 9:11 am

Thank you for your help, I am sorted now.
Best
K


Viewing 6 posts - 1 through 6 (of 6 total)