In this paper, the dynamic multi-swarm particle swarm optimizer (DMS-PSO) is improved by hybridizing it with the harmony search (HS) algorithm and the resulting algorithm is abbreviated as DMS-PSO-HS. We present a novel approach to merge the HS algorithm into each sub-swarm of the DMS-PSO. Combining the exploration capabilities of the DMS-PSO and the stochastic exploitation of the HS, the DMS-PSO-HS is developed. The whole DMS-PSO population is divided into a large number of small and dynamic sub-swarms which are also individual HS populations. These sub-swarms are regrouped frequently and information is exchanged among the particles in the whole swarm. The DMS-PSO-HS demonstrates improved on multimodal and composition test problems when compared with the DMS-PSO and the HS.