Welcome to %s forums

BrainModular Users Forum

Login Register

compare two values?

I need help on a Patch
Post Reply
r.erorr
Member
Posts: 405
Location: Latvia
Contact:

Unread post by r.erorr » 27 Oct 2014, 11:08

I have an event flow that goes like this . . .

1:[-1]
2:[1] previous value [float]
3:[-1]
4:[1] current value [float]
5:[-1]

all I want is compare previous value with current one. It must be somehow doable, but I'm totally stuck on this. any ideas?

fractalist
Member
Posts: 84
Contact:

Unread post by fractalist » 27 Oct 2014, 14:16

there is something that computes the difference between successive values. diff(X), I think. it should help
th

caco
Member
Posts: 306
Contact:

Unread post by caco » 27 Oct 2014, 21:36

How about using an array of length two and writing to it each time you change from -1 to something else, e.g:

1:[-1]
2:[1] previous value [float] (Copy array[0] to array[1], write value to array[0])
3:[-1]
4:[1] current value [float] (Copy array[0] to array[1], write value to array[0])
5:[-1]

This way your previous value is always there in your array at position one to compare your current value against.

bsork
Site Admin
Posts: 1334
Location: Asker, Norway
Contact:

Unread post by bsork » 28 Oct 2014, 08:21

Try out the delta(x) module
Bjørn S

r.erorr
Member
Posts: 405
Location: Latvia
Contact:

Unread post by r.erorr » 28 Oct 2014, 12:29

thanks for replay . . . I have already found solution

Queue Data in Array can store values, but only those "if has changed". It has also "force enqueue" that allow enqueued even if value hasn’t changed, but what I want is detect when current values is equal to previous one, so the unchanged values is queued automatically.

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests