Take a look at this:
http://www.kesr-operating.org.uk/walschaert animation.htm
Steam locomotives with the usual standard type cylinder on each side with the usually found valves and gear will produce four chuffs per revolution of the wheels. That's because the piston is double acting, meaning it's driven in one direction by steam, and then exhausts that steam while being driven back the other way while the other side is being driven by steam. The valves choose which side is getting the steam and which side is the exhaust.
(You folks from the live steam section will please pardon the oversimplification here.... )
The point is, and you'll see it if you watch the above, that you have two exhaust strokes per cylinder per revolution, for a total of four. At some point early in the locomotive's history, the exhaust steam was routed into the bottom of the smokebox and up the stack which acts as a sort of muffler, and also provides draft on the fire. Thus, each time the locomotive's wheels turn, there are four times that the valve opens, and the exhaust steam is blown out, and up the stack. Because the two sides of the locomotive are 90 degrees different (when the main rod is at the very top on one side, it will be halfway down on the other...) you have four (nearly) evenly spaced beats from the exhaust instead of the two large ones you'd get if they were the same, or 180 degrees apart.
With a shay, you often have three cylinders, and thus six exhaust beats per turn of the CRANKSHAFT .... which will translate to turn of the wheels depending on what gearing the crankshaft has to the gear on the wheels, which varied from model to model.
Make sense?
Matthew (OV)