Hallo, Olaf Matthes hat gesagt: // Olaf Matthes wrote:
qweqwe wqwewq wrote:
Geetings. I'm new to this forum and PD.
I have to do a work in my University and i'm using PD and 3 MIDI pressure sensors. Based in the output of that sensors, i need to launch 7 different patches in PD. So, i need to have a little abstraction where i analyse the 3 sensors: - sensor 1 will output 0 if its below 30 and 1 if its below 30 and below 127
- sensor 2 will output 0 if its below 50 and 1 if its below 50 and below
127
- sensor 3 will output 0 if its below 70 and 1 if its below 70 and below
127
[split 30 127] from maxlib (http://www.akustische-kunst.org/puredata/maxlib/) can help you.
You could also just use moses, either two times or just ignore the upper bound, because most midi cc messages don't go above that.
Another problem is this. I want to read the inputs with 1 min interval, so a patch will stay for one minute minimum, after that i'll read the values, and if they are diferent, it'll launch another patch. If they are the same, it'll stay the same patch and will not retrigger the same one.
[speedlim 60000] from maxlib or cyclone (http://suita.chopin.edu.pl/%7Eczaja/miXed/externs/cyclone.html) can do this. Or use [ignore 60000], it will only allow values to pass through that stay unchanged for one minute.
Then there is [change] and [delay] wich both are build-in.
And finally, another problem... I'll give priority above all other sensors to sensor 1. This is: when i read the values, if the reading in the sensor 1 is greater than 70 from the previous reading (say, last reading was 27 and next min i have 120), it will launch a certain patch of the total 7 that i have (patch 7 for example) and in this case the outs of sensor 2 and 3 wont matter.
What happens, if sensor 1 was inactive in the previous go???
[delta] (maxlib again) will give you the difference between the current and the previous value. The higher the value the bigger the change.
Olaf-the-self-advertiser
Here I could advertise ">" or "<" or hierarchical "route" objects.
I attached an example. It converts your 8 possible states to a number, that is only output if your either bang (after for example a minute), or if it changes.
You could do whatever you want with that number, it is unique for every state possible.
I did not account for your last problem yet, because of my open question. Depending on the answer, you would do something with the toggle-state of sensor 1 like send it to a spigot.
Frank Barknecht _ ______footils.org__