Forums > MaxMSP

Limiting the number of inputs

February 28, 2009 | 3:21 am

Hello,

Newbie here: I am trying to limit the number of inputs from a spring mounted sensor. The bouncy nature of the spring causes multiple pulses to be sent. How can we get MAX to take the first pulse, ignoring all other pulses, and hold the output from that first pulse for 2 seconds before taking the next pulse, ignoring all latter pulses and hold the output for 2 seconds?


April 30, 2009 | 7:28 pm

I have a similar problem i would like to solve. I would like that a audio signal from a adc~ will trigger a record~ object to record the same signal. but after the first trigger it should be ignored for the recording time of the buffer. did you find a solution?
i just need an object which puts out a "bang" or "1" once, and doesn’t repeat it if the same trigger comes in again.
thanks for any help

m


April 30, 2009 | 8:11 pm

"How can we get MAX to take the first pulse, ignoring all other pulses, and hold the output from that first pulse for 2 seconds before taking the next pulse, ignoring all latter pulses and hold the output for 2 seconds?"

You could use the first pulse to trigger the closing of a gate object (inbetween the output of pulses and whatever they are triggering) and to also trigger a [delay 2000.] object which would then reopen the gate.

I’m new to max as well, but I don’t know of an object that will only bang once even when receiving multiple bangs (there may be one). Gating will sort it out though.


April 30, 2009 | 8:19 pm

onebang


April 30, 2009 | 8:32 pm

hey thanks for the reply…
i was working with "incdec" and "sel" objects now and finally found a way.
incdec is taking each single input and adds it trough a "inc" message. On the output i put a sel object which selects number one and puts out a bang. with a delay i have a 0 coming in as you suggested as well. this will stop the record. works perfect.

i was trying several ways with the gate but it didn’t work for me…
but this way it works… Smile

best m

(gonna check out onebang now)


April 30, 2009 | 8:46 pm

My bad, no need there at all for a gate. Heres an even easier way though. Although I’m not sure you need any of this if you just want record~ to stop when the buffer is full. It will automatically stop recording when the buffer length is reached.

(copy text below and choose file > new from clipboard in case you’ve not done this before)

– Pasted Max Patch, click to expand. –

April 30, 2009 | 9:14 pm

thanks
the problem was that it will get to the end. cause if the record~ gets a "1" input again before the buffer is full the recording will start from the beginning and it will just end recording when no input is coming anymore so the recording will be silent.

(your advice with the clipboard was good … but from there it was still text and i couldn’t make it a patch… newbie as well)


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