This example shows a super simple tap tempo implementation. The patch alters the transport tempo based on the rate at which you tap the “t” key. This method simply 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.
To create a poly-rhythm generator, this example chooses a division and articulates every attack point of that division. Use a metro synched to the transport to specify the divisions (or the tempo object, if preferred), and then use a counter (or a % object with the output of tempo) to specify the articulation points.
This example explores some approaches to recording and playing events in Max.
The mtr object is made for recording messages and playing them back in the same rhythm as they were recorded––see the top-left portion of the patch.
This example shows how can you create a visual metronome, synced to the transport, that flashes white at the beginning of each bar.
This exmaple demonstrates how to synchronize MIDI note length with a tempo determined by the transport object. The translate object has a "transport" attribute which allows control through the transport object.
To coordinate the tempo of the transport object with the length of a recorded audio loop, get the duration of the loop in milliseconds, divide it by the number of beats, and divide the result in 60,000 (ms per minute) to calculate the tempo of the transport in beats per minute.
When using a tempo-relative timing unit (such as ticks) for metro, rather than the tempo-independent ms, the metro becomes linked to the transport. In such cases, the transport has to be running for the metro to work. This example shows 2 tempo-relative metro objects.
The translate object performs conversions from one kind of time unit to any other, and is particularly useful when you need to convert from a tempo-relative time unit to a clock time unit (e.g., convert note values to milliseconds) or vice versa. In this example, try changing the bpm tempo of the transport, and you'll see that the translate object sends out updated information whenever the tempo changes.
In large and complex patches that have many pattr objects, it might be useful to be able to communicate with all of them at one central location. That is the purpose of the pattrhub object. With pattrhub you can alter the contents of any pattr just by using the name of the pattr followed by the data you want to put in it.