What proportions should a thermally massive building have? How should the thermal mass be distributed? Should the "massing" change with the choice of material? This paper shows how to optimize the physical proportions of a building so that it synchronizes ambient heat exchanges in a natural feedback cycle. The internal mass is thermally coupled with buoyancy ventilation; the cycle is driven by the daily swing of outdoor temperature. Tripling up functions in this way—so that structural materials can reliably cool and power the ventilation for buildings—could help decarbonize the construction industry and provide an effective strategy for adapting to life-threatening heatwaves. Based on harmonic analysis, the method allows designers to thermally tune the form and mass of a building to meet chosen targets for temperature and ventilation in free-running mode. Once the optimal balance of exchange rates is known, design teams can proportionally vary the building height and ventilation openings against the surface area and thickness of an internal thermal mass. The possible permutations are infinite but parametrically constrained, allowing teams to fairly compare the functional and environmental credentials of different construction materials while they produce and evaluate preliminary options for organizing the exterior form and interior spaces of a building. An example study suggests that thin-shell structures of minimum weight, and even timber buildings, may be optimally tuned to produce ample ventilation and temperature attenuation.