Usage patterns
〈動詞〉拍子にjust as/at the moment of doing something (often with an unexpected result)
Just as I stood up suddenly, I bumped into the table.
拍子を取るto keep the beat/time
The teacher sang while keeping the beat with her hand.
拍子が合うto be in time/rhythm (with something)
The performers were perfectly in time with each other.
拍子が狂うfor the rhythm/timing to be thrown off
Because of nervousness, my timing got thrown off.