A ball-end cutting tool is usually chosen to mill free-form surfaces in finishing operations. The cutting speed, which is calculated considering the nominal tool diameter, reduces along the tool path, according to tool-surface contact and the effective tool diameter. This brings several drawbacks to the manufacturing process. The current work presents a new algorithm to optimize CNC codes for milling free-form surfaces by parametrizing and adjusting the spindle frequency and the feed rate, considering the tool-surface contact. The proposed algorithm introduces new values for spindle frequency (S) and for feed rate (F) at each line of the CNC code, according to the surface topography. Machining experiments show that the proposed algorithm can reduce the milling time up to 40%, as well as reduce the machining force up to 21%, compared to the ordinary CNC codes. By keeping the cutting speed and feed rate constant, the surface roughness was improved—confirmed by ANOVA analysis—due to the increased shear mechanism rather than ploughing, especially in areas where the effective tool diameter is smaller.