Tap to teach tempo to Max

This patch implements tap tempo using a "simple moving average" (SMA) calculation of time between taps. The patch alters the transport tempo based on the rate at which you tap the 't' key. The method takes the average of the most recent three time intervals between the most recent four taps. So, once you tap four times, it will set the transport tempo to your tempo, and if you keep tapping it responds to your changes but takes a couple beats to move gradually to your new tempo.

Windowing an audio signal

In signal processing, a "window" is a function (shape) that is nonzero for some period of time, and zero before and after that period. When multiplied by another signal, it produces an output of 0 except during the nonzero portion of the window, when it exposes the other signal. The simplest example is a rectangular window, which is 0, then briefly is 1, then reverts to 0. The windowed signal will be audible only when it is being multiplied by 1––i.e., during the time when the rectangular windowing occurs.