Tap tempo utility in Max for Live
This patch is, in many ways, identical to the patch shown in "Tap to teach tempo to Max", but in this instance it's implemented in a way that will work as a device in Max for Live. Instead of setting the tempo attribute of the Max transport object, we're setting the tempo property of the live_set object in the Live Object Model. The loadmess object (which could just as well be a live.thisdevice object in Max for Live), queries the ID of the live_set and passes it to the live.object object. Thus, a set tempo message to that live.object will be addressing the tempo property of the current Song (live_set).
Note: In this patch we use the button object to tap the tempo. If you use live.button instead, the patch will work the same way, but with the difference that you can map the live.button to be triggered by a keystroke or a MIDI message.