Tap Tempo - improved accuracy

Max was used to write an advance tap tempo calcualte
or for accurate syncronisation of a rewire host application with a live drummer.
Hi there, I was wondering how do you connect it to a midi foot pedal, ive managed to get it working with live but am having trouble getting it to work with midi foot pedal?