dupliverts and wave effect

I was just watching that colour my world M&Ms commercial when I thought, hey, this shouldn’t be too hard to make in blender with dupliverts and the wave effect.

the commercial looks like a sea of M&Ms and they’re changing colour

I tried, but the problem was that the dupliverted M&Ms don’t follow the wave pattern like its parent mesh.

could this be done with lattices?