Delay float input until bang received

Jack Hardwick's icon

Hi there,

Very new to this Max game, but on a strict timeline and I feel like I searched for every variation of this question I can think of, so I'm resorting to asking for help here.

How do I have a continuous stream of data going, and then have a system where an object only passes on the most recently received piece of information when it receives a bang. My example is that I'm using the fzero~ pitch tracking object and it's sending out a basically continous stream of data from it's frequency output, but I want for an object to only pass on this data when a bang is received in another object. My immediate though was to use a gate and send a bang to the left inlet and fzero~'s output to its right inlet, but after 2 hours of fiddling around I'm not getting anywhere with this approach.

Any help would be appreciated incredibly, and ask if you need clarification about what I'm asking!

Bill 2's icon

Like this?

Max Patch
Copy patch and select New From Clipboard in Max.

It works because of Max's hot and cold inlets.

Roman Thilenius's icon

[i], [f], and [zl reg] store incoming data from its right inpout and output the data held when you bang the left input.

but many other objects also allow you to use the "set" command to do the same for the first inlet only.

"7"
[prepend set]
[pack 0 hallo]