How to detect when a flow of messages stop?


    Mar 30 2019 | 4:18 am
    I want to be able to set a value back to an initial state of zero whenever a flow of numbers stops being sent. What would I use to check for this?

    • Mar 30 2019 | 7:23 am
      [delay]. Every new bang cuts off the one being delayed, so nothing is output till the delay time is reached.
    • Mar 30 2019 | 12:56 pm
      I think a metro is needed to check if the delay time is reached? How could I do this with just a delay? Delay will send all the bangs at a delayed time regardless of how many are coming in, to my understanding none of these bangs are cut off, so it's always being sent.
    • Mar 30 2019 | 1:04 pm
      I know having a delay will end up setting the value back to zero, but want to know if there is a function that will only bang once after it detects a flow of data has stopped.
    • Mar 30 2019 | 1:22 pm
      I'm not sure exactly what you're after. Unless I'm missing something [delay] does what you've described. Can you post your patch?
      EDIT: Oops, I missed your 2nd post. From the documentation: Only one bang at a time can be delayed by delay. If a bang is already in delay when a new bang is received in the left inlet, the first bang is forgotten. HTH.
    • Mar 30 2019 | 1:40 pm
      if there is a function that will only bang once after it detects a flow of data has stopped.
      one might think that it is required to have something steadily sending out the other state, but this is not case. if you just mix the data stream (saying "hi, i am present") with the state the delay object reports ("data stream stopped now"), these two will not interfere: #P button 249 304 15 0; #P button 49 305 15 0; #P window setfont "Sans Serif" 9.; #P number 151 357 49 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 1; #P newex 221 263 77 9109513 t 0; #P newex 75 262 77 9109513 t 1; #P newex 221 173 77 9109513 t b; #P button 120 79 38 0; #P newex 221 221 77 9109513 delay 500; #P connect 4 0 5 0; #P connect 4 0 7 0; #P connect 3 0 6 0; #P connect 3 0 5 0; #P connect 1 0 3 0; #P connect 1 0 2 0; #P connect 0 0 4 0; #P connect 2 0 0 0; #P window clipboard copycount 8;
    • Mar 30 2019 | 1:52 pm
      I put some comments in it to try to explain what I want
      Max Patcher
      In Max, select New From Clipboard.
    • Mar 30 2019 | 2:10 pm
      As Roman showed, [delay] needs a bang. Floats don't get delayed. Maybe that was the missing ingredient?
      Max Patcher
      In Max, select New From Clipboard.
    • Mar 30 2019 | 2:32 pm
      Ah yes this was it, everything seems to be working as I want now, thank you very much!
    • Mar 30 2019 | 7:34 pm
      For me, the easiest method would be to use:
      bang clocker 1000 sel 1000 message "0"
      (assuming 1000 ms of no input)
    • Mar 30 2019 | 10:51 pm
      Thank you Pedro, I will look into using this as well!