We present a theory for the generation of mesoscale ($kr_{g}ll 1$, where $r_{g}$ is the cosmic ray gyroradius) magnetic fields during diffusive shock acceleration. The decay or modulational instability of resonantly excited Alfven waves scattering off ambient density perturbations in the shock environment naturally generates larger scale fields. For a broad spectrum of perturbations, the physical mechanism of energy transfer is random refraction, represented by diffusion of Alfven wave packet in $k-$space. The scattering field can be produced directly by the decay instability or by the Drury instability, a hydrodynamic instability driven by the cosmic ray pressure gradient. This process is of interest to acceleration since it generates waves of longer wavelength, and so enables the confinement and acceleration of higher energy particles. This process also limits the intensity of resonantly generated turbulent magnetic field on $r_{g}$ scales.