Added tempo calculation (just for fun).