I've been scratching my idea for a few hours and i can't do the patch i want. Here's the deal:
I have a slider that outputs values from 0 to 100. Then, say from 0 to 20 i want to trigger file1.avi, from 21 to 40, trigger file2.avi, and so on. The problem is that whenever i change the slider within a certain range (say range from 0 to 20) the file is always being triggered. I want to trigger the file when the value of the slider is within a certain range, but the following values within that same range shouldn't trigger the file again. For example, when the value is 14 it would trigger the file for the first time, but if the following value is 15 i don't want to trigger the file again. I just want to triger a file when the first value of a certain range is received, the other following values of the same range shouldn't trigger that file again.
I hope i explained well my problem. Any tips (object, some logic, etc.) of how to do this?
Thanks in advance.
Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
On Mon, 24 Mar 2003, arm pdlist wrote:
I've been scratching my idea for a few hours and i can't do the patch i want. Here's the deal:
I have a slider that outputs values from 0 to 100. Then, say from 0 to 20 i want to trigger file1.avi, from 21 to 40, trigger file2.avi, and so on. The problem is that whenever i change the slider within a certain range (say range from 0 to 20) the file is always being triggered. I want to trigger the file when the value of the slider is within a certain range, but the following values within that same range shouldn't trigger the file again. For example, when the value is 14 it would trigger the file for the first time, but if the following value is 15 i don't want to trigger the file again. I just want to triger a file when the first value of a certain range is received, the other following values of the same range shouldn't trigger that file again.
I hope i explained well my problem. Any tips (object, some logic, etc.) of how to do this?
Quick solution. Map 0-20 -> 0 21-40 -> 1 41-60 -> 2 61-80 -> 3 81-99 -> 4
(integer-division by 20 or something)
Then use the "change" object for those output-values. "Change" filters out the numbers that are equal to the last value passing thru.
On Mon, 24 Mar 2003, [iso-8859-1] arm pdlist wrote:
I have a slider that outputs values from 0 to 100. Then, say from 0 to 20 i want to trigger file1.avi, from 21 to 40, trigger file2.avi, and so on. The problem is that whenever i change the slider within a certain range (say range from 0 to 20) the file is always being triggered. I want to trigger the file when the value of the slider is within a certain range, but the following values within that same range shouldn't trigger the file again. For example, when the value is 14 it would trigger the file for the first time, but if the following value is 15 i don't want to trigger the file again. I just want to triger a file when the first value of a certain range is received, the other following values of the same range shouldn't trigger that file again.
[---------|-------] (slider) | [/ 20] | [int] | [change] | [outlet]
If you need to deal with sensor data you probably want a hysteresis loop around all transitions, cause the sensor output may fluctuate around a threshold causing too many changes.
[---------|-------] (slider)
|
[/ 20]
|
| [r hysteresis]
| /
[+ ]
|
[int]
|
[change]
|
[t f f]
X (crossed wires)
[- ]
|
| [* .2]
| |
| [s hysteresis]
|
[outlet]
I hope my ascii art is readable...
j#|@
This should work, it's probably not the most elegant, efficient or easiest way but it was the first in my head_
See if you can make sense of it, see attachment.
Basically what's happening is that when each value is filtered and sent to the output they pass through a spigot which as well as passing the value to whatever is next closes itself by triggering a '0' message so no more floats of that value can pass through. The spigot also turns all other spigots on with a '1' message, resetting any previously triggered value.
Does that make sense? Hope so All the best, Ed_ ed@suppose.co.uk -----Original Message----- From: pd-list-admin@iem.kug.ac.at [mailto:pd-list-admin@iem.kug.ac.at] On Behalf Of arm pdlist Sent: 24 March 2003 17:14 To: pd-list@iem.kug.ac.at Subject: [PD] Please help with a patch i want to do
I've been scratching my idea for a few hours and i can't do the patch i want. Here's the deal:
I have a slider that outputs values from 0 to 100. Then, say from 0 to 20 i want to trigger file1.avi, from 21 to 40, trigger file2.avi, and so on. The problem is that whenever i change the slider within a certain range (say range from 0 to 20) the file is always being triggered. I want to trigger the file when the value of the slider is within a certain range, but the following values within that same range shouldn't trigger the file again. For example, when the value is 14 it would trigger the file for the first time, but if the following value is 15 i don't want to trigger the file again. I just want to triger a file when the first value of a certain range is received, the other following values of the same range shouldn't trigger that file again.
I hope i explained well my problem. Any tips (object, some logic, etc.) of how to do this?
Thanks in advance.
Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com
PD-list mailing list PD-list@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-list
Hallo, arm pdlist hat gesagt: // arm pdlist wrote:
I have a slider that outputs values from 0 to 100. Then, say from 0 to 20 i want to trigger file1.avi, from 21 to 40, trigger file2.avi, and so on. The problem is that whenever i change the slider within a certain range (say range from 0 to 20) the file is always being triggered. I want to trigger the file when the value of the slider is within a certain range, but the following values within that same range shouldn't trigger the file again. For example, when the value is 14 it would trigger the file for the first time, but if the following value is 15 i don't want to trigger the file again. I just want to triger a file when the first value of a certain range is received, the other following values of the same range shouldn't trigger that file again.
Looks like a case for [moses].
Frank Barknecht _ ______footils.org__