Snapshot of a signal

Similarly to the sample and hold object sah~, the snapshot~ object can be used to capture the amplitude of a signal at a specific instant. Whereas sah~ sends out a constant signal, however, snapshot~ sends out a single Max message. Thus, you can think of snapshot~ as providing a message that “takes a snapshot” of, and reports the amplitude of, a signal at one specific instant. You can either trigger snapshot~ with a ‘bang’ message, or you can set it to report automatically at a certain interval of time.

 

report signal value

This patch does almost exactly the same thing as the example demonstrating Sample and hold. The main distinction is that snapshot~ is controlled by the Max event scheduler, whereas the sah~ object uses a triggering signal, and thus is potentially “sample-accurate” in its timing. If you don’t need sample-level timing accuracy, this snapshot~ method is slightly more computationally efficient.

The noise~ object continually produces random sample values from -1 to 1. The snapshot~ object grabs and reports one of those samples every 125 ms. Using a *~ and a +~ object, we can move that value (from -1 to 1) into a range from 440 to 880 (660 ± as much as 220) to be used as the frequency value for a cycle~ oscillator.