[PD] conditional flow in a patch?

Olaf Matthes olaf.matthes at gmx.de
Tue Nov 25 12:36:25 CET 2003

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.

>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.

>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.
[delta] (maxlib again) will give you the difference between the current 
and the previous value. The higher the value the bigger the change.


More information about the Pd-list mailing list