There are two aspects to setting steam locomotive valves correctly.
One is the valve
TIMING, which can be affected by the quartering of the drive wheels and the valve gear settings. If the rhythm of the exhausts beats is not perfectly even (there may be a longer pause between two beats, or two beats hit closer together than the others) then the valves are said to be out of
TIME.
If one (or more) exhausts are noticeably louder or softer than the others, then the valve
POSITION is not right. One of the valves is too far forward or back from the correct center position where it should be.
I guess you could say that it is an art to get the valves on a steamer set perfectly. However there are very precise measuring points in the valve gear that can be observed to determine how to adjust things to make it right. "Trailing" the valves is the procedure used to measure exactly where the valves are as they move through a power stroke. Trailing the valves is a procedure where a dead steam locomotive is slowly moved (by another locomotive) through one revolution of the drive wheels with an apparatus attached to the valves that makes marks on a card that shows the position of the valve throughout the stroke. By reading those cards and taking measurements on the card and the valve involved, a mechanic can quickly see whether the valves are in the right position throughout the stroke and whether the valve gear is moving them properly. Knowing what adjustments are needed in the valve gear to make things right is where the "art" comes into play.
It's like the guy who takes his car to a mechanic because it is idling roughly. The mechanic opens the hood, takes out a screwdriver, adjusts the idle mixture and the car smooths right out. He closes the hood and says to the driver, "That will be ten dollars." The driver says, "TEN DOLLARS! All you did was turn a screw! It didn't take you 30 seconds to do that!" To which the mechanic calmly replied, "It's only 50 cents for turning the screw. The other $9.50 is for knowing which screw to turn, which way and how far."
Same for setting the valve gear on a steamer. The really GOOD guys, like
Robert Franzen, the guy who set the valves on the 765, know which adjustment to make, which way to adjust it and how far it should go.