We have modeled the effective elastic moduli — and hence the compression and shear wave velocities — of dry sandstones. The modeling is distinctly different in two ranges of porosity ϕ: from zero to the consolidation limit (consolidated regime), where the rock is treated as continuous material containing pores and cracks, and from to the critical porosity , where the rock is transitioning to a granular material (unconsolidated regime). In the consolidated regime, the modeling is micromechanics based and yields the moduli in terms of porosity, pore-shape factor, and crack density, based on the noninteraction approximation with the Mori-Tanaka correction for interactions. By necessity, it contains empirical parameters reflecting highly irregular shapes of pores and microcracks. In the unconsolidated regime, we propose empirical relations of the Mori-Tanaka type where pore-shape factors assume large values, consistent with very soft, concave pore shapes typical in this regime. Combined, the two models can be viewed as a sand diagenesis model for the entire range of porosities, from zero to . Its predictions cover the available experimental data on arenites, the most ubiquitous group of sandstones. Finally, our empirical relations for inorganic shales express bedding-normal velocities as functions of porosity and total clay content.